oracle / node-oracledb

Oracle Database driver for Node.js maintained by Oracle Corp.
http://oracle.github.io/node-oracledb/
Other
2.24k stars 1.07k forks source link

Statement Cache causes ORA-00932 #1669

Closed sosoba closed 1 month ago

sosoba commented 1 month ago
  1. What versions are you using?
  1. Is it an error or a hang or a crash? crash

  2. What error(s) or behavior you are seeing?

Error: ORA-00932: inconsistent datatypes: expected NUMBER got TIMESTAMP
Help: https://docs.oracle.com/error-help/db/ora-00932/
    at Protocol._processMessage (./node_modules/oracledb/lib/thin/protocol/protocol.js:177:17)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ThinConnectionImpl._execute (./node_modules/oracledb/lib/thin/connection.js:200:7)
    at async ThinConnectionImpl.execute (./node_modules/oracledb/lib/thin/connection.js:880:14)
    at async Connection.execute (./node_modules/oracledb/lib/connection.js:900:16)
    at async Connection.<anonymous> (./node_modules/oracledb/lib/util.js:165:14)
    at async test.js
  1. Include a runnable Node.js script that shows the problem.
const sql = 'SELECT :x FROM DUAL';
await connection.execute( sql, [1] );  
await connection.execute( sql, [new Date()] );  

Perhaps parameter types shouldn't be part of the cache key?

sudarshan12s commented 1 month ago

Thanks @sosoba for the details . We will check and update.

sharadraju commented 1 month ago

@sosoba This is now fixed in 6.5.1. Please verify and thank you for contributing!

sosoba commented 1 month ago

@sosoba This is now fixed in 6.5.1. Please verify and thank you for contributing!

Works great. Thank you!