Changeset: 36cddfb03491 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=36cddfb03491
Modified Files:
        clients/Tests/SQL-dump.stable.out
        clients/Tests/SQL-dump.stable.out.int128
        clients/odbc/driver/SQLTables.c
        java/src/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
        sql/backends/monet5/sql_upgrades.c
        sql/jdbc/tests/Tests/Test_Dobjects.stable.out
        sql/server/sql_mvc.c
        
sql/test/BugDay_2005-11-09_2.8/Tests/ORDER_BY_evaluation_error.SF-1023658.stable.out
        
sql/test/BugDay_2005-12-19_2.9.3/Tests/weird_reponse_on_limit.SF-1314643.stable.out
        sql/test/BugTracker-2009/Tests/join_topn.SF-2654133.stable.out
        
sql/test/BugTracker-2010/Tests/offset_limited_32bit.SF-2950579.stable.out
        
sql/test/BugTracker-2010/Tests/offset_limited_32bit.SF-2950579.stable.out.oid32
        sql/test/BugTracker-2011/Tests/sqltables.Bug-2921.sql
        sql/test/BugTracker-2011/Tests/sqltables.Bug-2921.stable.out
        sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out
        sql/test/BugTracker/Tests/like_exp.SF-1613949.stable.out
        sql/test/Dependencies/Tests/Dependencies.stable.out
        sql/test/Dependencies/Tests/Dependencies.stable.out.int128
        sql/test/Dependencies/dependency_DBobjects.sql
        sql/test/bugs/Tests/groupby_having-bug-sf-947600.stable.err
        sql/test/bugs/Tests/groupby_having-bug-sf-947600.stable.out
        sql/test/bugs/Tests/select_orderby_alias-bug-sf-1024615.stable.out
        sql/test/bugs/Tests/subselect_ambigious_columns-bug-sf-949071.stable.out
        sql/test/bugs/groupby_having-bug-sf-947600.sql
        sql/test/bugs/subselect_ambigious_columns-bug-sf-949071.sql
        sql/test/mapi/Tests/php_monetdb.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
        sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
        sql/test/testdb-upgrade/Tests/upgrade.stable.out
        sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
Branch: Jul2015
Log Message:

Changing the system view: sys.tables. Removing the previously added column 
table_type (work in progress) and includes the logic to determine the table 
type in the existing "type" column.
This is better than having two columns: type and table_type and eliminates 
confusion.
I choose to keep the type column name (instead of table_type) to have as 
minimal impact on programs/queries that may use this dictionary table.
(grafted from 4f422ce4c8182ed25dbefc51e21805a4cdc55692)


diffs (truncated from 694 to 300 lines):

diff --git a/clients/Tests/SQL-dump.stable.out 
b/clients/Tests/SQL-dump.stable.out
--- a/clients/Tests/SQL-dump.stable.out
+++ b/clients/Tests/SQL-dump.stable.out
@@ -451,7 +451,7 @@ create view sys.queue as select * from s
 create view sys.sessions as select * from sys.sessions();
 create view sys."storage" as select * from sys."storage"();
 create view sys.storagemodel as select * from sys.storagemodel();
-SELECT * FROM (SELECT p.*, 0 AS "temporary", CAST(CASE WHEN system THEN type + 
10 /* system table/view */ ELSE (CASE WHEN commit_action = 0 THEN type /* 
table/view */ ELSE type + 20 /* global temp table */ END) END AS SMALLINT) AS 
table_type FROM "sys"."_tables" AS p UNION ALL SELECT t.*, 1 AS "temporary", 
CAST(type + 30 /* local temp table */ AS SMALLINT) AS table_type FROM 
"tmp"."_tables" AS t) AS tables where tables.type <> 2;
+SELECT "id", "name", "schema_id", "query", CAST(CASE WHEN "system" THEN "type" 
+ 10 /* system table/view */ ELSE (CASE WHEN "commit_action" = 0 THEN "type" /* 
table/view */ ELSE "type" + 20 /* global temp table */ END) END AS SMALLINT) AS 
"type", "system", "commit_action", "access", CASE WHEN (NOT "system" AND 
"commit_action" > 0) THEN 1 ELSE 0 END AS "temporary" FROM "sys"."_tables" 
WHERE "type" <> 2 UNION ALL SELECT "id", "name", "schema_id", "query", 
CAST("type" + 30 /* local temp table */ AS SMALLINT) AS "type", "system", 
"commit_action", "access", 1 AS "temporary" FROM "tmp"."_tables";
 -- A summary of the table storage requirement is is available as a table view.
 -- The auxiliary column denotes the maximum space if all non-sorted columns
 -- would be augmented with a hash (rare situation)
