Changeset: 5d42067b0ac6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5d42067b0ac6
Modified Files:
        clients/ChangeLog
        clients/odbc/driver/SQLTables.c
Branch: default
Log Message:

Use LOCAL/GLOBAL TEMPORARY TABLE instead of LOCAL/GLOBAL TEMPORARY.
This is in line with sys.table_types.


diffs (59 lines):

diff --git a/clients/ChangeLog b/clients/ChangeLog
--- a/clients/ChangeLog
+++ b/clients/ChangeLog
@@ -1,6 +1,11 @@
 # ChangeLog file for clients
 # This file is updated with Maddlog
 
+* Thu Feb  1 2018 Sjoerd Mullender <sjo...@acm.org>
+- ODBC: Changed table types as used by SQLTables from "LOCAL TEMPORARY"
+  and "GLOBAL TEMPORARY" to "LOCAL TEMPORARY TABLE" and "GLOBAL TEMPORARY
+  TABLE" respectively.
+
 * Wed Jan 31 2018 Sjoerd Mullender <sjo...@acm.org>
 - ODBC: Initial support for the HUGEINT type in SQL was added.  Any value
   with type HUGEINT can be retrieved in a C variable with type SQL_C_CHAR
diff --git a/clients/odbc/driver/SQLTables.c b/clients/odbc/driver/SQLTables.c
--- a/clients/odbc/driver/SQLTables.c
+++ b/clients/odbc/driver/SQLTables.c
@@ -106,7 +106,7 @@ MNDBTables(ODBCStmt *stmt,
                query = strdup("select cast(null as varchar(1)) as table_cat, "
                                      "cast(null as varchar(1)) as table_schem, 
"
                                      "cast(null as varchar(1)) as table_name, "
-                                     "replace(table_type_name, 'TEMPORARY 
TABLE', 'TEMPORARY') as table_type, "
+                                     "table_type_name as table_type, "
                                      "cast(null as varchar(1)) as remarks "
                               "from sys.table_types order by table_type");
        } else {
@@ -169,7 +169,7 @@ MNDBTables(ODBCStmt *stmt,
                       "select e.value as table_cat, "
                              "s.name as table_schem, "
                              "t.name as table_name, "
-                             "replace(tt.table_type_name, 'TEMPORARY TABLE', 
'TEMPORARY') as table_type, "
+                             "tt.table_type_name as table_type, "
                              "cast(null as varchar(1)) as remarks "
                       "from sys.schemas s, "
                            "sys.tables t, "
@@ -206,7 +206,7 @@ MNDBTables(ODBCStmt *stmt,
 
                if (NameLength4 > 0) {
                        /* filtering requested on table type */
-                       char buf[17];   /* the longest string is "GLOBAL 
TEMPORARY" */
+                       char buf[32];   /* the longest string is "GLOBAL 
TEMPORARY TABLE" */
                        int i;
                        size_t j;
 
@@ -221,12 +221,7 @@ MNDBTables(ODBCStmt *stmt,
                                                continue;
                                        }
                                        buf[j] = 0;
-                                       if (strcmp(buf, "GLOBAL TEMPORARY") == 
0 ||
-                                           strcmp(buf, "LOCAL TEMPORARY") == 
0) {
-                                               query_end += 
snprintf(query_end, 38, "'%s TABLE',", buf);
-                                       } else {
-                                               query_end += 
snprintf(query_end, 38, "'%s',", buf);
-                                       }
+                                       query_end += snprintf(query_end, 38, 
"'%s',", buf);
                                        j = 0;
                                } else if (j < sizeof(buf) &&
                                           TableType[i] != '\'' &&
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to