Changeset: 4073c2134c89 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4073c2134c89
Modified Files:
        
Branch: headless
Log Message:

Merge with default branch.


diffs (255 lines):

diff --git a/HowToStart.rst b/HowToStart.rst
--- a/HowToStart.rst
+++ b/HowToStart.rst
@@ -99,11 +99,11 @@
        - php
 
 libxml2
-       The XML parsing library `libxml2`__ is used by
-       the xml module of monetdb5.
+    The XML parsing library `libxml2`__ is used by
+    the xml module of monetdb5.
 
-       If libxml2 is not available on your system, this module is skipped
-    and it will not be available at runtime.
+    MonetDB5 cannot be compiled without libxml2.  Current Linux
+    distributions all come with libxml2.
 
 pcre
     The Perl Compatible Regular Expressions library `pcre`__ is used by
diff --git a/MonetDB.spec b/MonetDB.spec
--- a/MonetDB.spec
+++ b/MonetDB.spec
@@ -287,7 +287,7 @@
 
 %files client-tests
 %defattr(-,root,root)
-%{_bindir}/odbcsample1
+# %{_bindir}/odbcsample1
 %{_bindir}/sample0
 %{_bindir}/sample1
 %{_bindir}/sample2
@@ -295,7 +295,7 @@
 %{_bindir}/sample4
 %{_bindir}/smack00
 %{_bindir}/smack01
-%{_bindir}/testgetinfo
+# %{_bindir}/testgetinfo
 %{_bindir}/malsample.pl
 %{_bindir}/sqlsample.php
 %{_bindir}/sqlsample.pl
diff --git a/clients/odbc/driver/SQLExecute.c b/clients/odbc/driver/SQLExecute.c
--- a/clients/odbc/driver/SQLExecute.c
+++ b/clients/odbc/driver/SQLExecute.c
@@ -232,7 +232,16 @@
                 * initialized */
                rec->sql_desc_length = ODBCDisplaySize(rec);
                rec->sql_desc_display_size = rec->sql_desc_length;
-               rec->sql_desc_octet_length = rec->sql_desc_length;
+               if (rec->sql_desc_concise_type == SQL_CHAR ||
+                   rec->sql_desc_concise_type == SQL_VARCHAR ||
+                   rec->sql_desc_concise_type == SQL_LONGVARCHAR) {
+                       /* in theory, each character (really: Unicode
+                        * code point) could need 6 bytes in the UTF-8
+                        * encoding, plus we need a byte for the
+                        * terminating NUL byte */
+                       rec->sql_desc_octet_length = 6 * rec->sql_desc_length + 
1;
+               } else
+                       rec->sql_desc_octet_length = rec->sql_desc_length;
 
                rec++;
        }
diff --git a/clients/odbc/driver/SQLPrepare.c b/clients/odbc/driver/SQLPrepare.c
--- a/clients/odbc/driver/SQLPrepare.c
+++ b/clients/odbc/driver/SQLPrepare.c
@@ -253,7 +253,16 @@
                 * initialized */
                rec->sql_desc_length = ODBCDisplaySize(rec);
                rec->sql_desc_display_size = rec->sql_desc_length;
-               rec->sql_desc_octet_length = rec->sql_desc_length;
+               if (rec->sql_desc_concise_type == SQL_CHAR ||
+                   rec->sql_desc_concise_type == SQL_VARCHAR ||
+                   rec->sql_desc_concise_type == SQL_LONGVARCHAR) {
+                       /* in theory, each character (really: Unicode
+                        * code point) could need 6 bytes in the UTF-8
+                        * encoding, plus we need a byte for the
+                        * terminating NUL byte */
+                       rec->sql_desc_octet_length = 6 * rec->sql_desc_length + 
1;
+               } else
+                       rec->sql_desc_octet_length = rec->sql_desc_length;
        }
 
        /* update the internal state */
diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c
--- a/sql/server/rel_dump.c
+++ b/sql/server/rel_dump.c
@@ -534,7 +534,7 @@
        mnstr_printf(fd, "%% .plan # table_name\n");
        mnstr_printf(fd, "%% rel # name\n");
        mnstr_printf(fd, "%% clob # type\n");
-       mnstr_printf(fd, "%% " SZFMT " # length\n", len - 2 /* remove = and \n 
*/);
+       mnstr_printf(fd, "%% " SZFMT " # length\n", len - 1 /* remove = */);
 
        /* output the data */
        mnstr_printf(fd, "%s\n", b->buf + 1 /* omit starting \n */);
