Changeset: 7470a2ba80c1 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7470a2ba80c1
Added Files:
        sql/test/BugTracker-2014/Tests/locate-offset.Bug-3563.sql
        sql/test/BugTracker-2014/Tests/locate-offset.Bug-3563.stable.err
        sql/test/BugTracker-2014/Tests/locate-offset.Bug-3563.stable.out
        sql/test/BugTracker-2014/Tests/round-sorted.Bug-3562.sql
        sql/test/BugTracker-2014/Tests/round-sorted.Bug-3562.stable.err
        sql/test/BugTracker-2014/Tests/round-sorted.Bug-3562.stable.out
Modified Files:
        NT/installer32/MonetDB-ODBC-Installer.vdproj
        NT/installer32/MonetDB5-Geom-Module.vdproj
        NT/installer32/MonetDB5-SQL-Installer.vdproj
        NT/monetdb_config.h.in
        clients/mapiclient/mclient.c
        clients/odbc/driver/ODBCUtil.c
        clients/odbc/driver/README
        clients/odbc/driver/SQLParamOptions.c
        clients/odbc/driver/SQLSetConnectAttr.c
        clients/odbc/driver/SQLSetConnectOption.c
        clients/odbc/driver/SQLSetDescField.c
        clients/odbc/driver/SQLSetEnvAttr.c
        clients/odbc/driver/SQLSetStmtAttr.c
        clients/odbc/driver/SQLSetStmtOption.c
        clients/odbc/samples/arraytest.c
        clients/odbc/samples/odbcsample1.c
        clients/odbc/samples/testgetinfo.c
        clients/odbc/winsetup/setup.c
        configure.ag
        gdk/gdk.h
        gdk/gdk_atoms.c
        gdk/gdk_bat.c
        gdk/gdk_calc.c
        gdk/gdk_group.c
        gdk/gdk_heap.c
        gdk/gdk_imprints.c
        gdk/gdk_private.h
        gdk/gdk_setop.c
        gdk/gdk_utils.c
        monetdb5/modules/atoms/str.c
        monetdb5/modules/mal/pcre.c
        sql/backends/monet5/rel_bin.c
        sql/backends/monet5/sql.c
        sql/backends/monet5/sql_fround_impl.h
        sql/backends/monet5/sql_gencode.c
        sql/backends/monet5/sql_optimizer.c
        sql/backends/monet5/sql_scenario.c
        sql/backends/monet5/sql_statistics.c
        sql/include/sql_catalog.h
        sql/server/sql_parser.y
        sql/storage/bat/bat_storage.c
        sql/storage/store.c
        sql/test/BugTracker-2014/Tests/All
Branch: default
Log Message:

Merge with Oct2014 branch.


diffs (truncated from 1996 to 300 lines):