@@ -1338,7 +1338,7 @@ CREATE TABLE "sys"."_columns" (
        "number"      INTEGER,
        "storage"     VARCHAR(2048)
 );
-COPY 362 RECORDS INTO "sys"."_columns" FROM stdin USING DELIMITERS 
'\t','\n','"';
+COPY 361 RECORDS INTO "sys"."_columns" FROM stdin USING DELIMITERS 
'\t','\n','"';
 2002   "id"    "int"   32      0       2001    NULL    true    0       NULL
 2003   "name"  "varchar"       1024    0       2001    NULL    true    1       
NULL
 2004   "authorization" "int"   32      0       2001    NULL    true    2       
NULL
@@ -1481,7 +1481,6 @@ 5212      "system"        "boolean"       1       0       
5206    NULL    tr
 5213   "commit_action" "smallint"      16      0       5206    NULL    true    
6       NULL
 5214   "access"        "smallint"      16      0       5206    NULL    true    
7       NULL
 5215   "temporary"     "smallint"      16      0       5206    NULL    true    
8       NULL
-5216   "table_type"    "smallint"      16      0       5206    NULL    true    
9       NULL
 5218   "id"    "int"   32      0       5217    NULL    true    0       NULL
 5219   "name"  "varchar"       1024    0       5217    NULL    true    1       
NULL
 5220   "type"  "varchar"       1024    0       5217    NULL    true    2       
NULL
@@ -1733,7 +1732,7 @@ 2127      "keys"  2106    NULL    0       true    2       0
 2134   "idxs"  2106    NULL    0       true    2       0
 2139   "triggers"      2106    NULL    0       true    2       0
 2150   "objects"       2106    NULL    0       true    2       0
-5206   "tables"        2000    "SELECT * FROM (SELECT p.*, 0 AS ""temporary"", 
CAST(CASE WHEN system THEN type + 10 /* system table/view */ ELSE (CASE WHEN 
commit_action = 0 THEN type /* table/view */ ELSE type + 20 /* global temp 
table */ END) END AS SMALLINT) AS table_type FROM ""sys"".""_tables"" AS p 
UNION ALL SELECT t.*, 1 AS ""temporary"", CAST(type + 30 /* local temp table */ 
AS SMALLINT) AS table_type FROM ""tmp"".""_tables"" AS t) AS tables where 
tables.type <> 2;" 1       true    0       0
+5206   "tables"        2000    "SELECT "id", "name", "schema_id", "query", 
CAST(CASE WHEN "system" THEN "type" + 10 /* system table/view */ ELSE (CASE 
WHEN "commit_action" = 0 THEN "type" /* table/view */ ELSE "type" + 20 /* 
global temp table */ END) END AS SMALLINT) AS "type", "system", 
"commit_action", "access", CASE WHEN (NOT "system" AND "commit_action" > 0) 
THEN 1 ELSE 0 END AS "temporary" FROM "sys"."_tables" WHERE "type" <> 2 UNION 
ALL SELECT "id", "name", "schema_id", "query", CAST("type" + 30 /* local temp 
table */ AS SMALLINT) AS "type", "system", "commit_action", "access", 1 AS 
"temporary" FROM "tmp"."_tables";" 1       true    0       0
 5217   "columns"       2000    "SELECT * FROM (SELECT p.* FROM 
""sys"".""_columns"" AS p UNION ALL SELECT t.* FROM ""tmp"".""_columns"" AS t) 
AS columns;"     1       true    0       0
 5233   "db_user_info"  2000    NULL    0       true    0       0
 5239   "users" 2000    "SELECT u.""name"" AS ""name"", ui.""fullname"", 
ui.""default_schema"" FROM db_users() AS u LEFT JOIN ""sys"".""db_user_info"" 
AS ui ON u.""name"" = ui.""name"" ;"     1       true    0       0
diff --git a/clients/Tests/SQL-dump.stable.out.int128 
b/clients/Tests/SQL-dump.stable.out.int128
--- a/clients/Tests/SQL-dump.stable.out.int128
+++ b/clients/Tests/SQL-dump.stable.out.int128
@@ -447,7 +447,7 @@ create view sys.queue as select * from s
 create view sys.sessions as select * from sys.sessions();
 create view sys."storage" as select * from sys."storage"();
 create view sys.storagemodel as select * from sys.storagemodel();
