Skip to content

Application is failing when query parameter isn't provided #41

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

Open
php-coder opened this issue Feb 21, 2024 · 0 comments
Open

Application is failing when query parameter isn't provided #41

php-coder opened this issue Feb 21, 2024 · 0 comments
Assignees
Milestone

Comments

@php-coder
Copy link
Owner

php-coder commented Feb 21, 2024

/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/protocol/Parser.js:437
      throw err; // Rethrow non-MySQL errors
      ^

Error: ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1
    at Sequence._packetToError (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
    at Query.ErrorPacket (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/protocol/sequences/Query.js:79:18)
    at Protocol._parsePacket (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/protocol/Protocol.js:291:23)
    at Parser._parsePacket (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/protocol/Parser.js:433:10)
    at Parser.write (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/protocol/Parser.js:43:10)
    at Protocol.write (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/protocol/Protocol.js:38:16)
    at Socket.<anonymous> (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/Connection.js:88:28)
    at Socket.<anonymous> (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/Connection.js:526:10)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    --------------------
    at Pool.query (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/mysql/lib/Pool.js:199:23)
    at /Users/coder/git/query2app/examples/js/express/mysql/routes.js:37:14
    at Layer.handle [as handle_request] (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/layer.js:95:5)
    at /Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:341:12)
    at next (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/express/lib/router/index.js:275:10)
    at jsonParser (/Users/coder/git/query2app/examples/js/express/mysql/node_modules/.pnpm/[email protected]/node_modules/body-parser/lib/types/json.js:110:7) {
  code: 'ER_PARSE_ERROR',
  errno: 1064,
  sqlMessage: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1",
  sqlState: '42000',
  index: 0,
  sql: 'SELECT id , name , name_ru , slug FROM categories LIMIT NULL'
}

Node.js v18.12.0

Regression after f524f15 (#23)

For golang/chi, it seems like empty parameters is being treated as 0 and a call returns [] as result.
For python/fastapi there is no support for post yet, so it's not affected.

@php-coder php-coder added the kind/bug Something isn't working label Feb 21, 2024
@php-coder php-coder added this to the 0.0.3 milestone Feb 21, 2024
@php-coder php-coder self-assigned this Feb 21, 2024
@php-coder php-coder changed the title Application is failing when query parameter isn't provided [js] Application is failing when query parameter isn't provided Mar 8, 2024
@php-coder php-coder changed the title [js] Application is failing when query parameter isn't provided Application is failing when query parameter isn't provided Mar 13, 2024
php-coder added a commit that referenced this issue Apr 6, 2024
…integration tests pass

Partically reverts changes from f524f15 commit.

Reopen #23
Part of #13
Relate to #41
@php-coder php-coder modified the milestones: 0.0.3, 0.0.4 Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant