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

Prepared statements not working with Dolt table functions #807

Open
tbantle22 opened this issue Oct 3, 2024 · 0 comments
Open

Prepared statements not working with Dolt table functions #807

tbantle22 opened this issue Oct 3, 2024 · 0 comments
Labels
bug Something isn't working workbench Issue related to dolt-workbench

Comments

@tbantle22
Copy link
Contributor

Query:

q: "SELECT * FROM dolt_diff_stat($1, $2)"
p: ["HEAD", "WORKING"],

Error:
error: unsupported syntax: :v1 (errno 1105) (sqlstate HY000)

Query with type cast:

q: "SELECT * FROM dolt_diff_stat($1::text, $2::text)"
p: ["HEAD", "WORKING"],

Error:

error: runtime error: invalid memory address or nil pointer dereference
    at Parser.parseErrorMessage (/Users/taylor/go/src/github.com/dolthub/doltgresql/testing/postgres-client-tests/node/node_modules/pg-protocol/dist/parser.js:283:98)
    at Parser.handlePacket (/Users/taylor/go/src/github.com/dolthub/doltgresql/testing/postgres-client-tests/node/node_modules/pg-protocol/dist/parser.js:122:29)
    at Parser.parse (/Users/taylor/go/src/github.com/dolthub/doltgresql/testing/postgres-client-tests/node/node_modules/pg-protocol/dist/parser.js:35:38)
    at Socket.<anonymous> (/Users/taylor/go/src/github.com/dolthub/doltgresql/testing/postgres-client-tests/node/node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:520:28)
    at addChunk (node:internal/streams/readable:559:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:510:3)
    at Readable.push (node:internal/streams/readable:390:5)
    at TCP.onStreamRead (node:internal/stream_base_commons:191:23) {
  length: 85,
  severity: 'ERROR',
  code: 'XX000',
  detail: undefined,
  hint: undefined,
  position: undefined,
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  schema: undefined,
  table: undefined,
  column: undefined,
  dataType: undefined,
  constraint: undefined,
  file: undefined,
  line: undefined,
  routine: undefined
}

There are a bunch of workbench tests here that could be updated to use prepared statements

@tbantle22 tbantle22 added bug Something isn't working workbench Issue related to dolt-workbench labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working workbench Issue related to dolt-workbench
Projects
None yet
Development

No branches or pull requests

1 participant