-SELECT * FROM (SELECT p.*, 0 AS "temporary", CAST(CASE WHEN system THEN type + 
10 /* system table/view */ ELSE (CASE WHEN commit_action = 0 THEN type /* 
table/view */ ELSE type + 20 /* global temp table */ END) END AS SMALLINT) AS 
table_type FROM "sys"."_tables" AS p UNION ALL SELECT t.*, 1 AS "temporary", 
CAST(type + 30 /* local temp table */ AS SMALLINT) AS table_type FROM 
"tmp"."_tables" AS t) AS tables where tables.type <> 2;
+SELECT "id", "name", "schema_id", "query", CAST(CASE WHEN "system" THEN "type" 
+ 10 /* system table/view */ ELSE (CASE WHEN "commit_action" = 0 THEN "type" /* 
table/view */ ELSE "type" + 20 /* global temp table */ END) END AS SMALLINT) AS 
"type", "system", "commit_action", "access", CASE WHEN (NOT "system" AND 
"commit_action" > 0) THEN 1 ELSE 0 END AS "temporary" FROM "sys"."_tables" 
WHERE "type" <> 2 UNION ALL SELECT "id", "name", "schema_id", "query", 
CAST("type" + 30 /* local temp table */ AS SMALLINT) AS "type", "system", 
"commit_action", "access", 1 AS "temporary" FROM "tmp"."_tables";
 -- A summary of the table storage requirement is is available as a table view.
 -- The auxiliary column denotes the maximum space if all non-sorted columns
 -- would be augmented with a hash (rare situation)
@@ -1379,7 +1379,7 @@ CREATE TABLE "sys"."_columns" (
        "number"      INTEGER,
        "storage"     VARCHAR(2048)
 );
-COPY 362 RECORDS INTO "sys"."_columns" FROM stdin USING DELIMITERS 
'\t','\n','"';
+COPY 361 RECORDS INTO "sys"."_columns" FROM stdin USING DELIMITERS 
'\t','\n','"';
 2002   "id"    "int"   32      0       2001    NULL    true    0       NULL
 2003   "name"  "varchar"       1024    0       2001    NULL    true    1       
NULL
 2004   "authorization" "int"   32      0       2001    NULL    true    2       
NULL
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
@@ -218,18 +218,22 @@ MNDBTables(ODBCStmt *stmt,
                                        "t.temporary = 0 and "
                                        "s.name <> 'tmp' "
                                   "then cast('TABLE' as varchar(20)) "
-                                  "when t.type = 0 and "
+                                  "when t.type = 20 and "
                                        "t.system = false and "
-                                       "t.temporary = 0 and "
+                                       "t.temporary = 1 and "
                                        "s.name = 'tmp' "
                                   "then cast('GLOBAL TEMPORARY' as 
varchar(20)) "
-                                  "when t.type = 0 and "
+                                  "when t.type = 10 and "
                                        "t.system = true and "
                                        "t.temporary = 0 "
                                   "then cast('SYSTEM TABLE' as varchar(20)) "
+                                  "when t.type = 11 and "
+                                       "t.system = true and "
+                                       "t.temporary = 0 "
+                                  "then cast('SYSTEM VIEW' as varchar(20)) "
                                   "when t.type = 1 "
                                   "then cast('VIEW' as varchar(20)) "
-                                  "when t.type = 0 and "
+                                  "when t.type = 30 and "
                                        "t.system = false and "
                                        "t.temporary = 1 "
                                   "then cast('LOCAL TEMPORARY' as varchar(20)) 
"
@@ -290,13 +294,16 @@ MNDBTables(ODBCStmt *stmt,
                                                       "(t.type = 0 and 
t.system = false and t.temporary = 0 and s.name <> 'tmp') or ");
                                        } else if (strcmp(buf, "GLOBAL 
TEMPORARY") == 0) {
                                                strcpy(query_end,
-                                                      "(t.type = 0 and 
t.system = false and t.temporary = 0 and s.name = 'tmp') or ");
+                                                      "(t.type = 20 and 
t.system = false and t.temporary = 1 and s.name = 'tmp') or ");
                                        } else if (strcmp(buf, "SYSTEM TABLE") 
== 0) {
                                                strcpy(query_end,
-                                                      "(t.type = 0 and 
t.system = true and t.temporary = 0) or ");
+                                                      "(t.type = 10 and 
t.system = true and t.temporary = 0) or ");
+                                       } else if (strcmp(buf, "SYSTEM VIEW") 
== 0) {
+                                               strcpy(query_end,
+                                                      "(t.type = 11 and 
t.system = true and t.temporary = 0) or ");
                                        } else if (strcmp(buf, "LOCAL 
TEMPORARY") == 0) {
                                                strcpy(query_end,
-                                                      "(t.type = 0 and 
t.system = false and t.temporary = 1) or ");
+                                                      "(t.type = 30 and 
t.system = false and t.temporary = 1) or ");
                                        }
                                        query_end += strlen(query_end);
                                        j = 0;
