Changeset: 653465cbaabf for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=653465cbaabf
Modified Files:
        
Branch: Oct2010
Log Message:

merged


diffs (132 lines):

diff -r 48645a83deae -r 653465cbaabf clients/src/mapiclient/mclient.c
--- a/clients/src/mapiclient/mclient.c  Fri Sep 17 15:57:08 2010 +0200
+++ b/clients/src/mapiclient/mclient.c  Fri Sep 17 15:57:32 2010 +0200
@@ -690,8 +690,18 @@
                                        mnstr_printf(toConsole, "#%s\n", p);
                                        p = q;
                                }
+                               if (*p) {
+                                       /* query does not end in \n */
+                                       mnstr_printf(toConsole, "#%s\n", p);
+                               }
                        } else {
+                               size_t qrylen = strlen(qry);
+
                                mnstr_printf(toConsole, "%s", qry);
+                               if (qrylen > 0 && qry[qrylen - 1] != '\n') {
+                                       /* query does not end in \n */
+                                       mnstr_printf(toConsole, "\n");
+                               }
                        }
                        free(qry);
                }
@@ -1161,7 +1171,9 @@
 
        SQLheader(hdl, len, printfields, fields != printfields);
 
-       while (!mnstr_errnr(toConsole) && (rfields = fetch_row(hdl)) != 0) {
+       while ((rfields = fetch_row(hdl)) != 0) {
+               if (mnstr_errnr(toConsole))
+                       continue;
                if (rfields != fields) {
                        mnstr_printf(stderr_stream,
                                        "invalid tuple received from server, "
diff -r 48645a83deae -r 653465cbaabf 
sql/src/test/BugTracker/Tests/local_temp_table.SF-1865953.SQL.py
--- a/sql/src/test/BugTracker/Tests/local_temp_table.SF-1865953.SQL.py  Fri Sep 
17 15:57:08 2010 +0200
+++ b/sql/src/test/BugTracker/Tests/local_temp_table.SF-1865953.SQL.py  Fri Sep 
17 15:57:32 2010 +0200
@@ -1,21 +1,10 @@
 import os, sys, time
 from MonetDBtesting import process
 
-RELSRCDIR = os.environ['RELSRCDIR']
-TSTDB = os.environ['TSTDB']
-
 def client(args):
-    t = time.strftime('# %H:%M:%S >',time.localtime(time.time()))
-    Mlog = "\n%s\n%s  mclient %s\n%s\n\n" % (t, t, ' '.join(args), t)
-    sys.stdout.write(Mlog)
-    sys.stdout.flush()
-    sys.stderr.write(Mlog)
-    sys.stderr.flush()
-    clt = process.client('sql', args = args)
+    clt = process.client('sql', args = args, log = True)
     clt.communicate()
 
-os.environ['LANG'] = 'en_US.UTF-8'
-
-client(['-d', TSTDB,
-        os.path.join(RELSRCDIR, 'local_temp_table_data.SF-1865953.sql')])
-client(['-d', TSTDB])
+client([os.path.join(os.environ['RELSRCDIR'],
+                     'local_temp_table_data.SF-1865953.sql')])
+client([os.devnull])
diff -r 48645a83deae -r 653465cbaabf sql/src/test/mapi/Tests/utf8test.SQL.py
--- a/sql/src/test/mapi/Tests/utf8test.SQL.py   Fri Sep 17 15:57:08 2010 +0200
+++ b/sql/src/test/mapi/Tests/utf8test.SQL.py   Fri Sep 17 15:57:32 2010 +0200
@@ -1,4 +1,4 @@
-import os, sys
+import sys
 from MonetDBtesting import process
 
 def client(args):
diff -r 48645a83deae -r 653465cbaabf sql/src/test/mapi/Tests/utf8test.stable.out
--- a/sql/src/test/mapi/Tests/utf8test.stable.out       Fri Sep 17 15:57:08 
2010 +0200
+++ b/sql/src/test/mapi/Tests/utf8test.stable.out       Fri Sep 17 15:57:32 
2010 +0200
@@ -56,11 +56,7 @@
 % 32 # length
 [ "value without special characters"   ]
 [ "funny characters: àáâãäå"     ]
-
-# 10:26:28 >  
-# 10:26:28 >  Mtimeout -timeout 60 mclient -lsql -umonetdb -Pmonetdb 
--host=ottar --port=32641  -fsql -s 'select * from utf8test'
-# 10:26:28 >  
-
+select * from utf8test
 +----------------------------------+
 | s                                |
 +==================================+
@@ -74,11 +70,7 @@
 % 32 # length
 [ "value without special characters"   ]
 [ "funny characters: àáâãäå"   ]
-
-# 10:28:27 >  
-# 10:28:27 >  Mtimeout -timeout 60 mclient -lsql -umonetdb -Pmonetdb 
--host=ottar --port=31669  -fsql -Eiso-8859-1 -s 'select * from utf8test'
-# 10:28:27 >  
-
+select * from utf8test
 +----------------------------------+
 | s                                |
 +==================================+
@@ -91,6 +83,7 @@
 % varchar # type
 % 32 # length
 [ "value without special characters"   ]
+select * from utf8test
 +----------------------------------+
 | s                                |
 +==================================+
diff -r 48645a83deae -r 653465cbaabf testing/src/process.py
--- a/testing/src/process.py    Fri Sep 17 15:57:08 2010 +0200
+++ b/testing/src/process.py    Fri Sep 17 15:57:32 2010 +0200
@@ -160,6 +160,10 @@
     elif lang == 'sqldump':
         cmd = _sql_dump[:]
 
+    # no -i if input from -s or /dev/null
+    if '-i' in cmd and ('-s' in args or stdin is None):
+        cmd.remove('-i')
+
     env = None
 
     if port is not None:
@@ -205,6 +209,9 @@
         print >> sys.stderr, prompt
         print >> sys.stderr
         sys.stderr.flush()
+    if stdin is None:
+        # if no input provided, use /dev/null as input
+        stdin = open(os.devnull)
     p = Popen(cmd + args,
               stdin = stdin,
               stdout = stdout,
_______________________________________________
Checkin-list mailing list
Checkin-list@monetdb.org
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to