From 569c6676a6ddb0ff73821d7693b5e18ddef809b9 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 16 Oct 2014 22:51:35 -0400 Subject: Imported Upstream version 3.2.0 --- test/date.test | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'test/date.test') 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 -- cgit v1.2.3