diff --git a/java/src/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java 
b/java/src/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
--- a/java/src/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
+++ b/java/src/nl/cwi/monetdb/jdbc/MonetDatabaseMetaData.java
@@ -1579,14 +1579,14 @@ public class MonetDatabaseMetaData exten
                select =
                        "SELECT * FROM ( " +
                        "SELECT '" + cat + "' AS \"TABLE_CAT\", 
\"schemas\".\"name\" AS \"TABLE_SCHEM\", \"tables\".\"name\" AS \"TABLE_NAME\", 
" +
-                               "CASE WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 0 AND \"tables\".\"temporary\" = 0 THEN 'SYSTEM TABLE' " +
-                               "WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 1 AND \"tables\".\"temporary\" = 0 THEN 'SYSTEM VIEW' " +
+                               "CASE WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 10 AND \"tables\".\"temporary\" = 0 THEN 'SYSTEM TABLE' " 
+
+                               "WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 11 AND \"tables\".\"temporary\" = 0 THEN 'SYSTEM VIEW' " +
                                "WHEN \"tables\".\"system\" = false AND 
\"tables\".\"type\" = 0 AND \"tables\".\"temporary\" = 0 THEN 'TABLE' " +
                                "WHEN \"tables\".\"system\" = false AND 
\"tables\".\"type\" = 1 AND \"tables\".\"temporary\" = 0 THEN 'VIEW' " +
-                               "WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 0 AND \"tables\".\"temporary\" = 1 THEN 'SYSTEM SESSION 
TABLE' " +
-                               "WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 1 AND \"tables\".\"temporary\" = 1 THEN 'SYSTEM SESSION 
VIEW' " +
-                               "WHEN \"tables\".\"system\" = false AND 
\"tables\".\"type\" = 0 AND \"tables\".\"temporary\" = 1 THEN 'SESSION TABLE' " 
+
-                               "WHEN \"tables\".\"system\" = false AND 
\"tables\".\"type\" = 1 AND \"tables\".\"temporary\" = 1 THEN 'SESSION VIEW' " +
+                               "WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 20 AND \"tables\".\"temporary\" = 1 THEN 'SYSTEM SESSION 
TABLE' " +
+                               "WHEN \"tables\".\"system\" = true AND 
\"tables\".\"type\" = 21 AND \"tables\".\"temporary\" = 1 THEN 'SYSTEM SESSION 
VIEW' " +
+                               "WHEN \"tables\".\"system\" = false AND 
\"tables\".\"type\" = 30 AND \"tables\".\"temporary\" = 1 THEN 'SESSION TABLE' 
" +
+                               "WHEN \"tables\".\"system\" = false AND 
\"tables\".\"type\" = 31 AND \"tables\".\"temporary\" = 1 THEN 'SESSION VIEW' " 
+
                                "END AS \"TABLE_TYPE\", \"tables\".\"query\" AS 
\"REMARKS\", null AS \"TYPE_CAT\", null AS \"TYPE_SCHEM\", " +
                                "null AS \"TYPE_NAME\", 'rowid' AS 
\"SELF_REFERENCING_COL_NAME\", 'SYSTEM' AS \"REF_GENERATION\" " +
                        "FROM \"sys\".\"tables\" AS \"tables\", 
\"sys\".\"schemas\" AS \"schemas\" WHERE \"tables\".\"schema_id\" = 
\"schemas\".\"id\" " +
diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -1336,7 +1336,7 @@ sql_update_jul2015(Client c)
                        "  (1, 'SCHEMA'), (2, 'TABLE'), (3, 'COLUMN'), (4, 
'KEY'), (5, 'VIEW'), (6, 'USER'), (7, 'FUNCTION'), (8, 'TRIGGER'),\n"
                        "  (9, 'OWNER'), (10, 'INDEX'), (11, 'FKEY'), (12, 
'SEQUENCE'), (13, 'PROCEDURE'), (14, 'BE_DROPPED');\n"
                        "drop view sys.tables;\n"
