oracle / oracle/node-oracledb

Changing rowid in the FREE database

Open Beginner friendly
#1,787 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Prerequisites:

docker run -d -p 1521:1521 -e ORACLE_PWD=admin container-registry.oracle.com/database/free:latest
CREATE USER nodejs_oracledb_tests IDENTIFIED BY nodejs_oracledb_tests;
GRANT ALL PRIVILEGES TO nodejs_oracledb_tests;
ALTER USER nodejs_oracledb_tests QUOTA UNLIMITED ON USERS;
export NODE_PATH=./lib/
export NODE_ORACLEDB_CONNECTIONSTRING=tcp://localhost/FREEPDB1
export NODE_ORACLEDB_USER=nodejs_oracledb_tests
export NODE_ORACLEDB_PASSWORD=nodejs_oracledb_tests

npx mocha ./test/lastRowid.js 

Output:

Thin mode selected

  228. lastRowid.js
    1) 228.1 examples
    ? 228.2 MERGE statement
    ? 228.3 Negative - not applicable to executeMany() (39ms)
    ? 228.4 INSERT ALL statement

  3 passing (390ms)
  1 failing

  1) 228. lastRowid.js
       228.1 examples:

      AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:
actual expected

'AAAlZDAQAAAAAAYDAAB'

      + expected - actual

      -AAAlZDAAAAAAAYDAAB
      +AAAlZDAQAAAAAYDAAB
      
      at Context.<anonymous> (test\lastRowid.js:83:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:104:5)

For some reason, this database (free) performs row shifting within files. Is there a way to harden the test against this?

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.

Research direction

Start with test/lastRowid.js, especially the assertion at line 83, and run the provided Docker, Oracle FREE, and npx mocha command to reproduce the rowid mismatch. Check how the example derives or compares the expected rowid across database versions; done means the test handles the FREE database's row shifting while still validating lastRowid behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
databases, testing
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.