diff --git a/NT/installer32/MonetDB-ODBC-Installer.vdproj 
b/NT/installer32/MonetDB-ODBC-Installer.vdproj
--- a/NT/installer32/MonetDB-ODBC-Installer.vdproj
+++ b/NT/installer32/MonetDB-ODBC-Installer.vdproj
@@ -566,8 +566,8 @@
         {
         "Name" = "8:Microsoft Visual Studio"
         "ProductName" = "8:MonetDB ODBC Driver"
-        "ProductCode" = "8:{66BABD32-D69D-4A89-A7F3-2655D4CD0641}"
-        "PackageCode" = "8:{D9B2D386-1461-43BC-9A63-93F1BA0D7921}"
+        "ProductCode" = "8:{2343A06A-C2EE-4093-A9D0-76BD33BD911E}"
+        "PackageCode" = "8:{3D25FE62-3ACA-4E4F-8C44-00F612B05AF2}"
         "UpgradeCode" = "8:{C1F69378-3F5C-4120-8224-32F07D3458F3}"
         "AspNetVersion" = "8:4.0.30319.0"
         "RestartWWWService" = "11:FALSE"
diff --git a/NT/installer32/MonetDB5-Geom-Module.vdproj 
b/NT/installer32/MonetDB5-Geom-Module.vdproj
--- a/NT/installer32/MonetDB5-Geom-Module.vdproj
+++ b/NT/installer32/MonetDB5-Geom-Module.vdproj
@@ -420,8 +420,8 @@
         {
         "Name" = "8:Microsoft Visual Studio"
         "ProductName" = "8:MonetDB5 SQL GIS Module"
-        "ProductCode" = "8:{66BABD32-D69D-4A89-A7F3-2655D4CD0641}"
-        "PackageCode" = "8:{D9B2D386-1461-43BC-9A63-93F1BA0D7921}"
+        "ProductCode" = "8:{C3E5CF14-CA74-4A9C-8051-AC733123C5F6}"
+        "PackageCode" = "8:{E77DD8EF-7830-4D56-97BE-26A2296F7008}"
         "UpgradeCode" = "8:{92C89C36-0E86-45E1-B3D8-0D6C91108F30}"
         "AspNetVersion" = "8:4.0.30319.0"
         "RestartWWWService" = "11:FALSE"
diff --git a/NT/installer32/MonetDB5-SQL-Installer.vdproj 
b/NT/installer32/MonetDB5-SQL-Installer.vdproj
--- a/NT/installer32/MonetDB5-SQL-Installer.vdproj
+++ b/NT/installer32/MonetDB5-SQL-Installer.vdproj
@@ -4288,8 +4288,8 @@
         {
         "Name" = "8:Microsoft Visual Studio"
         "ProductName" = "8:MonetDB5"
-        "ProductCode" = "8:{66BABD32-D69D-4A89-A7F3-2655D4CD0641}"
-        "PackageCode" = "8:{D9B2D386-1461-43BC-9A63-93F1BA0D7921}"
+        "ProductCode" = "8:{38BA5ECB-FCAA-46C3-BBEE-AA6A09D97B92}"
+        "PackageCode" = "8:{E537E35E-EB72-4AA5-A2F9-E4A4E5D92635}"
         "UpgradeCode" = "8:{730C595B-DBA6-48D7-94B8-A98780AC92B6}"
         "AspNetVersion" = "8:4.0.30319.0"
         "RestartWWWService" = "11:FALSE"
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -99,9 +99,6 @@
 /* there is something very similar to asctime_r on Windows: */
 #define asctime_r(t,b,s)       asctime_s(b,s,t)
 
-/* Define to 1 if the system has the type `bool'. */
-/* #undef HAVE_BOOL */
-
 /* Define if you have the cfitsio library */
 /* #undef HAVE_CFITSIO */
 
@@ -699,7 +696,7 @@
 /* #undef HAVE_XMMINTRIN_H */
 
 /* Define to 1 if the system has the type `_Bool'. */
-#define HAVE__BOOL 1
+/* #undef HAVE__BOOL */
 
 #ifdef _WIN64
 /* Define to 1 if you have the `_mul128' function. */
@@ -1035,6 +1032,12 @@ typedef unsigned __int64 uint64_t;
 
 #include <assert.h>
 
+/* normally defined in stdbool.h, but that doesn't exist on Windows */
+#define true 1
+#define false 0
+#define __bool_true_false_are_defined 1
+
+
 #define SLASH_2_DIR_SEP(s) {char *t; for(t=strchr(s, '/'    ); t; 
t=strchr(t+1, '/'    )) *t=DIR_SEP;}
 #define DIR_SEP_2_SLASH(s) {char *t; for(t=strchr(s, DIR_SEP); t; 
t=strchr(t+1, DIR_SEP)) *t='/'    ;}
 
@@ -1091,20 +1094,7 @@ typedef __int128_t hge;
 #error no definition for PDFMT
 #endif
 