-                       "create view sys.tables as SELECT * FROM (SELECT p.*, 0 
AS \"temporary\", CAST(CASE WHEN system THEN type + 10 /* system table/view */ 
ELSE (CASE WHEN commit_action = 0 THEN type /* table/view */ ELSE type + 20 /* 
global temp table */ END) END AS SMALLINT) AS table_type FROM 
\"sys\".\"_tables\" AS p UNION ALL SELECT t.*, 1 AS \"temporary\", CAST(type + 
30 /* local temp table */ AS SMALLINT) AS table_type FROM \"tmp\".\"_tables\" 
AS t) AS tables where tables.type <> 2;\n");
+                       "create view sys.tables as SELECT \"id\", \"name\", 
\"schema_id\", \"query\", CAST(CASE WHEN \"system\" THEN \"type\" + 10 /* 
system table/view */ ELSE (CASE WHEN \"commit_action\" = 0 THEN \"type\" /* 
table/view */ ELSE \"type\" + 20 /* global temp table */ END) END AS SMALLINT) 
AS \"type\", \"system\", \"commit_action\", \"access\", CASE WHEN (NOT 
\"system\" AND \"commit_action\" > 0) THEN 1 ELSE 0 END AS \"temporary\" FROM 
\"sys\".\"_tables\" WHERE \"type\" <> 2 UNION ALL SELECT \"id\", \"name\", 
\"schema_id\", \"query\", CAST(\"type\" + 30 /* local temp table */ AS 
SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", 1 AS 
\"temporary\" FROM \"tmp\".\"_tables\";\n");
 
        /* change to 75_storagemodel */
        pos += snprintf(buf + pos, bufsize - pos,
diff --git a/sql/jdbc/tests/Tests/Test_Dobjects.stable.out 
b/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
--- a/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
+++ b/sql/jdbc/tests/Tests/Test_Dobjects.stable.out
@@ -122,7 +122,7 @@ mTests_sql_jdbc_tests       sys     rejects SYSTEM
 mTests_sql_jdbc_tests  sys     sessions        SYSTEM VIEW     create view 
sys.sessions as select * from sys.sessions();       null    null    null    
rowid   SYSTEM  
 mTests_sql_jdbc_tests  sys     storage SYSTEM VIEW     create view 
sys."storage" as select * from sys."storage"();     null    null    null    
rowid   SYSTEM  
 mTests_sql_jdbc_tests  sys     storagemodel    SYSTEM VIEW     create view 
sys.storagemodel as select * from sys.storagemodel();       null    null    
null    rowid   SYSTEM  
-mTests_sql_jdbc_tests  sys     tables  SYSTEM VIEW     SELECT * FROM (SELECT 
p.*, 0 AS "temporary", CAST(CASE WHEN system THEN type + 10 /* system 
table/view */ ELSE (CASE WHEN commit_action = 0 THEN type /* table/view */ ELSE 
type + 20 /* global temp table */ END) END AS SMALLINT) AS table_type FROM 
"sys"."_tables" AS p UNION ALL SELECT t.*, 1 AS "temporary", CAST(type + 30 /* 
local temp table */ AS SMALLINT) AS table_type FROM "tmp"."_tables" AS t) AS 
tables where tables.type <> 2;       null    null    null    rowid   SYSTEM  
+mTests_sql_jdbc_tests  sys     tables  SYSTEM VIEW     SELECT "id", "name", 
"schema_id", "query", CAST(CASE WHEN "system" THEN "type" + 10 /* system 
table/view */ ELSE (CASE WHEN "commit_action" = 0 THEN "type" /* table/view */ 
ELSE "type" + 20 /* global temp table */ END) END AS SMALLINT) AS "type", 
"system", "commit_action", "access", CASE WHEN (NOT "system" AND 
"commit_action" > 0) THEN 1 ELSE 0 END AS "temporary" FROM "sys"."_tables" 
WHERE "type" <> 2 UNION ALL SELECT "id", "name", "schema_id", "query", 
CAST("type" + 30 /* local temp table */ AS SMALLINT) AS "type", "system", 
"commit_action", "access", 1 AS "temporary" FROM "tmp"."_tables";   null    
null    null    rowid   SYSTEM  
 mTests_sql_jdbc_tests  sys     tablestoragemodel       SYSTEM VIEW     -- A 
summary of the table storage requirement is is available as a table view.
 -- The auxiliary column denotes the maximum space if all non-sorted columns
 -- would be augmented with a hash (rare situation)
diff --git a/sql/server/sql_mvc.c b/sql/server/sql_mvc.c
--- a/sql/server/sql_mvc.c
+++ b/sql/server/sql_mvc.c
@@ -61,7 +61,7 @@ mvc_init(int debug, store_type store, in
                        mvc_drop_table(m, s, t, 0);
                }
 
-               t = mvc_create_view(m, s, "tables", SQL_PERSIST, "SELECT * FROM 
(SELECT p.*, 0 AS \"temporary\", CAST(CASE WHEN system THEN type + 10 /* system 
table/view */ ELSE (CASE WHEN commit_action = 0 THEN type /* table/view */ ELSE 
type + 20 /* global temp table */ END) END AS SMALLINT) AS table_type FROM 
\"sys\".\"_tables\" AS p UNION ALL SELECT t.*, 1 AS \"temporary\", CAST(type + 
30 /* local temp table */ AS SMALLINT) AS table_type FROM \"tmp\".\"_tables\" 
AS t) AS tables where tables.type <> 2;", 1);
+               t = mvc_create_view(m, s, "tables", SQL_PERSIST, "SELECT 
\"id\", \"name\", \"schema_id\", \"query\", CAST(CASE WHEN \"system\" THEN 
\"type\" + 10 /* system table/view */ ELSE (CASE WHEN \"commit_action\" = 0 
THEN \"type\" /* table/view */ ELSE \"type\" + 20 /* global temp table */ END) 
END AS SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", CASE 
WHEN (NOT \"system\" AND \"commit_action\" > 0) THEN 1 ELSE 0 END AS 
\"temporary\" FROM \"sys\".\"_tables\" WHERE \"type\" <> 2 UNION ALL SELECT 
\"id\", \"name\", \"schema_id\", \"query\", CAST(\"type\" + 30 /* local temp 
table */ AS SMALLINT) AS \"type\", \"system\", \"commit_action\", \"access\", 1 
AS \"temporary\" FROM \"tmp\".\"_tables\";", 1);
                mvc_create_column_(m, t, "id", "int", 32);
                mvc_create_column_(m, t, "name", "varchar", 1024);
                mvc_create_column_(m, t, "schema_id", "int", 32);
