Changeset: b651bb70f709 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b651bb70f709
Added Files:
sql/test/mapi/Tests/utf8test.stable.out.Windows
Modified Files:
clients/mapiclient/eventparser.c
clients/odbc/driver/ODBCConvert.c
monetdb5/modules/kernel/algebra.c
monetdb5/modules/mal/clients.c
monetdb5/modules/mal/wlc.c
sql/backends/monet5/wlr.c
sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
sql/test/mapi/Tests/utf8test.SQL.py
Branch: default
Log Message:
Merge with Nov2019
diffs (257 lines):
diff --git a/clients/mapiclient/eventparser.c b/clients/mapiclient/eventparser.c
--- a/clients/mapiclient/eventparser.c
+++ b/clients/mapiclient/eventparser.c
@@ -212,7 +212,7 @@ keyvalueparser(char *txt, EventRecord *e
if( strstr(key,"clk")){
time_t sec;
uint64_t microsec;
- struct tm curr_time;
+ struct tm curr_time = (struct tm) {0};
c = strchr(val,'.');
if (c != NULL) {
diff --git a/clients/odbc/driver/ODBCConvert.c
b/clients/odbc/driver/ODBCConvert.c
--- a/clients/odbc/driver/ODBCConvert.c
+++ b/clients/odbc/driver/ODBCConvert.c
@@ -2473,6 +2473,7 @@ ODBCFetch(ODBCStmt *stmt,
case SQL_TYPE_TIME:
(void) time(&t);
+ tm = (struct tm) {0};
#ifdef HAVE_LOCALTIME_R
(void) localtime_r(&t, &tm);
#else
@@ -3499,6 +3500,7 @@ ODBCStore(ODBCStmt *stmt,
case SQL_C_TYPE_TIME:
(void) time(&t);
+ tm = (struct tm) {0};
#ifdef HAVE_LOCALTIME_R
(void) localtime_r(&t, &tm);
#else
diff --git a/monetdb5/modules/kernel/algebra.c
b/monetdb5/modules/kernel/algebra.c
--- a/monetdb5/modules/kernel/algebra.c
+++ b/monetdb5/modules/kernel/algebra.c
@@ -285,6 +285,7 @@ ALGselect2nil(bat *result, const bat *bi
{
BAT *b, *s = NULL, *bn;
const void *nilptr;
+ bit nanti = *anti;
if (!*unknown)
return ALGselect2(result, bid, sid, low, high, li, hi, anti);
@@ -309,7 +310,9 @@ ALGselect2nil(bat *result, const bat *bi
low = high;
else if (*hi == 1 && ATOMcmp(b->ttype, high, nilptr) == 0)
high = low;
- bn = BATselect(b, s, low, high, *li, *hi, *anti);
+ if (low == high && ATOMcmp(b->ttype, high, nilptr) == 0) /* ugh sql nil
!= nil */
+ nanti = !nanti;
+ bn = BATselect(b, s, low, high, *li, *hi, nanti);
BBPunfix(b->batCacheid);
if (s)
BBPunfix(s->batCacheid);
diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
--- a/monetdb5/modules/mal/clients.c
+++ b/monetdb5/modules/mal/clients.c
@@ -90,7 +90,7 @@ CLTsetScenario(Client cntxt, MalBlkPtr m
static void
CLTtimeConvert(time_t l, char *s)
{
- struct tm localt;
+ struct tm localt = (struct tm) {0};
#ifdef HAVE_LOCALTIME_R
(void) localtime_r(&l, &localt);
diff --git a/monetdb5/modules/mal/wlc.c b/monetdb5/modules/mal/wlc.c
--- a/monetdb5/modules/mal/wlc.c
+++ b/monetdb5/modules/mal/wlc.c
@@ -524,7 +524,7 @@ WLCsettime(Client cntxt, InstrPtr pci, I
{
struct timeval clock;
time_t clk ;
- struct tm ctm;
+ struct tm ctm = (struct tm) {0};
char wlc_time[26];
(void) pci;
diff --git a/sql/backends/monet5/wlr.c b/sql/backends/monet5/wlr.c
--- a/sql/backends/monet5/wlr.c
+++ b/sql/backends/monet5/wlr.c
@@ -475,6 +475,7 @@ WLRprocessScheduler(void *arg)
if( wlr_timelimit[0]){
gettimeofday(&clock, NULL);
clk = clock.tv_sec;
+ ctm = (struct tm) {0};
#ifdef HAVE_LOCALTIME_R
(void) localtime_r(&clk, &ctm);
#else
@@ -589,6 +590,7 @@ WLRreplicate(Client cntxt, MalBlkPtr mb,
// the client thread should wait for the replicator to its job
gettimeofday(&clock, NULL);
clk = clock.tv_sec;
+ ctm = (struct tm) {0};
#ifdef HAVE_LOCALTIME_R
(void) localtime_r(&clk, &ctm);
#else
diff --git
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
---
a/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
+++
b/sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out
@@ -63,6 +63,23 @@ stdout of test 'sqlitelogictest-having-n
% bigint # type
% 1 # length
[ 0 ]
+#SELECT ALL * FROM tab0 AS cor0 WHERE col2 BETWEEN NULL AND NULL; --empty
+% sys.cor0, sys.cor0, sys.cor0 # table_name
+% col0, col1, col2 # name
+% int, int, int # type
+% 1, 1, 1 # length
+#SELECT COUNT ( * ) FROM tab0 WHERE NOT col1 NOT BETWEEN NULL AND NULL; --0
+% sys.%1 # table_name
+% %1 # name
+% bigint # type
+% 1 # length
+[ 0 ]
+#SELECT - 78 * + MAX ( DISTINCT col2 ) + - 52 AS col1 FROM tab0 AS cor0 WHERE
NOT - col0 + col2 NOT BETWEEN ( NULL ) AND NULL; --NULL
+% sys.%3 # table_name
+% col1 # name
+% bigint # type
+% 1 # length
+[ NULL ]
#DROP TABLE tab0;
# 12:32:58 >
diff --git a/sql/test/mapi/Tests/utf8test.SQL.py
b/sql/test/mapi/Tests/utf8test.SQL.py
--- a/sql/test/mapi/Tests/utf8test.SQL.py
+++ b/sql/test/mapi/Tests/utf8test.SQL.py
@@ -1,4 +1,5 @@
import sys
+import locale
try:
from MonetDBtesting import process
except ImportError:
@@ -11,6 +12,7 @@ def client(args, universal_newlines = Tr
return clt.communicate()
def printit(file, string):
+ string = string.replace('\r', '')
file.write(string)
if not string.endswith('\n'):
file.write('\n')
@@ -25,13 +27,13 @@ printit(sys.stderr, err)
out, err = client(['-s', "insert into utf8test values ('value without special
characters')"])
printit(sys.stdout, out)
printit(sys.stderr, err)
-out, err = client(['-s', "insert into utf8test values ('funny characters:
%s')" % funny])
+out, err = client(['-E%s' % locale.getpreferredencoding(), '-s', "insert into
utf8test values ('funny characters: %s')" % funny])
printit(sys.stdout, out)
printit(sys.stderr, err)
-out, err = client(['-fraw', '-s', 'select * from utf8test'])
+out, err = client(['-Eutf-8', '-fraw', '-s', 'select * from utf8test'])
printit(sys.stdout, out)
printit(sys.stderr, err)
-out, err = client(['-fsql', '-s', 'select * from utf8test'])
+out, err = client(['-Eutf-8', '-fsql', '-s', 'select * from utf8test'])
printit(sys.stdout, out)
printit(sys.stderr, err)
out, err = client(['-fraw', '-Eiso-8859-1', '-s', 'select * from utf8test'],
diff --git a/sql/test/mapi/Tests/utf8test.stable.out.Windows
b/sql/test/mapi/Tests/utf8test.stable.out.Windows
new file mode 100644
--- /dev/null
+++ b/sql/test/mapi/Tests/utf8test.stable.out.Windows
@@ -0,0 +1,95 @@
+stdout of test 'utf8test` in directory 'sql/test/mapi` itself:
+
+
+# 10:26:27 >
+# 10:26:27 > mserver5
"--config=/ufs/sjoerd/Monet-virgin-stable/etc/monetdb5.conf" --debug=10 --set
"monet_mod_path=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/src/backends/monet5/.libs:/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/src/backends/monet5:/ufs/sjoerd/Monet-virgin-stable/lib64/MonetDB5:/ufs/sjoerd/Monet-virgin-stable/lib64/MonetDB5/lib:/ufs/sjoerd/Monet-virgin-stable/lib64/MonetDB5/bin"
--set
"gdk_dbfarm=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/dbfarm"
--set
"sql_logdir=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/sql_logs"
--set
"xquery_logdir=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/xquery_logs"
--set mapi_open=true --set xrpc_open=true --set mapi_port=32641 --set
xrpc_port=40706 --set monet_prompt= --trace "--dbname=mTests_src_test_mapi"
--set mal_listing=0 "--dbinit= include sql;" ; echo ; echo Over..
+# 10:26:27 >
+
+
+
+
+
+# MonetDB server v5.6.1, based on kernel v1.24.1
+# Serving database 'mTests_src_test_mapi'
+# Compiled for x86_64-unknown-linux-gnu/64bit with 32bit OIDs dynamically
linked
+# Copyright (c) 1993-2008 CWI, all rights reserved
+# Visit http://monetdb.cwi.nl/ for further information
+# Listening for connection requests on mapi:monetdb://ottar.ins.cwi.nl:32641/
+# MonetDB/SQL module v2.24.1 loaded
+
+#function user.main():void;
+# clients.quit();
+#end main;
+
+
+# 10:26:27 >
+# 10:26:27 > ./utf8test.SQL.sh utf8test
+# 10:26:27 >
+
+
+# 10:26:27 >
+# 10:26:27 > Mtimeout -timeout 60 mclient -lsql -umonetdb -Pmonetdb
--host=ottar --port=32641 -s 'create table utf8test (s varchar(50))'
+# 10:26:27 >
+
+
+# 10:26:28 >
+# 10:26:28 > Mtimeout -timeout 60 mclient -lsql -umonetdb -Pmonetdb
--host=ottar --port=32641 -s "insert into utf8test values ('value without
special characters')"
+# 10:26:28 >
+
+[ 1 ]
+
+# 10:26:28 >
+# 10:26:28 > Mtimeout -timeout 60 mclient -lsql -umonetdb -Pmonetdb
--host=ottar --port=32641 -s "insert into utf8test values ('funny characters:
àáâãäå')"
+# 10:26:28 >
+
+[ 1 ]
+
+# 10:26:28 >
+# 10:26:28 > Mtimeout -timeout 60 mclient -lsql -umonetdb -Pmonetdb
--host=ottar --port=32641 -fraw -s 'select * from utf8test'
+# 10:26:28 >
+
+% sys.utf8test # table_name
+% s # name
+% varchar # type
+% 32 # length
+[ "value without special characters" ]
+[ "funny characters: àáâãäå" ]
+select * from utf8test
++----------------------------------+
+| s |
++==================================+
+| value without special characters |
+| funny characters: àáâãäå |
++----------------------------------+
+2 tuples
+% sys.utf8test # table_name
+% s # name
+% varchar # type
+% 32 # length
+[ "value without special characters" ]
+[ "funny characters: ������" ]
+select * from utf8test
++----------------------------------+
+| s |
++==================================+
+| value without special characters |
+| funny characters: ������ |
++----------------------------------+
+2 tuples
+% sys.utf8test # table_name
+% s # name
+% varchar # type
+% 32 # length
+[ "value without special characters" ]
+select * from utf8test
++----------------------------------+
+| s |
++==================================+
+| value without special characters |
+| funny characters:
+#drop table utf8test
+
+# 10:26:28 >
+# 10:26:28 > Done.
+# 10:26:28 >
+
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list