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

Node process ends when selecting ROWID #1539

Closed thuna-garry closed 1 year ago

thuna-garry commented 1 year ago

Node process simply ends when selecting ROWID if query has joins.

Pre-requisite

create table foo as (select * from cat)

Failing query. Node process just ends -- no error messages, no catchable exceptions, nada!

    select 1
         , A.rowId
    from foo A
       , foo B
    where A.rowId != B.rowId

Note that the above query works in sqlplus.

Successfu query. Don't select a ROWID.

    select 1
         --, A.rowId
    from foo A
       , foo B
    where A.rowId != B.rowId

Oracle version: Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production process.platform: win32 process.version: v18.12.1 process.arch: x64 require('oracledb').versionString: 5.5.0 require('oracledb').oracleClientVersionString: 12.2.0.1.0

anthony-tuininga commented 1 year ago

I believe this is a known issue. Try following the instructions noted in this comment and let us know!

thuna-garry commented 1 year ago

Does does indeed allow the query to run. Requires that ORA_OCI_NO_OPTIMIZED_FETCH = 1 is set prior to loading the oracle client Thanks Anthony.

As ORA_OCI_NO_OPTIMIZED_FETCH = 1 will be set for the entire run time of the app, what does it actually do? It may be there but I didn't find any reference to it in the OCI docs.

anthony-tuininga commented 1 year ago

It disables "optimised" fetch. This is a mode that allows repeated values to be replaced by a simple bit vector -- so a simple compression approach. For data that is sent across a wide area network the difference can be substantial, but for data sent over a fast local network the difference is neglibile. There is a known bug that causes repeated rowid values to crash the client. If you can avoid fetching repeated rowids this environment variable is not needed. Hope that explains things adequately!