@@ -71,7 +71,6 @@ mvc_init(int debug, store_type store, in
                mvc_create_column_(m, t, "commit_action", "smallint", 16);
                mvc_create_column_(m, t, "access", "smallint", 16);
                mvc_create_column_(m, t, "temporary", "smallint", 16);
-               mvc_create_column_(m, t, "table_type", "smallint", 16);
 
                if (!first) {
                        int pub = ROLE_PUBLIC;
diff --git 
a/sql/test/BugDay_2005-11-09_2.8/Tests/ORDER_BY_evaluation_error.SF-1023658.stable.out
 
b/sql/test/BugDay_2005-11-09_2.8/Tests/ORDER_BY_evaluation_error.SF-1023658.stable.out
--- 
a/sql/test/BugDay_2005-11-09_2.8/Tests/ORDER_BY_evaluation_error.SF-1023658.stable.out
+++ 
b/sql/test/BugDay_2005-11-09_2.8/Tests/ORDER_BY_evaluation_error.SF-1023658.stable.out
@@ -31,10 +31,10 @@ Ready.
 #  AND "tables"."schema_id" = "schemas"."id"
 #  AND "tables"."system" = FALSE
 #  AND "keys"."type" = 0;
-% .keys,       .keys,  .keys,  .keys,  .keys,  .keys,  .objects,       
.objects,       .objects,       .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .schemas,       .schemas,       .schemas,       
.schemas,       .schemas # table_name
-% id,  table_id,       type,   name,   rkey,   action, id,     name,   nr,     
id,     name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      table_type,     id,     name,   authorization,  owner,  system 
# name
-% int, int,    int,    varchar,        int,    int,    int,    varchar,        
int,    int,    varchar,        int,    varchar,        smallint,       
boolean,        smallint,       smallint,       tinyint,        smallint,       
int,    varchar,        int,    int,    boolean # type
-% 1,   1,      1,      0,      1,      1,      1,      0,      1,      1,      
0,      1,      0,      1,      5,      1,      1,      1,      1,      1,      
0,      1,      1,      5 # length
+% .keys,       .keys,  .keys,  .keys,  .keys,  .keys,  .objects,       
.objects,       .objects,       .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .tables,        
.tables,        .schemas,       .schemas,       .schemas,       .schemas,       
.schemas # table_name
+% id,  table_id,       type,   name,   rkey,   action, id,     name,   nr,     
id,     name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      id,     name,   authorization,  owner,  system # name
+% int, int,    int,    varchar,        int,    int,    int,    varchar,        
int,    int,    varchar,        int,    varchar,        smallint,       
boolean,        smallint,       smallint,       tinyint,        int,    
varchar,        int,    int,    boolean # type
+% 1,   1,      1,      0,      1,      1,      1,      0,      1,      1,      
0,      1,      0,      1,      5,      1,      1,      1,      1,      0,      
1,      1,      5 # length
 #SELECT *
 #FROM "keys", "objects", "tables", "schemas"
 #WHERE "keys"."id" = "objects"."id"
@@ -43,10 +43,10 @@ Ready.
 #  AND "tables"."system" = FALSE
 #  AND "keys"."type" = 0
 #ORDER BY "objects"."name";
-% .keys,       .keys,  .keys,  .keys,  .keys,  .keys,  .objects,       
.objects,       .objects,       .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .schemas,       .schemas,       .schemas,       
.schemas,       .schemas # table_name
-% id,  table_id,       type,   name,   rkey,   action, id,     name,   nr,     
id,     name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      table_type,     id,     name,   authorization,  owner,  system 
# name
-% int, int,    int,    varchar,        int,    int,    int,    varchar,        
int,    int,    varchar,        int,    varchar,        smallint,       
boolean,        smallint,       smallint,       tinyint,        smallint,       
int,    varchar,        int,    int,    boolean # type
-% 1,   1,      1,      0,      1,      1,      1,      0,      1,      1,      
0,      1,      0,      1,      5,      1,      1,      1,      1,      1,      
0,      1,      1,      5 # length
+% .keys,       .keys,  .keys,  .keys,  .keys,  .keys,  .objects,       
.objects,       .objects,       .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .tables,        
.tables,        .schemas,       .schemas,       .schemas,       .schemas,       
.schemas # table_name
+% id,  table_id,       type,   name,   rkey,   action, id,     name,   nr,     
id,     name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      id,     name,   authorization,  owner,  system # name
+% int, int,    int,    varchar,        int,    int,    int,    varchar,        
int,    int,    varchar,        int,    varchar,        smallint,       
boolean,        smallint,       smallint,       tinyint,        int,    
varchar,        int,    int,    boolean # type
+% 1,   1,      1,      0,      1,      1,      1,      0,      1,      1,      
0,      1,      0,      1,      5,      1,      1,      1,      1,      0,      
1,      1,      5 # length
 
 # 10:35:10 >  
 # 10:35:10 >  "Done."
diff --git 
a/sql/test/BugDay_2005-12-19_2.9.3/Tests/weird_reponse_on_limit.SF-1314643.stable.out
 
b/sql/test/BugDay_2005-12-19_2.9.3/Tests/weird_reponse_on_limit.SF-1314643.stable.out
--- 
a/sql/test/BugDay_2005-12-19_2.9.3/Tests/weird_reponse_on_limit.SF-1314643.stable.out
+++ 
b/sql/test/BugDay_2005-12-19_2.9.3/Tests/weird_reponse_on_limit.SF-1314643.stable.out
@@ -24,17 +24,19 @@ Ready.
 # 11:51:19 >  Mtimeout -timeout 60 MapiClient -lsql -umonetdb -Pmonetdb 
--host=localhost --port=35781  < weird_reponse_on_limit.SF-1314643.sql
 # 11:51:19 >  
 
+#select name, query, "type", system, commit_action, "temporary" from tables 
limit 1;
 % .tables,     .tables,        .tables,        .tables,        .tables,        
.tables # table_name
 % name,        query,  type,   system, commit_action,  temporary # name
 % varchar,     varchar,        smallint,       boolean,        smallint,       
tinyint # type
-% 7,   0,      1,      5,      1,      1 # length
-[ "schemas",   NULL,   0,      true,   0,      0       ]
+% 7,   0,      2,      5,      1,      1 # length
+[ "schemas",   NULL,   10,     true,   0,      0       ]
+#select name, query, "type", system, commit_action, "temporary" from tables 
limit 2;
 % .tables,     .tables,        .tables,        .tables,        .tables,        
.tables # table_name
 % name,        query,  type,   system, commit_action,  temporary # name
 % varchar,     varchar,        smallint,       boolean,        smallint,       
tinyint # type
-% 7,   0,      1,      5,      1,      1 # length
-[ "schemas",   NULL,   0,      true,   0,      0       ]
-[ "types",     NULL,   0,      true,   0,      0       ]
+% 7,   0,      2,      5,      1,      1 # length
+[ "schemas",   NULL,   10,     true,   0,      0       ]
+[ "types",     NULL,   10,     true,   0,      0       ]
 
 # 20:30:00 >  
 # 20:30:00 >  Done.
diff --git a/sql/test/BugTracker-2009/Tests/join_topn.SF-2654133.stable.out 
b/sql/test/BugTracker-2009/Tests/join_topn.SF-2654133.stable.out
--- a/sql/test/BugTracker-2009/Tests/join_topn.SF-2654133.stable.out
+++ b/sql/test/BugTracker-2009/Tests/join_topn.SF-2654133.stable.out
@@ -28,20 +28,20 @@ Ready.
 [ 1    ]
 [ 1    ]
 #select * from tables, x limit 10;
-% .tables,     .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .tables,        
.x,     .x # table_name
-% id,  name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      table_type,     n,      s # name
-% int, varchar,        int,    varchar,        smallint,       boolean,        
smallint,       smallint,       tinyint,        smallint,       int,    varchar 
# type
-% 4,   9,      4,      0,      1,      5,      1,      1,      1,      2,      
1,      5 # length
-[ 2001,        "schemas",      2000,   NULL,   0,      true,   0,      0,      
0,      10,     1,      "one"   ]
-[ 2001,        "schemas",      2000,   NULL,   0,      true,   0,      0,      
0,      10,     2,      "two"   ]
-[ 2001,        "schemas",      2000,   NULL,   0,      true,   0,      0,      
0,      10,     3,      "three" ]
-[ 2007,        "types",        2000,   NULL,   0,      true,   0,      0,      
0,      10,     1,      "one"   ]
-[ 2007,        "types",        2000,   NULL,   0,      true,   0,      0,      
0,      10,     2,      "two"   ]
-[ 2007,        "types",        2000,   NULL,   0,      true,   0,      0,      
0,      10,     3,      "three" ]
-[ 2016,        "functions",    2000,   NULL,   0,      true,   0,      0,      
0,      10,     1,      "one"   ]
-[ 2016,        "functions",    2000,   NULL,   0,      true,   0,      0,      
0,      10,     2,      "two"   ]
-[ 2016,        "functions",    2000,   NULL,   0,      true,   0,      0,      
0,      10,     3,      "three" ]
-[ 2027,        "args", 2000,   NULL,   0,      true,   0,      0,      0,      
10,     1,      "one"   ]
+% .tables,     .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .x,     .x # 
table_name
+% id,  name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      n,      s # name
+% int, varchar,        int,    varchar,        smallint,       boolean,        
smallint,       smallint,       tinyint,        int,    varchar # type
+% 4,   9,      4,      0,      2,      5,      1,      1,      1,      1,      
5 # length
+[ 2001,        "schemas",      2000,   NULL,   10,     true,   0,      0,      
0,      1,      "one"   ]
+[ 2001,        "schemas",      2000,   NULL,   10,     true,   0,      0,      
0,      2,      "two"   ]
+[ 2001,        "schemas",      2000,   NULL,   10,     true,   0,      0,      
0,      3,      "three" ]
+[ 2007,        "types",        2000,   NULL,   10,     true,   0,      0,      
0,      1,      "one"   ]
+[ 2007,        "types",        2000,   NULL,   10,     true,   0,      0,      
0,      2,      "two"   ]
+[ 2007,        "types",        2000,   NULL,   10,     true,   0,      0,      
0,      3,      "three" ]
+[ 2016,        "functions",    2000,   NULL,   10,     true,   0,      0,      
0,      1,      "one"   ]
+[ 2016,        "functions",    2000,   NULL,   10,     true,   0,      0,      
0,      2,      "two"   ]
+[ 2016,        "functions",    2000,   NULL,   10,     true,   0,      0,      
0,      3,      "three" ]
+[ 2027,        "args", 2000,   NULL,   10,     true,   0,      0,      0,      
1,      "one"   ]
 #drop table x cascade;
 
 # 19:39:26 >  
diff --git 
a/sql/test/BugTracker-2010/Tests/offset_limited_32bit.SF-2950579.stable.out 
b/sql/test/BugTracker-2010/Tests/offset_limited_32bit.SF-2950579.stable.out
--- a/sql/test/BugTracker-2010/Tests/offset_limited_32bit.SF-2950579.stable.out
+++ b/sql/test/BugTracker-2010/Tests/offset_limited_32bit.SF-2950579.stable.out
@@ -26,15 +26,15 @@ Ready.
 # 09:37:07 >  
 
 #SELECT * from tables OFFSET 2147483647; -- never finishes
-% .tables,     .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .tables # 
table_name
-% id,  name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      table_type # name
-% int, varchar,        int,    varchar,        smallint,       boolean,        
smallint,       smallint,       tinyint,        smallint # type
-% 1,   0,      1,      0,      1,      5,      1,      1,      1,      1 # 
length
+% .tables,     .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables # table_name
+% id,  name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary # name
+% int, varchar,        int,    varchar,        smallint,       boolean,        
smallint,       smallint,       tinyint # type
+% 1,   0,      1,      0,      1,      5,      1,      1,      1 # length
 #SELECT * from tables OFFSET 2147483646; -- returns instantly
-% .tables,     .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables,        .tables # 
table_name
-% id,  name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary,      table_type # name
-% int, varchar,        int,    varchar,        smallint,       boolean,        
smallint,       smallint,       tinyint,        smallint # type
-% 1,   0,      1,      0,      1,      5,      1,      1,      1,      1 # 
length
+% .tables,     .tables,        .tables,        .tables,        .tables,        
.tables,        .tables,        .tables,        .tables # table_name
+% id,  name,   schema_id,      query,  type,   system, commit_action,  access, 
temporary # name
+% int, varchar,        int,    varchar,        smallint,       boolean,        
smallint,       smallint,       tinyint # type
+% 1,   0,      1,      0,      1,      5,      1,      1,      1 # length
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to