Skip to content

Commit

Permalink
fixes to address feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
skuruppu committed Feb 14, 2024
1 parent ab01169 commit a32b39c
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class PGOid extends WrappedNumber {
value: string;
constructor(value: string) {
super();
this.value = value.toString();
this.value = value;
}
valueOf(): number {
const num = Number(this.value);
Expand Down
17 changes: 16 additions & 1 deletion system-test/spanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ describe('Spanner', () => {
});

describe('oids', () => {
it('POSTGRESQL should read pgOid values', function (done) {
it('POSTGRESQL should read non-null pgOid values', function (done) {
if (IS_EMULATOR_ENABLED) {
this.skip();
}
Expand All @@ -842,6 +842,21 @@ describe('Spanner', () => {
done();
});
});

it('POSTGRESQL should read null pgOid values', function (done) {
if (IS_EMULATOR_ENABLED) {
this.skip();
}
PG_DATABASE.run('SELECT null::oid', (err, rows) => {
assert.ifError(err);
let queriedValue = rows[0][0].value;
if (rows[0][0].value) {
queriedValue = rows[0][0].value.value;
}
assert.strictEqual(queriedValue, null);
done();
});
});
});

describe('float64s', () => {
Expand Down

0 comments on commit a32b39c

Please sign in to comment.