loopbackio / loopbackio/loopback-connector-mysql
compatibility issue with mysql aurora 8.0.* using regex
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 126
- Forks
- 181
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 12
Description
Steps to reproduce
- build a loopback datasource in a current mysql aurora (8.0.27 in my case)
- run a regex search:
https://foo.bar.com/api/foo?filter={%22where%22:%20{%22name%22:%20{%22regexp%22:%20%22/^foo/%22}}}
Current Behavior
results in an "500 Internal Server Error":
Request GET /foo?filter=%7B%22where%22:%20%7B%22name%22:%20%7B%22regexp%22:%20%22/%5Efoo/%22%7D%7D%7D failed with status code 500. Error: UNKNOWN_CODE_PLEASE_REPORT: Character set 'utf8mb4_general_ci' cannot be used in conjunction with 'binary' in call to regexp_like.
at Query.Sequence._packetToError (/home/node/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
at Query.ErrorPacket (/home/node/app/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
at Protocol._parsePacket (/home/node/app/node_modules/mysql/lib/protocol/Protocol.js:291:23)
at Parser._parsePacket (/home/node/app/node_modules/mysql/lib/protocol/Parser.js:433:10)
at Parser.write (/home/node/app/node_modules/mysql/lib/protocol/Parser.js:43:10)
at Protocol.write (/home/node/app/node_modules/mysql/lib/protocol/Protocol.js:38:16)
at Socket.<anonymous> (/home/node/app/node_modules/mysql/lib/Connection.js:88:28)
at Socket.<anonymous> (/home/node/app/node_modules/mysql/lib/Connection.js:526:10)
at Socket.emit (node:events:390:28)
at addChunk (node:internal/streams/readable:315:12)
Expected Behavior
Should return all regex matches for the selected model in the api response
Additional information
it is probably this issue:
https://stackoverflow.com/questions/64668364/character-set-binary-cannot-be-used-in-conjunction-with-utf8mb4-unicode-ci-i
node -e 'console.log(process.platform, process.arch, process.versions.node)'
linux x64 16.13.1
npm ls --prod --depth 0 | grep loopback
+-- @loopback/boot@4.0.0
+-- @loopback/cli@3.0.0
+-- @loopback/core@3.1.2
+-- @loopback/repository@4.1.2
+-- @loopback/rest-crud@0.12.1
+-- @loopback/rest-explorer@4.0.0
+-- @loopback/rest@11.1.2
+-- @loopback/service-proxy@4.0.0
+-- loopback-connector-mysql@5.4.4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the regexp filter failure with loopback-connector-mysql@5.4.4 against MySQL Aurora 8.0.27, using the request and environment details in the report. Inspect how the connector handles regexp searches and verify the query works without the collation error and returns all matching records.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, mysql, node.js
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100