Skip to content

UNKNOWN_CODE_PLEASE_REPORT - regex #2410

Closed
@nullromo

Description

@nullromo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions