Changeset: 42877a43b466 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=42877a43b466 Modified Files: clients/mapilib/mapi.c sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err testing/Mtest.py.in Branch: default Log Message:
Merge with Aug2011 branch. diffs (117 lines): diff --git a/clients/ChangeLog.Aug2011 b/clients/ChangeLog.Aug2011 --- a/clients/ChangeLog.Aug2011 +++ b/clients/ChangeLog.Aug2011 @@ -1,6 +1,11 @@ # ChangeLog file for clients # This file is updated with Maddlog +* Mon Oct 10 2011 Sjoerd Mullender <[email protected]> +- Fixed a source of crashes in mclient when a query on the command line + using the -s option is combined with input on standard input (e.g. in + the construct mclient -s 'COPY INTO t FROM STDIN ...' < file.csv). + * Fri Oct 7 2011 Sjoerd Mullender <[email protected]> - Fixed bug 2897 where slow (network) reads could cause blocks to not be fully read in one go, causing errors in the subsequent use of diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c --- a/clients/mapilib/mapi.c +++ b/clients/mapilib/mapi.c @@ -4147,22 +4147,14 @@ mapi_query_part(MapiHdl hdl, const char mid->active = hdl; /* remember the query just for the error messages */ if (hdl->query == NULL) { - size_t sz = size; - - sz = 512; - hdl->query = malloc(sz + 1); - assert(hdl->query); - hdl->query[0] = '\0'; - strncpy(hdl->query, query, sz); - hdl->query[sz] = '\0'; + hdl->query = strdup(query); } else { - size_t ln = strlen(hdl->query), sz = 512 - ln; - if (sz > 0) { - if (size < sz) - sz = size; - assert(hdl->query); - strncat(hdl->query, query, sz); - } + size_t sz = strlen(hdl->query); + char *q; + + if (sz < 512 && + (q = realloc(hdl->query, sz + size + 1)) != NULL) + hdl->query = strcat(q, query); } if (mid->trace == MAPI_TRACE) { diff --git a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err --- a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err +++ b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.err @@ -68,9 +68,9 @@ stderr of test 'select_from_env.SF-12407 # 22:29:10 > mclient -lsql -i -umonetdb -Pmonetdb --host=pegasus --port=30332 # 22:29:10 > -MAPI = monetdb@niels:37002 +MAPI = monetdb@ottar:32718 QUERY = select * from env() as env where name = ( select 'prefix' from env() as env ); -ERROR = !SQLException:zero_or_one:cardinality violation (20>1) +ERROR = !SQLException:zero_or_one:cardinality violation (21>1) # 13:22:15 > # 13:22:15 > Done. diff --git a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out --- a/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out +++ b/sql/test/BugDay_2005-12-19_2.9.3/Tests/select_from_env.SF-1240701.1242164.stable.out @@ -45,6 +45,7 @@ Ready. [ "monet_mod_path" ] [ "monet_pid" ] [ "monet_prompt" ] +[ "monet_release" ] [ "monet_version" ] [ "sql_debug" ] [ "sql_optimizer" ] diff --git a/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err b/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err --- a/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err +++ b/sql/test/BugTracker/Tests/cardinality_violation.SF-1240701.stable.err @@ -80,10 +80,10 @@ stderr of test 'cardinality_violation.SF # 21:00:43 > mclient -lsql -umonetdb -Pmonetdb --host=alf --port=38808 # 21:00:43 > -MAPI = monetdb@niels:37002 +MAPI = monetdb@ottar:34564 QUERY = select * from env() as env where name = ( select 'prefix' from env() as env ); -ERROR = !SQLException:zero_or_one:cardinality violation (20>1) -MAPI = monetdb@niels:37002 +ERROR = !SQLException:zero_or_one:cardinality violation (21>1) +MAPI = monetdb@ottar:34564 QUERY = select * from columns where name = (select columns.name from _tables, columns where _tables.id = columns.table_id); ERROR = !SQLException:zero_or_one:cardinality violation (296>1) diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in --- a/testing/Mtest.py.in +++ b/testing/Mtest.py.in @@ -124,7 +124,12 @@ except ImportError: p = distutils.sysconfig.get_python_lib(0, 0, '') if p.endswith('dist-packages'): # Ubuntu - sys.path.insert(0, _configure(os.path.join('QXprefix@', p.replace('dist-packages', 'site-packages')))) + p = p.replace('dist-packages', 'site-packages') + sys.path.insert(0, _configure(os.path.join('QXprefix@', p))) + if os.environ.has_key('PYTHONPATH'): + p = p + os.pathsep + os.environ['PYTHONPATH'] + os.environ['PYTHONPATH'] = p + p = distutils.sysconfig.get_python_lib(0, 0, '') p = _configure(os.path.join('@QXprefix@', p)) sys.path.insert(0, p) import MonetDBtesting.subprocess26 as subprocess @@ -734,7 +739,7 @@ def CreateTstWhatXhtml (env, TST, stable d = urlpref if os.path.isfile(TST + stableWHAT + '.src'): # there's only one file like this... - fl = open(TST + EXT + '.src').readline().strip() + fl = open(TST + stableWHAT + '.src').readline().strip() if fl.startswith('$RELSRCDIR/'): fl = fl[11:] while fl.startswith('../'): _______________________________________________ Checkin-list mailing list [email protected] http://mail.monetdb.org/mailman/listinfo/checkin-list
