-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CONJS-236] binary TIME wrong decoding
- Loading branch information
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
'use strict'; | ||
|
||
const base = require('../../base.js'); | ||
const { assert } = require('chai'); | ||
const { isXpand } = require('../../base'); | ||
|
||
describe('time', () => { | ||
it('time data', async function () { | ||
if (!base.utf8Collation()) this.skip(); | ||
|
||
await shareConn.query('DROP TABLE IF EXISTS time_data'); | ||
await shareConn.query('CREATE TABLE time_data(t1 time(6), t2 time(6))'); | ||
await shareConn.query('INSERT INTO time_data VALUES (?, ?)', ['-838:59:58', '-838:59:59.999999']); | ||
await shareConn.query('INSERT INTO time_data VALUES (?, ?)', ['-1:00:00', '25:00:00']); | ||
let results = await shareConn.query('SELECT * FROM time_data'); | ||
assert.equal(results[0].t1, '-838:59:58.000000'); | ||
assert.equal(results[0].t2, '-838:59:59.999999'); | ||
assert.equal(results[1].t1, '-01:00:00.000000'); | ||
assert.equal(results[1].t2, '25:00:00.000000'); | ||
results = await shareConn.execute('SELECT * FROM time_data'); | ||
assert.equal(results[0].t1, '-838:59:58'); | ||
assert.equal(results[0].t2, '-838:59:59.999999'); | ||
assert.equal(results[1].t1, '-01:00:00'); | ||
assert.equal(results[1].t2, '25:00:00'); | ||
}); | ||
}); |