-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UNKNOWN_CODE_PLEASE_REPORT - Code 4025 #1982
Comments
This is the correct behaviour for the defined CONSTRAINT and the given example. Both XOR-truth-table
check https://en.wikipedia.org/wiki/Exclusive_or for details on the logic of how XOR works. Closed: no mysqljs error |
@kai-koch Yes, I'm aware how XOR works. The given query is intended to fail, as we were testing that the constraint is in place and properly set up. The reason I posted this is the fact that the error is called "UNKNOWN_CODE_PLEASE_REPORT" so it sounds like a code that needs to have a name defined for it. Here's the error info:
|
Thanks, for providing more information. Is the error-trace from the same script as the mysqljs error in the initial posting? |
Yes, everything I pasted comes from the same run of the program. Version of mysqljs is 2.15.0. I'm not sure exactly where the output I posted in the original post fires from, though I assume it's a side effect of creating a Knex connection with To give you a bit of a bigger picture, our code uses Objection models on top of a Knex connection pool which I presume relies on mysqljs to interface to the server. That output and the stack were both generated when trying to insert an Objection entity that (purposefully) failed the constraint. |
Which client do you use in the knex-config / initialization? I have no experience with knex, but maybe the file '[...]/admin-api/node_modules/knex/lib/dialects/mysql/index.js' is not for the same version as the module '[...]/admin-api/node_modules/mysql/' Can you provide code that runs without knex and that reproduces the error? |
The code below reproduces this with just mysql. I ran it in the same project as the original above, so same version, etc. I took a (very brief) look through mysqljs and to me it seems that Query extends Sequence and calls its _packetToError which tries to map packet.errno to an error defined in Errors. However, errors.js only lists errors up to 3198, so this packet's 4025 is unmapped. It may be as simple as needing to add the two lines to map that value, though I don't know what other impact this could have, or what the expected name would be for this.
Output (starting after the auth success packets):
|
Yes, that is also my assumption. |
Hi sorry for my absence. Yes, the constant for 4025 is not in our file. You can also see from the message at the top of the file not to modify it by hand :) The file is populated using the tool shown in the comments at the top of the time from MySQL source files. Looking into this, it seems like MariaDB has a bunch of their own, custom error in the 4xxx range. Since the error constants are only build from the MySQL source code, that would explain why this MariaDB-specific error is not there. The solution here is to update the tool to also scrape the error constants from the MariaDB source code in addition to just the MySQL source code. I'm working on that 👍 |
Got this from a failing constraint:
The failing constraint was defined as:
Server version is MariaDB 10.2.12
The text was updated successfully, but these errors were encountered: