Changeset: cf4a0dd1979d for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cf4a0dd1979d
Added Files:
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.sql
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err
        sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out
Branch: Oct2012
Log Message:

Add test for Bug 2791


diffs (152 lines):

diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.py
@@ -0,0 +1,45 @@
+import time, os, sys, re
+try:
+    from MonetDBtesting import process
+except ImportError:
+    import process
+
+
+currenttime = time.strftime('%H:%M:%S', time.localtime(time.time()))
+
+#print currenttime
+
+#Change the current time in the sql file
+
+sqlfile = open("currenttime.Bug-2791.sql","w")
+sqlfile.write("select (localtime() - time '%s' < time '00:00:20') and (time 
'%s' - localtime() < time '00:00:20');" %(currenttime, currenttime))
+sqlfile.close()
+
+
+def server_start():
+    sys.stderr.write('#mserver\n')
+    sys.stderr.flush()
+    srv = process.server(stdin = process.PIPE,
+                         stdout = process.PIPE, stderr = process.PIPE)
+    return srv
+
+def client(lang, file, user = 'monetdb', passwd = 'monetdb'):
+    sys.stderr.write('#client\n')
+    sys.stderr.flush()
+    clt = process.client(lang, user = user, passwd = passwd,
+                         stdin = open(file),
+                         stdout = process.PIPE, stderr = process.PIPE)
+    return clt.communicate()
+
+def main():
+    srv = server_start()
+    out, err = client('sql',
+                      os.path.join(os.getenv('RELSRCDIR'),
+                                   'currenttime.Bug-2791.sql'))
+    sys.stdout.write(out)
+    sys.stderr.write(err)
+    out, err = srv.communicate()
+    sys.stdout.write(out)
+    sys.stderr.write(err)
+
+main()
diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.sql 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.sql
@@ -0,0 +1,1 @@
+select (localtime() - time '13:33:43' < time '00:00:20') and (time '13:33:43' 
- localtime() < time '00:00:20');
\ No newline at end of file
diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.err
@@ -0,0 +1,32 @@
+stderr of test 'currenttime.Bug-2791` in directory 'test/BugTracker-2012` 
itself:
+
+
+# 13:29:41 >  
+# 13:29:41 >  "/usr/bin/python" "currenttime.Bug-2791.py" 
"currenttime.Bug-2791"
+# 13:29:41 >  
+
+#mserver
+#client
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = 
/export/scratch2/duc/work/BugsDay/MonetDB/var/monetdb5/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_vmtrim = yes
+# builtin opt  monet_prompt = >
+# builtin opt  monet_daemon = no
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  gdk_dbfarm = 
/export/scratch2/duc/work/BugsDay/MonetDB/var/MonetDB
+# cmdline opt  mapi_open = true
+# cmdline opt  mapi_port = 35580
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbname = mTests_test_BugTracker-2012
+
+# 13:29:41 >  
+# 13:29:41 >  "Done."
+# 13:29:41 >  
+
diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out 
b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2791.stable.out
@@ -0,0 +1,53 @@
+stdout of test 'currenttime.Bug-2791` in directory 'test/BugTracker-2012` 
itself:
+
+
+# 13:29:41 >  
+# 13:29:41 >  "/usr/bin/python" "currenttime.Bug-2791.py" 
"currenttime.Bug-2791"
+# 13:29:41 >  
+
+#select (localtime() - time '13:29:41' < time '00:00:20') and (time '13:29:41' 
- localtime() < time '00:00:20');
+% . # table_name
+% sql_sub_localtime # name
+% boolean # type
+% 5 # length
+[ true ]
+# MonetDB 5 server v11.13.6
+# This is an unreleased version
+# Serving database 'mTests_test_BugTracker-2012', using 8 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 15.629 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2012 MonetDB B.V., all rights reserved
+# Visit http://www.monetdb.org/ for further information
+# Listening for connection requests on mapi:monetdb://london.ins.cwi.nl:35580/
+# MonetDB/GIS module loaded
+# MonetDB/JAQL module loaded
+# MonetDB/SQL module loaded
+# SQL catalog created, loading sql scripts once
+# loading sql script: 09_like.sql
+# loading sql script: 10_math.sql
+# loading sql script: 11_times.sql
+# loading sql script: 12_url.sql
+# loading sql script: 13_date.sql
+# loading sql script: 14_inet.sql
+# loading sql script: 15_history.sql
+# loading sql script: 16_tracelog.sql
+# loading sql script: 17_compress.sql
+# loading sql script: 18_dictionary.sql
+# loading sql script: 19_cluster.sql
+# loading sql script: 20_vacuum.sql
+# loading sql script: 21_dependency_functions.sql
+# loading sql script: 22_clients.sql
+# loading sql script: 23_skyserver.sql
+# loading sql script: 24_zorder.sql
+# loading sql script: 25_debug.sql
+# loading sql script: 30_rdf.sql
+# loading sql script: 39_analytics.sql
+# loading sql script: 40_geom.sql
+# loading sql script: 80_udf.sql
+# loading sql script: 99_system.sql
+
+# 13:29:41 >  
+# 13:29:41 >  "Done."
+# 13:29:41 >  
+
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to