Skip to content

Commit be4ccd7

Browse files
committed
Add duplicate column name test
1 parent 692fabd commit be4ccd7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

test/dupColNames1.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,28 @@ describe('246. dupColNames1.js', function() {
629629
assert.equal(result.rows[0].toString, 101);
630630
});
631631

632+
it('246.1.20 Negative not-case sensitive prop name', async function() {
633+
// alias name is within quotes and so does not match any string
634+
// comparison
635+
const sql =
636+
`SELECT
637+
A.EMPLOYEE_ID, A.DEPARTMENT_ID,
638+
B.department_id, B.department_id AS "length"
639+
FROM nodb_dupEmployee A, nodb_dupDepartment B
640+
WHERE A.department_id = B.department_id
641+
ORDER BY A.EMPLOYEE_ID`;
642+
643+
const result = await connection.execute(sql);
644+
assert.equal(result.metaData[0].name, "EMPLOYEE_ID");
645+
assert.equal(result.metaData[1].name, "DEPARTMENT_ID");
646+
assert.equal(result.metaData[2].name, "DEPARTMENT_ID_1");
647+
assert.equal(result.metaData[3].name, "length");
648+
assert.equal(result.rows[0].EMPLOYEE_ID, 1001);
649+
assert.equal(result.rows[0].DEPARTMENT_ID, 101);
650+
assert.equal(result.rows[0].DEPARTMENT_ID_1, 101);
651+
assert.equal(result.rows[0].length, 101);
652+
});
653+
632654
});
633655

634656
describe('246.2 Duplicate column names, query with ResultSet', function() {

0 commit comments

Comments
 (0)