diff options
author | drh <> | 2023-02-08 12:31:47 +0000 |
---|---|---|
committer | drh <> | 2023-02-08 12:31:47 +0000 |
commit | 159cbfe1cbb9a725cb206479181870adfcb8b6fa (patch) | |
tree | 63555ed6e3ccdfc9e6500d6aaee271ab3882ccf3 /test | |
parent | ed092fc3684dbc2b2d8642cd05241391e279fe8e (diff) | |
download | sqlite-159cbfe1cbb9a725cb206479181870adfcb8b6fa.tar.gz sqlite-159cbfe1cbb9a725cb206479181870adfcb8b6fa.zip |
Test cases to show that CURRENT_TIMESTAMP and similar hold the same value
across a transaction.
FossilOrigin-Name: 7b2fa20e31b8a0314b9ccb97bb556898d552505dbc5943f248df3f86c0f4e008
Diffstat (limited to 'test')
-rw-r--r-- | test/date.test | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/test/date.test b/test/date.test index 8ade3e43c..479635753 100644 --- a/test/date.test +++ b/test/date.test @@ -501,7 +501,7 @@ do_test date-15.3 { do_test date-15.4 { db eval { SELECT a==b FROM (SELECT julianday('txn') AS a, - sleeper(), julianday('txn') AS b); + sleeper(), julianday('now') AS b); } } {0} @@ -534,7 +534,28 @@ do_execsql_test date-15.7 { SELECT count(a), count(DISTINCT a) FROM t15; } {4 3} - +do_test date-15.10 { + unset -nocomplain x + db eval {BEGIN;} + db eval { + SELECT + current_time AS ct1, + current_date AS cd1, + current_timestamp AS cs1, + time() AS ct2, + datetime() AS cs2; + } x {continue} + after 1000 + db eval { + SELECT + current_time=$x(ct1), + current_date=$x(cd1), + current_timestamp=$x(cs1), + time()=$x(ct2), + datetime()=$x(cs2); + } +} {1 1 1 0 0} +db eval {COMMIT} # Tests of extreme values in date/time functions. Run with UBSan or the # equivalent to verify no signed interger overflow warnings. |