Changeset: d2d19f0f5fd4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d2d19f0f5fd4
Modified Files:
        sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
        sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
Branch: Nov2019
Log Message:

Make test deterministic by inserting the same time/timestamp value for every 
column


diffs (60 lines):

diff --git a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql 
b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
--- a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
+++ b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.sql
@@ -1,5 +1,8 @@
 start transaction;
 
+declare deterministic_insert timestamp;
+set deterministic_insert = current_timestamp;
+
 create table x(
 i integer,
 t timestamp,
@@ -7,10 +10,14 @@ tn timestamp default null,
 td timestamp default now(),
 tc timestamp default current_timestamp);
 
-insert into x(i,t) values(0,now());
+insert into x(i,t,td,tc) 
values(0,deterministic_insert,deterministic_insert,deterministic_insert);
 select i, tn, td - t, tc - t from x;
+insert into x(i,t) values(0,now());
 drop table x;
 
+declare other_deterministic_insert time;
+set other_deterministic_insert = current_time;
+
 create table x(
 i integer,
 t time,
@@ -18,8 +25,9 @@ tn time default null,
 td time default now(),
 tc time default current_time);
 
+insert into x(i,t,td,tc) 
values(0,other_deterministic_insert,other_deterministic_insert,other_deterministic_insert);
+select i, tn, td - t, tc - t from x;
 insert into x(i,t) values(0,now());
-select i, tn, td - t, tc - t from x;
 drop table x;
 
 declare t timestamp;
diff --git 
a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out 
b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
--- a/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
+++ b/sql/test/BugTracker-2014/Tests/current_timestamp.Bug-3427.stable.out
@@ -68,6 +68,8 @@ stdout of test 'current_timestamp.Bug-34
 % int, timestamp,      sec_interval,   sec_interval # type
 % 1,   26,     5,      5 # length
 [ 0,   NULL,   0.000,  0.000   ]
+#insert into x(i,t) values(0,now());
+[ 1    ]
 #drop table x;
 #create table x(
 #i integer,
@@ -83,6 +85,8 @@ stdout of test 'current_timestamp.Bug-34
 % int, time,   sec_interval,   sec_interval # type
 % 1,   8,      5,      5 # length
 [ 0,   NULL,   0.000,  0.000   ]
+#insert into x(i,t) values(0,now());
+[ 1    ]
 #drop table x;
 #declare t timestamp;
 #declare tt time;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to