Changeset: 04e4a6a7dac6 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=04e4a6a7dac6
Modified Files:
        clients/nodejs/monetdb/mapiclient.js
        clients/nodejs/monetdb/package.json
        clients/odbc/driver/ODBCStmt.h
        clients/odbc/driver/SQLExtendedFetch.c
        clients/odbc/driver/SQLFetch.c
        clients/odbc/driver/SQLFetchScroll.c
        configure.ag
        gdk/gdk_atomic.h
        gdk/gdk_system.c
        gdk/gdk_system.h
        gdk/gdk_utils.c
        monetdb5/mal/mal_instruction.c
        monetdb5/optimizer/Tests/manifold2.stable.out.single
        sql/backends/monet5/UDF/Tests/udf-fuse.stable.out
        sql/backends/monet5/UDF/Tests/udf-reverse.stable.out
        sql/backends/monet5/rest/Tests/jsonstore00.stable.out
        sql/backends/monet5/sql_scenario.c
        
sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out
        
sql/test/BugTracker-2010/Tests/group-by_ordered_column.Bug-2564.stable.out
        sql/test/BugTracker/Tests/insert_not_exists.SF-1380287.stable.out
        sql/test/Skyserver/Tests/Skyserver.stable.out
        sql/test/Tests/decimal2.stable.out
        sql/test/bugs/Tests/unicode_varchar-bug-sf-1041324_MapiClient.stable.out
        testing/Mtest.py.in
Branch: bamloader
Log Message:

Merge with default


diffs (truncated from 838 to 300 lines):