diff --git a/sql/test/BugTracker-2011/Tests/All 
b/sql/test/BugTracker-2011/Tests/All
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/All
@@ -0,0 +1,1 @@
+correlated-update.Bug-2771
diff --git a/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.sql 
b/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.sql
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.sql
@@ -0,0 +1,8 @@
+create table table1_bug2771 (x clob, y clob);
+insert into table1_bug2771 values ('one','');
+insert into table1_bug2771 values ('two','');
+create table table2_bug2771 (x clob, y clob);
+insert into table2_bug2771 values ('one','een');
+insert into table2_bug2771 values ('two','twee');
+update table1_bug2771 set y = (select y from table2_bug2771 where 
table1_bug2771.x = table2_bug2771.x and table1_bug2771.y = '' and 
table2_bug2771.y <> '');
+select * from table1_bug2771;
diff --git 
a/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.stable.err 
b/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.stable.err
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.stable.err
@@ -0,0 +1,81 @@
+stderr of test 'correlated-update.Bug-2771` in directory 
'test/BugTracker-2011` itself:
+
+
+# 11:21:47 >  
+# 11:21:47 >   mserver5 
"--config=/ufs/sjoerd/Monet-virgin-candidate/etc/monetdb5.conf" --debug=10 
--set gdk_nr_threads=0 --set 
"monet_mod_path=/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5:/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5/lib:/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5/bin"
 --set "gdk_dbfarm=/ufs/sjoerd/Monet-virgin-candidate/var/monetdb5/dbfarm"  
--set mapi_open=true --set xrpc_open=true --set mapi_port=36696 --set 
xrpc_port=47238 --set monet_prompt= --trace --forcemito --set mal_listing=2  
"--dbname=mTests_test_BugTracker-2011" --set mal_listing=0 ; echo ; echo Over..
+# 11:21:47 >  
+
+# builtin opt  gdk_arch = 64bitx86_64-unknown-linux-gnu
+# builtin opt  gdk_version = 11.1.0
+# builtin opt  prefix = /ufs/sjoerd/Monet-virgin-candidate
+# builtin opt  exec_prefix = ${prefix}
+# builtin opt  gdk_dbname = demo
+# builtin opt  gdk_dbfarm = ${prefix}/var/MonetDB/dbfarm
+# builtin opt  gdk_debug = 0
+# builtin opt  gdk_alloc_map = no
+# builtin opt  gdk_vmtrim = yes
+# builtin opt  monet_admin = adm
+# builtin opt  monet_prompt = >
+# builtin opt  monet_welcome = yes
+# builtin opt  monet_mod_path = ${exec_prefix}/lib64/MonetDB
+# builtin opt  monet_daemon = no
+# builtin opt  host = localhost
+# builtin opt  mapi_port = 50000
+# builtin opt  mapi_clients = 2
+# builtin opt  mapi_open = false
+# builtin opt  mapi_autosense = false
+# builtin opt  default_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# builtin opt  minimal_pipe = inline,remap,deadcode,multiplex,garbageCollector
+# builtin opt  sql_optimizer = default_pipe
+# builtin opt  sql_debug = 0
+# builtin opt  standoff_ns = 
+# builtin opt  standoff_start = start
+# builtin opt  standoff_end = end
+# config opt   prefix = /ufs/sjoerd/Monet-virgin-candidate
+# config opt   config = /ufs/sjoerd/Monet-virgin-candidate/etc/monetdb5.conf
+# config opt   prefix = /ufs/sjoerd/Monet-virgin-candidate
+# config opt   exec_prefix = ${prefix}
+# config opt   gdk_dbfarm = ${prefix}/var/monetdb5/dbfarm
+# config opt   monet_mod_path = 
${exec_prefix}/lib64/monetdb5:${exec_prefix}/lib64/monetdb5/lib:${exec_prefix}/lib64/monetdb5/bin
+# config opt   mero_pidfile = ${prefix}/var/run/monetdb/merovingian.pid
+# config opt   mero_controlport = 50001
+# config opt   no_mitosis_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   sequential_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,history,multiplex,garbageCollector
+# config opt   nov2009_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   replication_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,replication,multiplex,garbageCollector
+# config opt   accumulator_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,accumulators,dataflow,history,multiplex,garbageCollector
+# config opt   recycler_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,deadcode,recycle,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   cracker_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,selcrack,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   sidcrack_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,sidcrack,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   datacell_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,deadcode,constants,commonTerms,joinPath,datacell,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   octopus_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,octopus,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   tarantula_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,constants,commonTerms,joinPath,tarantula,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   mapreduce_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mapreduce,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   datacyclotron_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,datacyclotron,mergetable,deadcode,commonTerms,joinPath,reorder,deadcode,reduce,dataflow,history,replication,multiplex,garbageCollector
+# config opt   derive_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mitosis,mergetable,deadcode,commonTerms,derivePath,joinPath,reorder,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   dictionary_pipe = 
inline,remap,dictionary,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,history,multiplex,garbageCollector
+# config opt   compression_pipe = 
inline,remap,evaluate,costModel,coercions,emptySet,aliases,mergetable,deadcode,constants,commonTerms,joinPath,deadcode,reduce,dataflow,compression,dataflow,history,multiplex,garbageCollector
+# cmdline opt  config = /ufs/sjoerd/Monet-virgin-candidate/etc/monetdb5.conf
+# cmdline opt  gdk_nr_threads = 0
+# cmdline opt  monet_mod_path = 
/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5:/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5/lib:/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5/bin
+# cmdline opt  gdk_dbfarm = 
/ufs/sjoerd/Monet-virgin-candidate/var/monetdb5/dbfarm
+# cmdline opt  mapi_open = true
+# cmdline opt  xrpc_open = true
+# cmdline opt  mapi_port = 36696
+# cmdline opt  xrpc_port = 47238
+# cmdline opt  monet_prompt = 
+# cmdline opt  mal_listing = 2
+# cmdline opt  gdk_dbname = mTests_test_BugTracker-2011
+# cmdline opt  mal_listing = 0
+#warning: please don't forget to set your vault key!
+#(see /ufs/sjoerd/Monet-virgin-candidate/etc/monetdb5.conf)
+
+# 11:21:47 >  
+# 11:21:47 >  mclient -lsql -ftest -i -e --host=ottar --port=36696 
+# 11:21:47 >  
+
+
+# 11:21:47 >  
+# 11:21:47 >  Done.
+# 11:21:47 >  
+
diff --git 
a/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.stable.out 
b/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.stable.out
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2011/Tests/correlated-update.Bug-2771.stable.out
@@ -0,0 +1,51 @@
+stdout of test 'correlated-update.Bug-2771` in directory 
'test/BugTracker-2011` itself:
+
+
+# 11:21:47 >  
+# 11:21:47 >   mserver5 
"--config=/ufs/sjoerd/Monet-virgin-candidate/etc/monetdb5.conf" --debug=10 
--set gdk_nr_threads=0 --set 
"monet_mod_path=/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5:/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5/lib:/ufs/sjoerd/Monet-virgin-candidate/lib64/monetdb5/bin"
 --set "gdk_dbfarm=/ufs/sjoerd/Monet-virgin-candidate/var/monetdb5/dbfarm"  
