The non-idempotent column handler problem

Open
#1,779 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
javascript, node.js
Domain
api, database

Research direction

Start with the supplied JavaScript reproduction in thin mode and trace how fetchTypeHandler metadata is reused when the same SQL is executed twice. Inspect the statement-cache path; done means repeated executions do not carry the prior metadata.name mutation and the regression is covered by a test.

Written by the indexing model from the issue text.

Description

bug

The error https://github.com/oracle/node-oracledb/issues/1769 has appeared in a new version.

const sql = `SELECT to_blob('') as b FROM dual`;
const fetchTypeHandler = metadata => {
  console.log('metadata.name.before =', metadata.name);
  metadata.name += '_tail';
  console.log('metadata.name.after =', metadata.name);
};
await conn.execute(sql, {}, { outFormat: oracledb.OUT_FORMAT_OBJECT, fetchTypeHandler });
// call the same sql twice:
await conn.execute(sql, {}, { outFormat: oracledb.OUT_FORMAT_OBJECT, fetchTypeHandler });

prints:

metadata.name.before = B
metadata.name.after = B_tail
metadata.name.before = B_tail
metadata.name.after = B_tail_tail

It is probably related to statements cache.

oracledb@7.0.0
thin mode

Dominant language
JavaScript
Stars
2.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from oracle/node-oracledb

All issues in oracle/node-oracledb

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.