diff --git a/clients/nodejs/monetdb/mapiclient.js 
b/clients/nodejs/monetdb/mapiclient.js
--- a/clients/nodejs/monetdb/mapiclient.js
+++ b/clients/nodejs/monetdb/mapiclient.js
@@ -122,26 +122,31 @@ MonetDBConnection.prototype.prepare = fu
        thizz.query(query, function(error, resp) {
                if (!error) {
                        var execfun = function(bindparams, ecallback) {
-                               var quoted = bindparams.map(function(param) {
+                               var quoted = bindparams.map(function(param, 
paramIndex) {
                                        if(param === null) {
                                                return "NULL";
                                        }
                                        var type = typeof param;
+                                       var s;
                                        switch(type) {
                                                case 'boolean':
                                                case 'number':
-                                                       return '' + param;
+                                                       s = '' + param;
                                                        break
                                                case 'string':
                                                /* escape single quotes except 
if they are already escaped */
-                                                       return "'" + 
param.replace(/([^\\])'/g,"$1\\'") + "'";
+                                                       s = "'" + 
param.replace(/([^\\])'/g,"$1\\'") + "'";
                                                        break
                                                default:
-                                                       return param;
+                                                       s = param;
                                                        break;
                                        }
+                                       var colData = 
resp.data[resp.rows-bindparams.length+paramIndex];
+                                       if(colData && colData[0] == 
"timestamp") {
+                                               s = "timestamp "+s;
+                                       }
+                                       return s;
                                }).join(', ');
-
                                var execquery = 'EXEC ' + resp.queryid + '(' + 
quoted + ')';
                                thizz.query(execquery, ecallback);
                        }
diff --git a/clients/nodejs/monetdb/package.json 
b/clients/nodejs/monetdb/package.json
--- a/clients/nodejs/monetdb/package.json
+++ b/clients/nodejs/monetdb/package.json
@@ -1,6 +1,6 @@
 {
   "name": "monetdb",
-  "version": "0.2.4",
+  "version": "0.2.5",
   "description": "Connect MonetDB and node.js",
   "main": "mapiclient.js",
   "author": "Hannes Mühleisen <han...@cwi.nl>",
diff --git a/clients/odbc/driver/ODBCStmt.h b/clients/odbc/driver/ODBCStmt.h
--- a/clients/odbc/driver/ODBCStmt.h
+++ b/clients/odbc/driver/ODBCStmt.h
@@ -199,9 +199,9 @@ SQLRETURN MNDBColAttribute(ODBCStmt *stm
 SQLRETURN MNDBExecDirect(ODBCStmt *stmt, SQLCHAR *szSqlStr,
                         SQLINTEGER nSqlStr);
 SQLRETURN MNDBExecute(ODBCStmt *stmt);
-SQLRETURN MNDBFetch(ODBCStmt *stmt);
+SQLRETURN MNDBFetch(ODBCStmt *stmt, SQLUSMALLINT *RowStatusArray);
 SQLRETURN MNDBFetchScroll(ODBCStmt *stmt, SQLSMALLINT nOrientation,
-                         SQLLEN nOffset);
+                         SQLLEN nOffset, SQLUSMALLINT *RowStatusArray);
 SQLRETURN MNDBFreeStmt(ODBCStmt *stmt, SQLUSMALLINT option);
 SQLRETURN MNDBGetStmtAttr(ODBCStmt *stmt, SQLINTEGER Attribute,
                          SQLPOINTER Value, SQLINTEGER BufferLength,
diff --git a/clients/odbc/driver/SQLExtendedFetch.c 
b/clients/odbc/driver/SQLExtendedFetch.c
--- a/clients/odbc/driver/SQLExtendedFetch.c
+++ b/clients/odbc/driver/SQLExtendedFetch.c
@@ -41,7 +41,6 @@ SQLExtendedFetch(SQLHSTMT StatementHandl
                 SQLUSMALLINT *RowStatusArray)
 {
        ODBCStmt *stmt = (ODBCStmt *) StatementHandle;
-       SQLUSMALLINT *array_status_ptr;
        SQLRETURN rc;
 
 #ifdef ODBCDEBUG
@@ -69,12 +68,8 @@ SQLExtendedFetch(SQLHSTMT StatementHandl
                return SQL_ERROR;
        }
 
-       array_status_ptr = stmt->ImplRowDescr->sql_desc_array_status_ptr;
-       stmt->ImplRowDescr->sql_desc_array_status_ptr = RowStatusArray;
-
-       rc = MNDBFetchScroll(stmt, FetchOrientation, FetchOffset);
-
-       stmt->ImplRowDescr->sql_desc_array_status_ptr = array_status_ptr;
+       rc = MNDBFetchScroll(stmt, FetchOrientation, FetchOffset,
+                            RowStatusArray);
 
        if (SQL_SUCCEEDED(rc) || rc == SQL_NO_DATA)
                stmt->State = EXTENDEDFETCHED;
diff --git a/clients/odbc/driver/SQLFetch.c b/clients/odbc/driver/SQLFetch.c
--- a/clients/odbc/driver/SQLFetch.c
+++ b/clients/odbc/driver/SQLFetch.c
@@ -34,14 +34,13 @@
 #endif
 
 SQLRETURN
-MNDBFetch(ODBCStmt *stmt)
+MNDBFetch(ODBCStmt *stmt, SQLUSMALLINT *RowStatusArray)
 {
        ODBCDesc *ard, *ird;
        ODBCDescRec *rec;
        int i;
        SQLULEN row;
        SQLLEN offset;
-       SQLUSMALLINT *statusp;
 
        /* stmt->startRow is the (0 based) index of the first row we
         * stmt->need to fetch */
@@ -62,8 +61,6 @@ MNDBFetch(ODBCStmt *stmt)
 
        stmt->State = FETCHED;
 
-       statusp = ird->sql_desc_array_status_ptr;
-
        if (stmt->retrieveData == SQL_RD_OFF) {
                /* don't really retrieve the data, just do as if,
                   updating the SQL_DESC_ARRAY_STATUS_PTR */
@@ -76,14 +73,14 @@ MNDBFetch(ODBCStmt *stmt)
                        stmt->rowSetSize = 0;
                        return SQL_NO_DATA;
                }
-               if (statusp) {
+               if (RowStatusArray) {
                        for (row = 0; (SQLLEN) row < stmt->rowSetSize; row++) {
-                               WriteValue(statusp, SQL_ROW_SUCCESS);
-                               statusp++;
+                               WriteValue(RowStatusArray, SQL_ROW_SUCCESS);
+                               RowStatusArray++;
                        }
                        for (; row < ard->sql_desc_array_size; row++) {
-                               WriteValue(statusp, SQL_ROW_NOROW);
-                               statusp++;
+                               WriteValue(RowStatusArray, SQL_ROW_NOROW);
+                               RowStatusArray++;
                        }
                }
                return SQL_SUCCESS;
@@ -101,23 +98,23 @@ MNDBFetch(ODBCStmt *stmt)
                                        return SQL_NO_DATA;
                                break;
                        case MTIMEOUT:
-                               if (statusp)
-                                       WriteValue(statusp, SQL_ROW_ERROR);
+                               if (RowStatusArray)
+                                       WriteValue(RowStatusArray, 
SQL_ROW_ERROR);
                                /* Timeout expired / Communication
                                 * link failure */
                                addStmtError(stmt, 
stmt->Dbc->sql_attr_connection_timeout ? "HYT00" : "08S01", 
mapi_error_str(stmt->Dbc->mid), 0);
                                return SQL_ERROR;
                        default:
-                               if (statusp)
-                                       WriteValue(statusp, SQL_ROW_ERROR);
+                               if (RowStatusArray)
+                                       WriteValue(RowStatusArray, 
SQL_ROW_ERROR);
                                /* General error */
                                addStmtError(stmt, "HY000", 
mapi_error_str(stmt->Dbc->mid), 0);
                                return SQL_ERROR;
                        }
                        break;
                }
-               if (statusp)
-                       WriteValue(statusp, SQL_ROW_SUCCESS);
+               if (RowStatusArray)
+                       WriteValue(RowStatusArray, SQL_ROW_SUCCESS);
 
                stmt->rowSetSize++;
 
@@ -139,20 +136,20 @@ MNDBFetch(ODBCStmt *stmt)
                                      rec->sql_desc_scale,
                                      rec->sql_desc_datetime_interval_precision,
                                      offset, row) == SQL_ERROR) {
-                               if (statusp)
-                                       WriteValue(statusp, 
SQL_ROW_SUCCESS_WITH_INFO);
+                               if (RowStatusArray)
+                                       WriteValue(RowStatusArray, 
SQL_ROW_SUCCESS_WITH_INFO);
                        }
                }
-               if (statusp)
-                       statusp++;
+               if (RowStatusArray)
+                       RowStatusArray++;
        }
        if (ird->sql_desc_rows_processed_ptr)
                *ird->sql_desc_rows_processed_ptr = (SQLULEN) stmt->rowSetSize;
 
-       if (statusp)
+       if (RowStatusArray)
                while (row++ < ard->sql_desc_array_size) {
-                       WriteValue(statusp, SQL_ROW_NOROW);
-                       statusp++;
+                       WriteValue(RowStatusArray, SQL_ROW_NOROW);
+                       RowStatusArray++;
                }
 
        return stmt->Error ? SQL_SUCCESS_WITH_INFO : SQL_SUCCESS;
@@ -188,5 +185,5 @@ SQLFetch(SQLHSTMT StatementHandle)
 
        stmt->startRow += stmt->rowSetSize;
 
-       return MNDBFetch(stmt);
+       return MNDBFetch(stmt, stmt->ImplRowDescr->sql_desc_array_status_ptr);
 }
diff --git a/clients/odbc/driver/SQLFetchScroll.c 
b/clients/odbc/driver/SQLFetchScroll.c
--- a/clients/odbc/driver/SQLFetchScroll.c
+++ b/clients/odbc/driver/SQLFetchScroll.c
@@ -34,7 +34,8 @@
 SQLRETURN
 MNDBFetchScroll(ODBCStmt *stmt,
                SQLSMALLINT FetchOrientation,
-               SQLLEN FetchOffset)
+               SQLLEN FetchOffset,
+               SQLUSMALLINT *RowStatusArray)
 {
        assert(stmt->hdl);
 
@@ -168,7 +169,7 @@ MNDBFetchScroll(ODBCStmt *stmt,
                return SQL_ERROR;
        }
 
-       return MNDBFetch(stmt);
+       return MNDBFetch(stmt, RowStatusArray);
 }
 
 SQLRETURN SQL_API
@@ -202,5 +203,6 @@ SQLFetchScroll(SQLHSTMT StatementHandle,
                return SQL_ERROR;
        }
 
-       return MNDBFetchScroll(stmt, FetchOrientation, FetchOffset);
+       return MNDBFetchScroll(stmt, FetchOrientation, FetchOffset,
+                              stmt->ImplRowDescr->sql_desc_array_status_ptr);
 }
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -1411,8 +1411,8 @@ case "$have_rubygem_dir" in
                                yes|auto)
                                        AC_MSG_CHECKING([where rubygems are 
stored])
                                        RUBY_DIR=
-                                       d=`$RUBY -rrbconfig -e "puts 
Config::CONFIG[['prefix']]" 2>/dev/null`
-                                       RUBY_DIR=`$RUBY -rrbconfig -e "puts 
Config::CONFIG[['sitelibdir']]" 2>/dev/null | sed -e "s|^$d/||" -e 
's/site_ruby/gems/'`
+                                       d=`$RUBY -rrbconfig -e "puts 
RbConfig::CONFIG[['prefix']]" 2>/dev/null`
+                                       RUBY_DIR=`$RUBY -rrbconfig -e "puts 
RbConfig::CONFIG[['sitelibdir']]" 2>/dev/null | sed -e "s|^$d/||" -e 
's/site_ruby/gems/'`
                                        if test x"$RUBY_DIR" = x ; then
                                                if test x"$have_rubygem_dir" != 
xauto; then
                                                        AC_MSG_ERROR([unable to 
determine rubygems location])
@@ -1437,7 +1437,7 @@ esac
 case "$RUBY_DIR" in
 ${prefix}/*)
        RUBY_DIR="\${prefix}`echo "$RUBY_DIR" | sed "s|^$prefix||"`";;
-/*)    ;;
+/*)    RUBY_DIR="\${prefix}$RUBY_DIR";;
 *)
        RUBY_DIR="\${prefix}/$RUBY_DIR";;
 esac
diff --git a/gdk/gdk_atomic.h b/gdk/gdk_atomic.h
--- a/gdk/gdk_atomic.h
+++ b/gdk/gdk_atomic.h
@@ -38,7 +38,10 @@
 #ifndef _GDK_ATOMIC_H_
 #define _GDK_ATOMIC_H_
 
-#if defined(HAVE_LIBATOMIC_OPS) && !defined(USE_PTHREAD_LOCKS)
+/* define this if you don't want to use atomic instructions */
+/* #define NO_ATOMIC_INSTRUCTIONS */
+
+#if defined(HAVE_LIBATOMIC_OPS) && !defined(NO_ATOMIC_INSTRUCTIONS)
 
 #include <atomic_ops.h>
 
@@ -60,7 +63,7 @@
 
 #else
 
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && 
!defined(USE_PTHREAD_LOCKS)
+#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && 
!defined(NO_ATOMIC_INSTRUCTIONS)
 
 #include <intrin.h>
 
@@ -107,7 +110,7 @@
 #define ATOMIC_TAS(var, lck, fcn)      _InterlockedCompareExchange(&var, 1, 0)
 #pragma intrinsic(_InterlockedCompareExchange)
 
-#elif (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !(defined(__sun__) 
&& SIZEOF_SIZE_T == SIZEOF_LNG) && !defined(_MSC_VER) && 
!defined(USE_PTHREAD_LOCKS)
+#elif (defined(__GNUC__) || defined(__INTEL_COMPILER)) && !(defined(__sun__) 
&& SIZEOF_SIZE_T == SIZEOF_LNG) && !defined(_MSC_VER) && 
!defined(NO_ATOMIC_INSTRUCTIONS)
 
 #if SIZEOF_SSIZE_T == SIZEOF_LNG
 #define ATOMIC_TYPE                    lng
@@ -226,7 +229,8 @@ static inline ATOMIC_TYPE
 }
 #define ATOMIC_DEC(var, lck, fcn)              __ATOMIC_DEC(&var, &(lck))
 
-#define ATOMIC_LOCK            /* must use locks */
+#define USE_PTHREAD_LOCKS      /* must use pthread locks */
+#define ATOMIC_LOCK            /* must use locks for atomic access */
 #define ATOMIC_INIT(lck, fcn)  MT_lock_init(&(lck), fcn)
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to