added test for inserts with timestamp + constraints (#2244)

This commit is contained in:
Pat Okeeffe 2023-02-13 16:15:59 -06:00 committed by GitHub
parent 5c74b64722
commit 4261c60a17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 0 deletions

1
.gitignore vendored
View file

@ -83,3 +83,4 @@ staticcheck.conf
dax/dax-data
coverage-from-docker
*.client_id.txt

View file

@ -41,6 +41,7 @@ var TableTests []TableTest = []TableTest{
stringScalarFunctionsTests,
insertTest,
insertTimestampTest,
keyedInsertTest,
timestampLiterals,
unaryOpExprWithInt,

View file

@ -154,3 +154,37 @@ var insertTest = TableTest{
},
},
}
var insertTimestampTest = TableTest{
SQLTests: []SQLTest{
{
SQLs: sqls(
"CREATE TABLE insertTimestampTest (_id id, time timestamp timeunit 'ms' epoch '2022-01-01T00:00:00Z', ids idset, strings stringset);",
),
ExpHdrs: hdrs(),
ExpRows: rows(),
Compare: CompareExactUnordered,
},
{
SQLs: sqls(
"INSERT INTO insertTimestampTest(_id, time, ids, strings) VALUES (1, '2023-01-01', [6 , 1, 9], ['red', 'blue', 'green']);",
),
ExpHdrs: hdrs(),
ExpRows: rows(),
Compare: CompareExactUnordered,
},
{
SQLs: sqls(
"select time from insertTimestampTest;",
),
ExpHdrs: hdrs(
hdr("time", fldTypeTimestamp),
),
ExpRows: rows(
row(timestampFromString("2023-01-01T00:00:00Z")),
),
Compare: CompareExactUnordered,
SortStringKeys: true,
},
},
}