-/* On Windows, always use 64 bit integers (even on 32-bit architectures)
- * to not get the warning C4311: 'type cast' : pointer truncation from
- * 'void *' to 'unsigned int' */
-#define PTRFMT         "%I64x"
-#define PTRFMTCAST     (unsigned __int64)
-
-#ifdef LIBGDK4
-#define LIBGDK 1
-#endif
-#ifdef LIBSTREAM4
-#define LIBSTREAM 1
-#endif
-#ifdef LIBMAPI4
-#define LIBMAPI 1
-#endif
+#define PTRFMT         "%p"
+#define PTRFMTCAST
 
 #endif /* _SEEN_MONETDB_CONFIG_H */
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -597,8 +597,9 @@ XMLprdata(const char *val)
                else if ((*val & 0xFF) < 0x20)  /* control character */
                        mnstr_printf(toConsole_raw, "&#%d;", *val & 0xFF);
                else if ((*val & 0x80) != 0 /* && encoding != NULL */ ) {
-                       int n, m;
-                       int c = *val & 0x7F;
+                       int n;
+                       unsigned int m;
+                       unsigned int c = *val & 0x7F;
 
                        for (n = 0, m = 0x40; c & m; n++, m >>= 1)
                                c &= ~m;
diff --git a/clients/odbc/driver/ODBCUtil.c b/clients/odbc/driver/ODBCUtil.c
--- a/clients/odbc/driver/ODBCUtil.c
+++ b/clients/odbc/driver/ODBCUtil.c
@@ -90,9 +90,6 @@ static int utf8chkmsk[] = {
        0x7c000000
 };
 
-#define LEAD_OFFSET            (0xD800 - (0x10000 >> 10))
-#define SURROGATE_OFFSET       (0x10000 - (0xD800 << 10) - 0xDC00)
-
 /* Convert a SQLWCHAR (UTF-16 encoded string) to UTF-8.  On success,
    clears the location pointed to by errmsg and returns NULL or a
    newly allocated buffer.  On error, assigns a string with an error
@@ -135,13 +132,7 @@ ODBCwchar2utf8(const SQLWCHAR *s, SQLLEN
                                        *errmsg = "High surrogate not followed 
by low surrogate";
                                return NULL;
                        }
-#if 1
-                       if (errmsg)
-                               *errmsg = "Code points larger than U+FFFF are 
not supported";
-                       return NULL;
-#else
-                       c = (c << 10) + *s1 + SURROGATE_OFFSET;
-#endif
+                       c = (((c & 0x03FF) << 10) | (*s1 & 0x3FF)) + 0x10000;
                } else if (0xDC00 <= c && c <= 0xDFFF) {
                        /* low surrogate--illegal */
                        if (errmsg)
@@ -165,7 +156,7 @@ ODBCwchar2utf8(const SQLWCHAR *s, SQLLEN
                if (0xD800 <= c && c <= 0xDBFF) {
                        /* high surrogate followed by low surrogate */
                        s1++;
-                       c = (c << 10) + *s1 + SURROGATE_OFFSET;
+                       c = (((c & 0x03FF) << 10) | (*s1 & 0x3FF)) + 0x10000;
                }
                for (n = 5; n > 0; n--)
                        if (c & utf8chkmsk[n])
@@ -221,7 +212,7 @@ ODBCutf82wchar(const SQLCHAR *s,
                                ;
                        /* n now is number of 10xxxxxx bytes that
                         * should follow */
-                       if (n == 0 || n >= 6)
+                       if (n == 0 || n >= 4)
                                return "Illegal UTF-8 sequence";
                        if (s + n > e)
                                return "Truncated UTF-8 sequence";
@@ -244,15 +235,18 @@ ODBCutf82wchar(const SQLCHAR *s,
                                *p++ = c;
                        len++;
                } else {
-#if 1
-                       return "Code points larger than U+FFFF are not 
supported";
-#else
+                       /* 0x10000 <= c && c <= 0x10FFFF
+                        * U-00000000000uuuuuxxxxxxxxxxxxxxxx is encoded as
+                        * 110110wwwwxxxxxx 110111xxxxxxxxxx
+                        * where wwww = uuuuu - 1 (note, uuuuu >= 0x1
+                        * and uuuuu <= 0x10) */
                        if ((buflen -= 2) > 0 && p != NULL) {
-                               *p++ = LEAD_OFFSET + (c >> 10);
+                               /* high surrogate */
+                               *p++ = 0xD800 + ((c - 0x10000) >> 10);
+                               /* low surrogate */
                                *p++ = 0xDC00 + (c & 0x3FF);
                        }
                        len += 2;
-#endif
                }
        }
        if (p != NULL)
diff --git a/clients/odbc/driver/README b/clients/odbc/driver/README
--- a/clients/odbc/driver/README
+++ b/clients/odbc/driver/README
@@ -2,6 +2,7 @@ This README describes the implementation
 (sql/src/odbc/driver/*) for the MonetDB SQL frontend (sql/src/common/*)
 Both are available from  https://sourceforge.net/projects/monetdb/
 
+This file is seriously out of date.
 
 Author : Martin van Dinther
 Date   : 30 august 2002
@@ -224,12 +225,12 @@ Most important are:
 - SQLExentedFetch()                    /* fetch multiple rows at once */
 - SQLAllocHandle(SQL_HANDLE_DESC)      /* support descriptor handles */
 - SQLFreeHandle(SQL_HANDLE_DESC)       /* support descriptor handles */
-- all the SQL*W() functions    /* the Unicode (UCS-2) variant API functions */
+- all the SQL*W() functions    /* the Unicode (UTF-16) variant API functions */
 
 When these SQL*W() functions are not implemented in a driver the driver
  manager (it must be ODBC 3.0 or higher) will convert those ODBC application
  SQL*W() calls to the ASCII variant (e.g. SQLConnect(), by converting the
- supplied UCS-2 strings to ASCII.
+ supplied UTF-16 strings to ASCII.
 
 TODO 2) Because MonetDB supports UTF-8 strings we should do the conversion
 and thus implement those functions ourselves.
diff --git a/clients/odbc/driver/SQLParamOptions.c 
b/clients/odbc/driver/SQLParamOptions.c
--- a/clients/odbc/driver/SQLParamOptions.c
+++ b/clients/odbc/driver/SQLParamOptions.c
@@ -51,7 +51,7 @@ SQLParamOptions(SQLHSTMT StatementHandle
 
        /* use mapping as described in ODBC 3 SDK Help file */
        rc = SQLSetStmtAttr_(stmt, SQL_ATTR_PARAMSET_SIZE,
-                            (SQLPOINTER) (size_t) RowNumber, 0);
+                            (SQLPOINTER) (uintptr_t) RowNumber, 0);
 
        if (SQL_SUCCEEDED(rc)) {
                rc = SQLSetStmtAttr_(stmt, SQL_ATTR_PARAMS_PROCESSED_PTR,
diff --git a/clients/odbc/driver/SQLSetConnectAttr.c 
b/clients/odbc/driver/SQLSetConnectAttr.c
--- a/clients/odbc/driver/SQLSetConnectAttr.c
+++ b/clients/odbc/driver/SQLSetConnectAttr.c
@@ -51,10 +51,10 @@ SQLSetConnectAttr_(ODBCDbc *dbc,
 
        switch (Attribute) {
        case SQL_ATTR_AUTOCOMMIT:
-               switch ((SQLUINTEGER) (size_t) ValuePtr) {
+               switch ((SQLUINTEGER) (uintptr_t) ValuePtr) {
                case SQL_AUTOCOMMIT_ON:
                case SQL_AUTOCOMMIT_OFF:
-                       dbc->sql_attr_autocommit = (SQLUINTEGER) (size_t) 
ValuePtr;
+                       dbc->sql_attr_autocommit = (SQLUINTEGER) (uintptr_t) 
ValuePtr;
 #ifdef ODBCDEBUG
                        ODBCLOG("SQLSetConnectAttr set autocommit %s\n",
                                dbc->sql_attr_autocommit == SQL_AUTOCOMMIT_ON ? 
"on" : "off");
@@ -69,10 +69,10 @@ SQLSetConnectAttr_(ODBCDbc *dbc,
                }
                return SQL_SUCCESS;
        case SQL_ATTR_METADATA_ID:
-               switch ((SQLUINTEGER) (size_t) ValuePtr) {
+               switch ((SQLUINTEGER) (uintptr_t) ValuePtr) {
                case SQL_TRUE:
                case SQL_FALSE:
-                       dbc->sql_attr_metadata_id = (SQLUINTEGER) (size_t) 
ValuePtr;
+                       dbc->sql_attr_metadata_id = (SQLUINTEGER) (uintptr_t) 
ValuePtr;
 #ifdef ODBCDEBUG
                        ODBCLOG("SQLSetConnectAttr set metadata_id %s\n",
                                dbc->sql_attr_metadata_id == SQL_TRUE ? "true" 
: "false");
@@ -102,7 +102,7 @@ SQLSetConnectAttr_(ODBCDbc *dbc,
                }
                break;
        case SQL_ATTR_CONNECTION_TIMEOUT:
-               dbc->sql_attr_connection_timeout = (SQLUINTEGER) (size_t) 
ValuePtr;
+               dbc->sql_attr_connection_timeout = (SQLUINTEGER) (uintptr_t) 
ValuePtr;
                if (dbc->mid)
                        mapi_timeout(dbc->mid, dbc->sql_attr_connection_timeout 
* 1000);
                break;
diff --git a/clients/odbc/driver/SQLSetConnectOption.c 
b/clients/odbc/driver/SQLSetConnectOption.c
--- a/clients/odbc/driver/SQLSetConnectOption.c
+++ b/clients/odbc/driver/SQLSetConnectOption.c
@@ -59,18 +59,18 @@ SQLSetConnectOption_(ODBCDbc *dbc,
        case SQL_TXN_ISOLATION:
                /* 32 bit integer argument */
                return SQLSetConnectAttr_(dbc, Option,
-                                         (SQLPOINTER) (size_t) ValuePtr, 0);
+                                         (SQLPOINTER) (uintptr_t) ValuePtr, 0);
        case SQL_QUIET_MODE:
                /* 32/64 bit integer argument */
                return SQLSetConnectAttr_(dbc, Option,
-                                         (SQLPOINTER) (size_t) ValuePtr, 0);
+                                         (SQLPOINTER) (uintptr_t) ValuePtr, 0);
 
        case SQL_CURRENT_QUALIFIER:
        case SQL_OPT_TRACEFILE:
        case SQL_TRANSLATE_DLL:
                /* null terminated string argument */
                return SQLSetConnectAttr_(dbc, Option,
-                                         (SQLPOINTER) (size_t) ValuePtr,
+                                         (SQLPOINTER) (uintptr_t) ValuePtr,
                                          SQL_NTS);
 
        default:
@@ -118,7 +118,7 @@ SQLSetConnectOptionW(SQLHDBC ConnectionH
                     SQLULEN ValuePtr)
 {
        ODBCDbc *dbc = (ODBCDbc *) ConnectionHandle;
-       SQLPOINTER ptr = (SQLPOINTER) (size_t) ValuePtr;
+       SQLPOINTER ptr = (SQLPOINTER) (uintptr_t) ValuePtr;
        SQLULEN p;
        SQLRETURN rc;
 
@@ -137,9 +137,9 @@ SQLSetConnectOptionW(SQLHDBC ConnectionH
        case SQL_ATTR_CURRENT_CATALOG:
        case SQL_ATTR_TRACEFILE:
        case SQL_ATTR_TRANSLATE_LIB:
-               fixWcharIn((SQLPOINTER) (size_t) ValuePtr, SQL_NTS, SQLCHAR,
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to