Skip to content
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 - regex #2410

Closed
nullromo opened this issue Sep 18, 2020 · 5 comments · May be fixed by #2386
Closed

UNKNOWN_CODE_PLEASE_REPORT - regex #2410

nullromo opened this issue Sep 18, 2020 · 5 comments · May be fixed by #2386

Comments

@nullromo
Copy link

nullromo commented Sep 18, 2020

Node version: v12.18.0
mysqljs version: ^2.18.1

Got this error from mysqljs today:

  ERROR Error: UNKNOWN_CODE_PLEASE_REPORT: Syntax error in regular expression on line 1, character 11.
      at Query.Sequence._packetToError (/c/Users/.../node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
      at Query.ErrorPacket (/c/Users/.../node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
      at Protocol._parsePacket (/c/Users/.../node_modules/mysql/lib/protocol/Protocol.js:291:23)
      at Parser._parsePacket (/c/Users/.../node_modules/mysql/lib/protocol/Parser.js:433:10)
      at Parser.write (/c/Users/.../node_modules/mysql/lib/protocol/Parser.js:43:10)
      at Protocol.write (/c/Users/.../node_modules/mysql/lib/protocol/Protocol.js:38:16)
      at Socket.<anonymous> (/c/Users/.../node_modules/mysql/lib/Connection.js:88:28)
      at Socket.<anonymous> (/c/Users/.../node_modules/mysql/lib/Connection.js:526:10)
      at Socket.emit (events.js:315:20)
      at addChunk (_stream_readable.js:295:12)
      --------------------
      at Protocol._enqueue (/c/Users/.../node_modules/mysql/lib/protocol/Protocol.js:144:48)
      at PoolConnection.query (/c/Users/.../node_modules/mysql/lib/Connection.js:198:25)
      at internal/util.js:297:30
      at new Promise (<anonymous>)
      at PoolConnection.query (internal/util.js:296:12)
      at Connection.promiseQuery (/c/Users/.../server/connection.js:70:14)
      at /c/Users/.../server/sqlAdapter.js:86:35
      at processTicksAndRejections (internal/process/task_queues.js:97:5) {
    code: 'UNKNOWN_CODE_PLEASE_REPORT',
    errno: 3688,
    sqlMessage: 'Syntax error in regular expression on line 1, character 11.',
    sqlState: 'HY000',
    index: 0,
    sql: '\n' +
      '                SELECT\n' +
      '                    serial_number as serialNumber\n' +
      '                FROM\n' +
      '                    serial_numbers\n' +
      '                WHERE\n' +
      '                    configuration_id = 6 AND\n' +
      '                    serial_number REGEXP "18.?KM0D????"\n' +
      '                ORDER BY\n' +
      '                    serial_number DESC\n' +
      '            ;'
  }

Couldn't find anything about UNKNOWN_ERROR_PLEASE_REPORT having to do with regular expressions among the open issues. Perhaps mysqljs does not know how to interpret the error code for this error.

If it's not clear, "????" is not allowed in a regular expression, so I assume that's the source of the error.

@ChrisBark
Copy link

lib/protocol/constants/errors.js doesn't have an entry for error 3688, so it sets the code to UNKNOWN_ERROR_PLEASE_REPORT

@ChrisBark
Copy link

3819 is also missing if I can lump it together with this reported issue

@nullromo
Copy link
Author

code 3688 = ER_REGEXP_RULE_SYNTAX as per this reference but it looks like the file lib/protocol/constants/errors.js is generated by tool/generate-error-constants.js. This error code was added in MySQL version 8.0.4, and lib/protocol/constants/errors.js says that it was generated with MySQL version 5.7.29. So I think the error codes file should be re-generated with the latest MySQL version, but I'm guessing there are compatibility issues with either the generated file or with the generator itself.

@ARitz-Cracker
Copy link

I've already created a pr that deals with this, #2386. It works well, though we'll have to see if it'll ever be merged

@dougwilson
Copy link
Member

Thanks everyone! Yea, it looks like this is an error code added in MySQL 8.0.4 and is in the referenced PR to get merged in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants