Changeset: fb1d7bb740ac for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fb1d7bb740ac
Modified Files:
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.SQL.py
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out
Branch: Jun2020
Log Message:

Use timestamp instead of time at bug 2781 test, so it can't never overflow if 
the test is performed at around midnight


diffs (35 lines):

diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.SQL.py 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.SQL.py
--- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.SQL.py
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.SQL.py
@@ -14,16 +14,16 @@ def main():
     with process.client('sql', user='monetdb', passwd='monetdb',
                         stdin=process.PIPE,
                         stdout=process.PIPE, stderr=process.PIPE) as clt:
-        currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
+        currenttime = time.strftime('%F %T', time.localtime(time.time()))
         #SQL command for checking the localtime
-        sqlcommand = "select localtime() between (time '%s' - interval '20' 
second) and (time '%s' + interval '20' second);" % (currenttime, currenttime)
+        sqlcommand = "select localtimestamp() between (timestamp '%s' - 
interval '20' second) and (timestamp '%s' + interval '20' second);" % 
(currenttime, currenttime)
         out, err = clt.communicate(sqlcommand)
         sys.stdout.write(out)
         sys.stderr.write(err)
     with process.client('sql', user='monetdb', passwd='monetdb',
                          stdin=process.PIPE,
                          stdout=process.PIPE, stderr=process.PIPE) as clt:
-        out, err = clt.communicate('select localtime();')
+        out, err = clt.communicate('select localtimestamp();')
         sys.stdout.write('#Python says: %s; current time zone %d\n' % 
(currenttime, zone))
         for line in out.split('\n'):
             if line:
diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out
--- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out
@@ -42,7 +42,7 @@ stdout of test 'currenttime.Bug-2781` in
 # loading sql script: 80_udf.sql
 # loading sql script: 99_system.sql
 
-#select localtime() between (time '16:48:21' - interval '20' second) and (time 
'16:48:21' + interval '20' second);
+#select localtimestamp() between (timestamp '2020-05-06 10:22:12' - interval 
'20' second) and (timestamp '2020-05-06 10:22:12' + interval '20' second);
 % . # table_name
 % %1 # name
 % boolean # type
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to