MonetDB: Jun2010 - Serialize output. This should fix bug 2621.
Changeset: 0fc1ce9d7571 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0fc1ce9d7571 Modified Files: sql/src/test/BugTracker/Tests/mdb_starts_with_sql_debug_64.SF-1999354.py sql/src/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.py sql/src/test/BugTracker/Tests/set_sql_debug_64__breaking_the_DB.SF-1906287.py sql/src/test/Connections/Tests/connections.py Branch: Jun2010 Log Message: Serialize output. This should fix bug 2621. diffs (254 lines): diff -r 755b9fac3283 -r 0fc1ce9d7571 sql/src/test/BugTracker/Tests/mdb_starts_with_sql_debug_64.SF-1999354.py --- a/sql/src/test/BugTracker/Tests/mdb_starts_with_sql_debug_64.SF-1999354.py Mon Jul 19 10:20:25 2010 +0200 +++ b/sql/src/test/BugTracker/Tests/mdb_starts_with_sql_debug_64.SF-1999354.py Mon Jul 19 10:58:40 2010 +0200 @@ -4,20 +4,32 @@ def server_start(args): sys.stderr.write('#mserver: %s\n' % ' '.join(args)) sys.stderr.flush() -srv = process.server('sql', args = args, stdin = process.PIPE) +srv = process.server('sql', args = args, stdin = process.PIPE, + stdout = process.PIPE, stderr = process.PIPE) time.sleep(5) # give server time to start return srv def client(lang, file): sys.stderr.write('#client: %s\n' % file) sys.stderr.flush() -clt = process.client(lang.lower(), stdin = open(file)) -clt.communicate() +clt = process.client(lang.lower(), stdin = open(file), + stdout = process.PIPE, stderr = process.PIPE) +return clt.communicate() def main(): srv = server_start([--set, sql_debug=64]) -client('SQL' , os.path.join(os.getenv('RELSRCDIR'), '..', '..', '..', 'sql', 'skyserver.sql')) -client('SQL' , os.path.join(os.getenv('RELSRCDIR'), 'mdb_starts_with_sql_debug_64.SF-1999354.sql')) -srv.communicate() +out, err = client('SQL' , + os.path.join(os.getenv('RELSRCDIR'), + '..', '..', '..', 'sql', 'skyserver.sql')) +sys.stdout.write(out) +sys.stderr.write(err) +out, err = client('SQL', + os.path.join(os.getenv('RELSRCDIR'), + 'mdb_starts_with_sql_debug_64.SF-1999354.sql')) +sys.stdout.write(out) +sys.stderr.write(err) +out, err = srv.communicate() +sys.stdout.write(out) +sys.stderr.write(err) main() diff -r 755b9fac3283 -r 0fc1ce9d7571 sql/src/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.py --- a/sql/src/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.py Mon Jul 19 10:20:25 2010 +0200 +++ b/sql/src/test/BugTracker/Tests/set_a_new_user_password.SF-1844050.py Mon Jul 19 10:58:40 2010 +0200 @@ -4,27 +4,49 @@ def server_start(lang): sys.stderr.write('#mserver\n') sys.stderr.flush() -srv = process.server(lang, stdin = process.PIPE) +srv = process.server(lang, stdin = process.PIPE, + stdout = process.PIPE, stderr = process.PIPE) time.sleep(5) # give server time to start 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)) -clt.communicate() +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('sql') -client('sql' , os.path.join(os.getenv('RELSRCDIR'), 'set_a_new_user_password.SF-1844050_create_user.sql')) -srv.communicate() +out, err = client('sql', + os.path.join(os.getenv('RELSRCDIR'), + 'set_a_new_user_password.SF-1844050_create_user.sql')) +sys.stdout.write(out) +sys.stderr.write(err) +out, err = srv.communicate() +sys.stdout.write(out) +sys.stderr.write(err) srv = server_start('sql') -client('sql' , os.path.join(os.getenv('RELSRCDIR'), 'set_a_new_user_password.SF-1844050_select.sql'), voc2, new) -srv.communicate() +out, err = client('sql', + os.path.join(os.getenv('RELSRCDIR'), + 'set_a_new_user_password.SF-1844050_select.sql'), + voc2, new) +sys.stdout.write(out) +sys.stderr.write(err) +out, err = srv.communicate() +sys.stdout.write(out) +sys.stderr.write(err) srv = server_start('sql') -client('sql' , os.path.join(os.getenv('RELSRCDIR'), 'set_a_new_user_password.SF-1844050_drop_user.sql')) -srv.communicate() +out, err = client('sql', + os.path.join(os.getenv('RELSRCDIR'), + 'set_a_new_user_password.SF-1844050_drop_user.sql')) +sys.stdout.write(out)
MonetDB: default - Compilation fixes.
Changeset: 159f96e96564 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=159f96e96564 Modified Files: MonetDB5/src/optimizer/opt_support.mx Branch: default Log Message: Compilation fixes. It's been more than 20 years that index is called strchr... If you want to shift more than 32 bits, make sure you're shifting a value that has more than 32 bits. diffs (21 lines): diff -r 24d6620655f2 -r 159f96e96564 MonetDB5/src/optimizer/opt_support.mx --- a/MonetDB5/src/optimizer/opt_support.mx Mon Jul 19 10:20:54 2010 +0200 +++ b/MonetDB5/src/optimizer/opt_support.mx Mon Jul 19 11:00:48 2010 +0200 @@ -569,7 +569,7 @@ #define DEBUG_OPT_TRACE48 #define DEBUG_OPT_HEURISTIC49 -#define DEBUG_OPT(X) ( 1 (X)) +#define DEBUG_OPT(X) ((lng) 1 (X)) opt_export lng optDebug; opt_export str MALoptimizer(Client c); @@ -759,7 +759,7 @@ } } for ( t = s = name; t *t ; t = s){ - s = index(s,','); + s = strchr(s,','); if ( s ) *s++ = 0; for ( i=0; optcatalog[i].name; i++) if ( strcmp(t,optcatalog[i].name) == 0){ ___ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2010 - Get rid of SQLROWSETSIZE and SQLROWOFFSET.
Changeset: 1fcc26eb1124 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1fcc26eb1124 Modified Files: clients/src/odbc/driver/ODBCStmt.h clients/src/odbc/driver/SQLExtendedFetch.c clients/src/odbc/driver/SQLFetch.c clients/src/odbc/driver/SQLFetchScroll.c Branch: Jun2010 Log Message: Get rid of SQLROWSETSIZE and SQLROWOFFSET. This should fix bug 2558. diffs (129 lines): diff -r c08da6d5d56a -r 1fcc26eb1124 clients/src/odbc/driver/ODBCStmt.h --- a/clients/src/odbc/driver/ODBCStmt.hMon Jul 19 16:31:46 2010 +0200 +++ b/clients/src/odbc/driver/ODBCStmt.hMon Jul 19 16:41:01 2010 +0200 @@ -80,9 +80,9 @@ set (0 based); rowSetSize is the number of rows in the current result set; currentRow is the row number of the current row within the current result set */ - SQLROWOFFSET currentRow; - SQLROWOFFSET startRow; - SQLROWOFFSET rowSetSize; + SQLLEN currentRow; + SQLLEN startRow; + SQLLEN rowSetSize; unsigned int currentCol; /* used by SQLGetData() */ SQLINTEGER retrieved; /* amount of data retrieved */ diff -r c08da6d5d56a -r 1fcc26eb1124 clients/src/odbc/driver/SQLExtendedFetch.c --- a/clients/src/odbc/driver/SQLExtendedFetch.cMon Jul 19 16:31:46 2010 +0200 +++ b/clients/src/odbc/driver/SQLExtendedFetch.cMon Jul 19 16:41:01 2010 +0200 @@ -42,8 +42,12 @@ SQLRETURN SQL_API SQLExtendedFetch(SQLHSTMT hStmt, SQLUSMALLINT nOrientation, -SQLROWOFFSET nOffset, -SQLROWSETSIZE *pnRowCount, +SQLLEN nOffset, +#ifdef BUILD_REAL_64_BIT_MODE /* note: only defined on Debian Lenny */ +SQLUINTEGER *pnRowCount, +#else +SQLULEN *pnRowCount, +#endif SQLUSMALLINT *pRowStatusArray) { ODBCStmt *stmt = (ODBCStmt *) hStmt; @@ -81,8 +85,13 @@ if (SQL_SUCCEEDED(rc) || rc == SQL_NO_DATA) stmt-State = EXTENDEDFETCHED; - if (SQL_SUCCEEDED(rc) pnRowCount) + if (SQL_SUCCEEDED(rc) pnRowCount) { +#ifdef BUILD_REAL_64_BIT_MODE /* note: only defined on Debian Lenny */ + *pnRowCount = (SQLUINTEGER) stmt-rowSetSize; +#else *pnRowCount = (SQLULEN) stmt-rowSetSize; +#endif + } return rc; } diff -r c08da6d5d56a -r 1fcc26eb1124 clients/src/odbc/driver/SQLFetch.c --- a/clients/src/odbc/driver/SQLFetch.cMon Jul 19 16:31:46 2010 +0200 +++ b/clients/src/odbc/driver/SQLFetch.cMon Jul 19 16:41:01 2010 +0200 @@ -77,7 +77,7 @@ updating the SQL_DESC_ARRAY_STATUS_PTR */ stmt-rowSetSize = desc-sql_desc_array_size; - if (stmt-startRow + stmt-rowSetSize (SQLROWOFFSET) stmt-rowcount) + if (stmt-startRow + stmt-rowSetSize (SQLLEN) stmt-rowcount) stmt-rowSetSize = stmt-rowcount - stmt-startRow; if (stmt-rowSetSize = 0) { @@ -85,7 +85,7 @@ return SQL_NO_DATA; } if (statusp) { - for (row = 0; (SQLROWOFFSET) row stmt-rowSetSize; row++) + for (row = 0; (SQLLEN) row stmt-rowSetSize; row++) *statusp++ = SQL_ROW_SUCCESS; for (; row desc-sql_desc_array_size; row++) *statusp++ = SQL_ROW_NOROW; diff -r c08da6d5d56a -r 1fcc26eb1124 clients/src/odbc/driver/SQLFetchScroll.c --- a/clients/src/odbc/driver/SQLFetchScroll.c Mon Jul 19 16:31:46 2010 +0200 +++ b/clients/src/odbc/driver/SQLFetchScroll.c Mon Jul 19 16:41:01 2010 +0200 @@ -45,7 +45,7 @@ SQLRETURN SQLFetchScroll_(ODBCStmt *stmt, SQLSMALLINT FetchOrientation, - SQLROWOFFSET FetchOffset) + SQLLEN FetchOffset) { assert(stmt-hdl); @@ -62,7 +62,7 @@ switch (FetchOrientation) { case SQL_FETCH_NEXT: - if (stmt-currentRow = (SQLROWOFFSET) stmt-rowcount) { + if (stmt-currentRow = (SQLLEN) stmt-rowcount) { stmt-State = FETCHED; return SQL_NO_DATA; } @@ -84,7 +84,7 @@ stmt-State = FETCHED; return SQL_NO_DATA; } - if (stmt-startRow (SQLROWOFFSET) RowSetSize) { + if (stmt-startRow (SQLLEN) RowSetSize) { /* Attempt to fetch before the result set returned the first rowset */ addStmtError(stmt, 01S06, NULL, 0); @@ -94,7 +94,7 @@ break; case SQL_FETCH_RELATIVE: if ((stmt-currentRow != 0 || FetchOffset = 0) - (stmt-currentRow != (SQLROWOFFSET) stmt-rowcount || FetchOffset = 0)) { + (stmt-currentRow != (SQLLEN) stmt-rowcount || FetchOffset
MonetDB: default - Remove mapilite: the project has been abandoned.
Changeset: 8563aa91e7a3 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8563aa91e7a3 Modified Files: clients/configure.ag clients/src/Makefile.ag clients/src/mapilite/Makefile.ag clients/src/mapilite/mapilite.c clients/src/mapilite/mapilite.h clients/src/mapilite/tests/__init__.py clients/src/mapilite/tests/generate.sh clients/src/mapilite/tests/mapi_structs.h clients/src/mapilite/tests/mapi_structs.py clients/src/mapilite/tests/runtests.py clients/src/mapilite/tests/test_mapi.py Branch: default Log Message: Remove mapilite: the project has been abandoned. diffs (truncated from 5837 to 300 lines): diff -r b75df91c26f8 -r 8563aa91e7a3 clients/configure.ag --- a/clients/configure.ag Mon Jul 19 11:05:36 2010 +0200 +++ b/clients/configure.ag Mon Jul 19 16:41:53 2010 +0200 @@ -83,18 +83,6 @@ AC_PROG_LIBTOOL -have_mapilite=no -AC_ARG_WITH([mapilite], -[AS_HELP_STRING([--with-mapilite], -[enable experimental lightweight mapi library])], -[have_mapilite=yes], -[have_mapilite=no]) - -AS_IF([test x$have_mapilite != xno], - AC_DEFINE([HAVE_MAPILITE], [1], [Define if you want to use the mapilite library]) -) -AM_CONDITIONAL(HAVE_MAPILITE, test x$have_mapilite != xno) - # Checks for libraries. dnl unixODBC dnl this is only used by the ODBC driver diff -r b75df91c26f8 -r 8563aa91e7a3 clients/src/Makefile.ag --- a/clients/src/Makefile.ag Mon Jul 19 11:05:36 2010 +0200 +++ b/clients/src/Makefile.ag Mon Jul 19 16:41:53 2010 +0200 @@ -15,4 +15,4 @@ # Copyright August 2008-2010 MonetDB B.V. # All Rights Reserved. -SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php HAVE_RUBYGEM?ruby examples HAVE_MAPILITE?mapilite +SUBDIRS = mapilib mapiclient HAVE_ODBC?odbc HAVE_PERL?perl php HAVE_RUBYGEM?ruby examples diff -r b75df91c26f8 -r 8563aa91e7a3 clients/src/mapilite/Makefile.ag --- a/clients/src/mapilite/Makefile.ag Mon Jul 19 11:05:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 + @@ -1,32 +0,0 @@ -# The contents of this file are subject to the MonetDB Public License -# Version 1.1 (the License); you may not use this file except in -# compliance with the License. You may obtain a copy of the License at -# http://monetdb.cwi.nl/Legal/MonetDBLicense-1.1.html -# -# Software distributed under the License is distributed on an AS IS -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the -# License for the specific language governing rights and limitations -# under the License. -# -# The Original Code is the MonetDB Database System. -# -# The Initial Developer of the Original Code is CWI. -# Portions created by CWI are Copyright (C) 1997-July 2008 CWI. -# Copyright August 2008-2010 MonetDB B.V. -# All Rights Reserved. - -MTSAFE -INCLUDES = $(MONETDB_INCS) $(READLINE_INCS) $(OPENSSL_INCS) - -MAPI_LIBS = $(SOCKET_LIBS) $(OPENSSL_LIBS) - -lib_mapilite = { - SOURCES = mapilite.c - LIBS = $(MAPI_LIBS) $(MONETDB_LIBS) -lmutils -lstream -} - -headers_mapilite = { - DIR = includedir/MonetDB/mapilitelib - HEADERS = h - SOURCES = mapilite.h -} diff -r b75df91c26f8 -r 8563aa91e7a3 clients/src/mapilite/mapilite.c --- a/clients/src/mapilite/mapilite.c Mon Jul 19 11:05:36 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 + @@ -1,4046 +0,0 @@ - -#include clients_config.h -#include monet_utils.h -#include stream.h/* include before Mapi.h */ -#include stream_socket.h -#include mapilite.h - -#ifdef HAVE_UNISTD_H -# include unistd.h -#endif -#include stdio.h -#ifdef HAVE_PWD_H -#include pwd.h -#endif -#include sys/types.h - -#ifdef HAVE_SYS_UN_H -#include sys/un.h -#endif -#ifdef HAVE_NETDB_H -# include netdb.h -# include netinet/in.h -#endif - -#include signal.h -#include string.h -#include memory.h - -/*additional definitions for date and time*/ -#ifdef HAVE_FTIME -#include sys/timeb.h -#endif - -#ifdef TIME_WITH_SYS_TIME -# include sys/time.h -# include time.h -#else -# ifdef HAVE_SYS_TIME_H -# include sys/time.h -# else -# include time.h -# endif -#endif - -#ifdef NATIVE_WIN32 -#define strdup _strdup -#endif - -#ifdef HAVE_CRYPT_H -# include crypt.h -#else -# if defined(HAVE_CRYPT) defined(__MINGW32__) -_CRTIMP char *__cdecl crypt(const char *key, const char *salt); -# endif -#endif - -#ifdef HAVE_OPENSSL -# include openssl/md5.h -# include openssl/sha.h -# include openssl/ripemd.h -#endif - -#ifndef INVALID_SOCKET -#define INVALID_SOCKET (-1) -#endif - - -#define MAPIBLKSIZE256 /* minimum buffer shipped */ -#define MAXQUERYSIZE (100*1024) -#define QUERYBLOCK (16*1024) - - -/* information about the columns in a result set */ -struct MapiColumn { - char *tablename; - char *columnname; - char *columntype; - int columnlength; -}; - -/* information about bound columns */ -struct MapiBinding { - void *outparam; /* pointer to application variable */ - int
MonetDB: default - Merge with Jun2010 branch.
Changeset: d4eb822dfa01 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d4eb822dfa01 Modified Files: Branch: default Log Message: Merge with Jun2010 branch. diffs (141 lines): diff -r 8563aa91e7a3 -r d4eb822dfa01 clients/src/odbc/driver/ODBCStmt.h --- a/clients/src/odbc/driver/ODBCStmt.hMon Jul 19 16:41:53 2010 +0200 +++ b/clients/src/odbc/driver/ODBCStmt.hMon Jul 19 16:42:26 2010 +0200 @@ -80,9 +80,9 @@ set (0 based); rowSetSize is the number of rows in the current result set; currentRow is the row number of the current row within the current result set */ - SQLROWOFFSET currentRow; - SQLROWOFFSET startRow; - SQLROWOFFSET rowSetSize; + SQLLEN currentRow; + SQLLEN startRow; + SQLLEN rowSetSize; unsigned int currentCol; /* used by SQLGetData() */ SQLINTEGER retrieved; /* amount of data retrieved */ diff -r 8563aa91e7a3 -r d4eb822dfa01 clients/src/odbc/driver/SQLExtendedFetch.c --- a/clients/src/odbc/driver/SQLExtendedFetch.cMon Jul 19 16:41:53 2010 +0200 +++ b/clients/src/odbc/driver/SQLExtendedFetch.cMon Jul 19 16:42:26 2010 +0200 @@ -42,8 +42,12 @@ SQLRETURN SQL_API SQLExtendedFetch(SQLHSTMT hStmt, SQLUSMALLINT nOrientation, -SQLROWOFFSET nOffset, -SQLROWSETSIZE *pnRowCount, +SQLLEN nOffset, +#ifdef BUILD_REAL_64_BIT_MODE /* note: only defined on Debian Lenny */ +SQLUINTEGER *pnRowCount, +#else +SQLULEN *pnRowCount, +#endif SQLUSMALLINT *pRowStatusArray) { ODBCStmt *stmt = (ODBCStmt *) hStmt; @@ -81,8 +85,13 @@ if (SQL_SUCCEEDED(rc) || rc == SQL_NO_DATA) stmt-State = EXTENDEDFETCHED; - if (SQL_SUCCEEDED(rc) pnRowCount) + if (SQL_SUCCEEDED(rc) pnRowCount) { +#ifdef BUILD_REAL_64_BIT_MODE /* note: only defined on Debian Lenny */ + *pnRowCount = (SQLUINTEGER) stmt-rowSetSize; +#else *pnRowCount = (SQLULEN) stmt-rowSetSize; +#endif + } return rc; } diff -r 8563aa91e7a3 -r d4eb822dfa01 clients/src/odbc/driver/SQLFetch.c --- a/clients/src/odbc/driver/SQLFetch.cMon Jul 19 16:41:53 2010 +0200 +++ b/clients/src/odbc/driver/SQLFetch.cMon Jul 19 16:42:26 2010 +0200 @@ -77,7 +77,7 @@ updating the SQL_DESC_ARRAY_STATUS_PTR */ stmt-rowSetSize = desc-sql_desc_array_size; - if (stmt-startRow + stmt-rowSetSize (SQLROWOFFSET) stmt-rowcount) + if (stmt-startRow + stmt-rowSetSize (SQLLEN) stmt-rowcount) stmt-rowSetSize = stmt-rowcount - stmt-startRow; if (stmt-rowSetSize = 0) { @@ -85,7 +85,7 @@ return SQL_NO_DATA; } if (statusp) { - for (row = 0; (SQLROWOFFSET) row stmt-rowSetSize; row++) + for (row = 0; (SQLLEN) row stmt-rowSetSize; row++) *statusp++ = SQL_ROW_SUCCESS; for (; row desc-sql_desc_array_size; row++) *statusp++ = SQL_ROW_NOROW; diff -r 8563aa91e7a3 -r d4eb822dfa01 clients/src/odbc/driver/SQLFetchScroll.c --- a/clients/src/odbc/driver/SQLFetchScroll.c Mon Jul 19 16:41:53 2010 +0200 +++ b/clients/src/odbc/driver/SQLFetchScroll.c Mon Jul 19 16:42:26 2010 +0200 @@ -45,7 +45,7 @@ SQLRETURN SQLFetchScroll_(ODBCStmt *stmt, SQLSMALLINT FetchOrientation, - SQLROWOFFSET FetchOffset) + SQLLEN FetchOffset) { assert(stmt-hdl); @@ -62,7 +62,7 @@ switch (FetchOrientation) { case SQL_FETCH_NEXT: - if (stmt-currentRow = (SQLROWOFFSET) stmt-rowcount) { + if (stmt-currentRow = (SQLLEN) stmt-rowcount) { stmt-State = FETCHED; return SQL_NO_DATA; } @@ -84,7 +84,7 @@ stmt-State = FETCHED; return SQL_NO_DATA; } - if (stmt-startRow (SQLROWOFFSET) RowSetSize) { + if (stmt-startRow (SQLLEN) RowSetSize) { /* Attempt to fetch before the result set returned the first rowset */ addStmtError(stmt, 01S06, NULL, 0); @@ -94,7 +94,7 @@ break; case SQL_FETCH_RELATIVE: if ((stmt-currentRow != 0 || FetchOffset = 0) - (stmt-currentRow != (SQLROWOFFSET) stmt-rowcount || FetchOffset = 0)) { + (stmt-currentRow != (SQLLEN) stmt-rowcount || FetchOffset = 0)) { if ((stmt-currentRow == 0 FetchOffset = 0) || (stmt-startRow == 0 FetchOffset 0) || (stmt-startRow 0 @@ -114,8 +114,8 @@