summaryrefslogtreecommitdiff
path: root/test/date.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/date.test')
-rw-r--r--test/date.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/date.test b/test/date.test
index a30402c..b1d1c67 100644
--- a/test/date.test
+++ b/test/date.test
@@ -528,4 +528,27 @@ if {0==[sqlite3 -has-codec]} {
} {1}
}
}
+
+# Verify that multiple calls to date functions with 'now' return the
+# same answer.
+#
+# EVIDENCE-OF: R-34818-13664 The 'now' argument to date and time
+# functions always returns exactly the same value for multiple
+# invocations within the same sqlite3_step() call.
+#
+proc sleeper {} {after 100}
+do_test date-15.1 {
+ db func sleeper sleeper
+ db eval {
+ SELECT c - a FROM (SELECT julianday('now') AS a,
+ sleeper(), julianday('now') AS c);
+ }
+} {0.0}
+do_test date-15.2 {
+ db eval {
+ SELECT a==b FROM (SELECT current_timestamp AS a,
+ sleeper(), current_timestamp AS b);
+ }
+} {1}
+
finish_test