--set mapi_open=true --set xrpc_open=true --set mapi_port=36696 --set 
xrpc_port=47238 --set monet_prompt= --trace --forcemito --set mal_listing=2  
"--dbname=mTests_test_BugTracker-2011" --set mal_listing=0 ; echo ; echo Over..
+# 11:21:47 >  
+
+# MonetDB 5 server v11.1.0
+# Not released
+# Serving database 'mTests_test_BugTracker-2011', using 4 threads
+# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically 
linked
+# Found 7.749 GiB available main-memory.
+# Copyright (c) 1993-July 2008 CWI.
+# Copyright (c) August 2008-2011 MonetDB B.V., all rights reserved
+# Visit http://monetdb.cwi.nl/ for further information
+# MonetDB/SQL module v11.1.0 loaded
+# MonetDB/GIS module v11.1.0 loaded
+
+Ready.
+# SQL catalog created, loading sql scripts once
+
+Over..
+
+# 11:21:47 >  
+# 11:21:47 >  mclient -lsql -ftest -i -e --host=ottar --port=36696 
+# 11:21:47 >  
+
+#create table table1_bug2771 (x clob, y clob);
+#insert into table1_bug2771 values ('one','');
+[ 1    ]
+#insert into table1_bug2771 values ('two','');
+[ 1    ]
+#create table table2_bug2771 (x clob, y clob);
+#insert into table2_bug2771 values ('one','een');
+[ 1    ]
+#insert into table2_bug2771 values ('two','twee');
+[ 1    ]
+#update table1_bug2771 set y = (select y from table2_bug2771 where 
table1_bug2771.x = table2_bug2771.x and table1_bug2771.y = '' and 
table2_bug2771.y <> '');
+[ 2    ]
+#select * from table1_bug2771;
+% sys.table1_bug2771,  sys.table1_bug2771 # table_name
+% x,   y # name
+% clob,        clob # type
+% 3,   4 # length
+[ "one",       "een"   ]
+[ "two",       "twee"  ]
+
+# 11:21:47 >  
+# 11:21:47 >  Done.
+# 11:21:47 >  
+
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to