-
-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Labels
Description
Describe the bug
Given a column of type timestamp, leading zero in milliseconds is ignored. Example: inserted value "2021-03-03T08:31:15.077Z" will be read as "2021-03-03 08:31:15.770000"
To Reproduce
Given following table:
SELECT column_name, data_type FROM information_schema.columns WHERE table_name = 'solutions';
# id | character varying
# created_at | timestamp without time zoneAnd following test script
const AWS = require('aws-sdk');
const resourceArn = '';
const secretArn = '';
const database = '';
const endpoint = '';
const rdsDataService = new AWS.RDSDataService({ endpoint });
const executeSql = (sql) => rdsDataService.executeStatement({ resourceArn, secretArn, database, sql }).promise();
const test = async (sql) => {
await executeSql(`INSERT INTO solutions (id, created_at) VALUES ('1', '2021-03-03T08:31:15.077Z')`);
const { records } = await executeSql(`SELECT * FROM solutions WHERE id = '1'`);
console.log(records);
}The output would be following:
[
[
{ stringValue: '1' },
{ stringValue: '2021-03-03 08:31:15.770000' },
]
]Expected behavior
Is should behave equally to AWS Aurora Data API and return:
[
[
{ stringValue: '1' },
{ stringValue: '2021-03-03 08:31:15.077' },
]
]