Changeset: cca12f38c734 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cca12f38c734
Added Files:
sql/test/BugTracker-2018/Tests/sqlitelogictest-case-coalesce.Bug-6550.sql
sql/test/BugTracker-2018/Tests/sqlitelogictest-wrong-cast-null.Bug-6551.sql
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
Removed Files:
sql/scripts/97_comments.sql
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
configure.ag
sql/backends/monet5/UDF/pyapi/connection.c
sql/backends/monet5/UDF/pyapi/pyapi.c
sql/backends/monet5/UDF/pyapi/pyapi.h
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql.h
sql/backends/monet5/sql.mal
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_cat.h
sql/backends/monet5/sql_upgrades.c
sql/include/sql_relation.h
sql/scripts/51_sys_schema_extension.sql
sql/scripts/99_system.sql
sql/scripts/Makefile.ag
sql/server/sql_mvc.c
sql/server/sql_privileges.c
sql/storage/bat/bat_table.c
sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out
sql/test/BugTracker-2018/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/All
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-chain/Tests/All
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64
sql/test/emptydb-upgrade-hge/Tests/All
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade/Tests/All
sql/test/emptydb-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb/Tests/All
sql/test/emptydb/Tests/check.stable.out
sql/test/emptydb/Tests/check.stable.out.32bit
sql/test/emptydb/Tests/check.stable.out.int128
sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-upgrade/Tests/upgrade.stable.out
sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit
sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128
testing/README
Branch: data-vaults
Log Message:
Merge with default
diffs (truncated from 20348 to 300 lines):
diff --git a/clients/Tests/MAL-signatures.stable.out
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -10841,8 +10841,6 @@ Ready.
[ "sql", "copy_from", "pattern sql.copy_from(t:ptr, sep:str,
rsep:str, ssep:str, ns:str, fname:str, nr:lng, offset:lng, locked:int,
best:int, fwf:str):bat[:any]... ", "mvc_import_table_wrap;",
"Import a table from bstream s with the \n\tgiven tuple and seperators
(sep/rsep)" ]
[ "sql", "copy_rejects", "pattern sql.copy_rejects() (rowid:bat[:lng],
fldid:bat[:int], msg:bat[:str], inp:bat[:str]) ", "COPYrejects;", "" ]
[ "sql", "copy_rejects_clear", "pattern sql.copy_rejects_clear():void
", "COPYrejects_clear;", "" ]
-[ "sql", "create_func_upgrade_oct2014", "pattern
sql.create_func_upgrade_oct2014(sname:str, f:str):int ",
"UPGcreate_func;", "Create the function described by f, needed for the
Oct2014 upgrade" ]
-[ "sql", "create_view_upgrade_oct2014", "pattern
sql.create_view_upgrade_oct2014(sname:str, v:str):int ",
"UPGcreate_view;", "Create the view described by f, needed for the Oct2014
upgrade" ]
[ "sql", "createorderindex", "pattern sql.createorderindex(sch:str,
tbl:str, col:str):void ", "sql_createorderindex;", "Instantiate
the order index on a column" ]
[ "sql", "current_time", "pattern sql.current_time():daytime ",
"SQLcurrent_daytime;", "Get the clients current daytime" ]
[ "sql", "current_timestamp", "pattern
sql.current_timestamp():timestamp ", "SQLcurrent_timestamp;", "Get the
clients current timestamp" ]
@@ -10859,7 +10857,6 @@ Ready.
[ "sql", "dense_rank", "pattern sql.dense_rank(b:any_1, p:bit,
o:bit):int ", "SQLdense_rank;", "return the densely ranked groups"
]
[ "sql", "diff", "pattern sql.diff(b:any_1):bit ", "SQLdiff;",
"return true if cur != prev row" ]
[ "sql", "diff", "pattern sql.diff(p:bit, b:any_1):bit ",
"SQLdiff;", "return true if cur != prev row" ]
-[ "sql", "drop_func_upgrade_oct2014", "pattern
sql.drop_func_upgrade_oct2014(id:int):int ", "UPGdrop_func;", "Drop
the function identified by id, needed for the Oct2014 upgrade" ]
[ "sql", "drop_hash", "pattern sql.drop_hash(sch:str, tbl:str):void
", "SQLdrop_hash;", "Drop hash indices for the given table" ]
[ "sql", "droporderindex", "pattern sql.droporderindex(sch:str,
tbl:str, col:str):void ", "sql_droporderindex;", "Drop the order index on a
column" ]
[ "sql", "dump_cache", "pattern sql.dump_cache() (query:bat[:str],
count:bat[:int]) ", "dump_cache;", "dump the content of the query cache" ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -15052,8 +15052,6 @@ Ready.
[ "sql", "copy_from", "pattern sql.copy_from(t:ptr, sep:str,
rsep:str, ssep:str, ns:str, fname:str, nr:lng, offset:lng, locked:int,
best:int, fwf:str):bat[:any]... ", "mvc_import_table_wrap;",
"Import a table from bstream s with the \n\tgiven tuple and seperators
(sep/rsep)" ]
[ "sql", "copy_rejects", "pattern sql.copy_rejects() (rowid:bat[:lng],
fldid:bat[:int], msg:bat[:str], inp:bat[:str]) ", "COPYrejects;", "" ]
[ "sql", "copy_rejects_clear", "pattern sql.copy_rejects_clear():void
", "COPYrejects_clear;", "" ]
-[ "sql", "create_func_upgrade_oct2014", "pattern
sql.create_func_upgrade_oct2014(sname:str, f:str):int ",
"UPGcreate_func;", "Create the function described by f, needed for the
Oct2014 upgrade" ]
-[ "sql", "create_view_upgrade_oct2014", "pattern
sql.create_view_upgrade_oct2014(sname:str, v:str):int ",
"UPGcreate_view;", "Create the view described by f, needed for the Oct2014
upgrade" ]
[ "sql", "createorderindex", "pattern sql.createorderindex(sch:str,
tbl:str, col:str):void ", "sql_createorderindex;", "Instantiate
the order index on a column" ]
[ "sql", "current_time", "pattern sql.current_time():daytime ",
"SQLcurrent_daytime;", "Get the clients current daytime" ]
[ "sql", "current_timestamp", "pattern
sql.current_timestamp():timestamp ", "SQLcurrent_timestamp;", "Get the
clients current timestamp" ]
@@ -15071,7 +15069,6 @@ Ready.
[ "sql", "dense_rank", "pattern sql.dense_rank(b:any_1, p:bit,
o:bit):int ", "SQLdense_rank;", "return the densely ranked groups"
]
[ "sql", "diff", "pattern sql.diff(b:any_1):bit ", "SQLdiff;",
"return true if cur != prev row" ]
[ "sql", "diff", "pattern sql.diff(p:bit, b:any_1):bit ",
"SQLdiff;", "return true if cur != prev row" ]
-[ "sql", "drop_func_upgrade_oct2014", "pattern
sql.drop_func_upgrade_oct2014(id:int):int ", "UPGdrop_func;", "Drop
the function identified by id, needed for the Oct2014 upgrade" ]
[ "sql", "drop_hash", "pattern sql.drop_hash(sch:str, tbl:str):void
", "SQLdrop_hash;", "Drop hash indices for the given table" ]
[ "sql", "droporderindex", "pattern sql.droporderindex(sch:str,
tbl:str, col:str):void ", "sql_droporderindex;", "Drop the order index on a
column" ]
[ "sql", "dump_cache", "pattern sql.dump_cache() (query:bat[:str],
count:bat[:int]) ", "dump_cache;", "dump the content of the query cache" ]
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1307,9 +1307,21 @@ dump_function_comment(Mapi mid, stream *
return 1;
snprintf(query, len,
- "SELECT category, schema, name, type, type_digits, type_scale,
remark "
- "FROM sys.commented_function_signatures "
- "WHERE fid = %s "
+ "SELECT \n"
+ " coalesce(function_type_keyword, '') AS category,\n"
+ " s.name AS schema,\n"
+ " CASE RANK() OVER (PARTITION BY f.id ORDER BY p.number
ASC) WHEN 1 THEN f.name ELSE NULL END AS name,\n"
+ " p.type, \n"
+ " p.type_digits, \n"
+ " p.type_scale,\n"
+ " CASE RANK() OVER (PARTITION BY f.id ORDER BY p.number
DESC) WHEN 1 THEN c.remark ELSE NULL END AS remark,\n"
+ " ROW_NUMBER() OVER (ORDER BY f.id, p.number) AS line\n"
+ "FROM sys.functions f\n"
+ "JOIN sys.comments c ON f.id = c.id\n"
+ "JOIN sys.schemas s ON f.schema_id = s.id\n"
+ "LEFT OUTER JOIN sys.function_types ft ON f.type =
ft.function_type_id\n"
+ "LEFT OUTER JOIN sys.args p ON f.id = p.func_id AND p.inout =
1\n"
+ "WHERE f.id = %s\n"
"ORDER BY line;", id);
hashge = has_hugeint(mid);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -2192,7 +2192,6 @@ showCommands(void)
mnstr_printf(toConsole, "\\q - terminate session\n");
}
-/* These values must match those used in view sys.describe_all_objects */
#define MD_TABLE 1
#define MD_VIEW 2
#define MD_SEQ 4
@@ -2540,7 +2539,59 @@ doFile(Mapi mid, stream *fp, bool useins
#endif
} else {
/* get all object names in
current schema */
- size_t len = 500 + strlen(line);
+ char *with_clause =
+ "WITH
describe_all_objects AS (\n"
+ " SELECT s.name AS
sname,\n"
+ " t.name,\n"
+ " s.name || \'.\'
|| t.name AS fullname,\n"
+ " CAST(CASE
t.type\n"
+ " WHEN 1 THEN 2 --
ntype for views\n"
+ " ELSE 1\t --
ntype for tables\n"
+ " END AS SMALLINT)
AS ntype,\n"
+ " (CASE WHEN
t.system THEN \'SYSTEM \' ELSE \'\' END) || tt.table_type_name AS type,\n"
+ " t.system,\n"
+ " c.remark AS
remark\n"
+ " FROM sys._tables
t\n"
+ " LEFT OUTER JOIN
sys.comments c ON t.id = c.id\n"
+ " LEFT OUTER JOIN
sys.schemas s ON t.schema_id = s.id\n"
+ " LEFT OUTER JOIN
sys.table_types tt ON t.type = tt.table_type_id\n"
+ " UNION ALL\n"
+ " SELECT s.name AS
sname,\n"
+ " sq.name,\n"
+ " s.name || \'.\'
|| sq.name AS fullname,\n"
+ " CAST(4 AS
SMALLINT) AS ntype,\n"
+ " \'SEQUENCE\' AS
type,\n"
+ " false AS
system,\n"
+ " c.remark AS
remark\n"
+ " FROM sys.sequences
sq\n"
+ " LEFT OUTER JOIN
sys.comments c ON sq.id = c.id\n"
+ " LEFT OUTER JOIN
sys.schemas s ON sq.schema_id = s.id\n"
+ " UNION ALL\n"
+ " SELECT DISTINCT
s.name AS sname, -- DISTINCT is needed to filter out duplicate overloaded
function/procedure names\n"
+ " f.name,\n"
+ " s.name || \'.\'
|| f.name AS fullname,\n"
+ " CAST(8 AS
SMALLINT) AS ntype,\n"
+ " (CASE WHEN
sf.function_id IS NOT NULL THEN \'SYSTEM \' ELSE \'\' END) ||
function_type_keyword AS type,\n"
+ " sf.function_id
IS NOT NULL AS system,\n"
+ " c.remark AS
remark\n"
+ " FROM sys.functions
f\n"
+ " LEFT OUTER JOIN
sys.comments c ON f.id = c.id\n"
+ " LEFT OUTER JOIN
sys.function_types ft ON f.type = ft.function_type_id\n"
+ " LEFT OUTER JOIN
sys.schemas s ON f.schema_id = s.id\n"
+ " LEFT OUTER JOIN
sys.systemfunctions sf ON f.id = sf.function_id\n"
+ " UNION ALL\n"
+ " SELECT NULL AS
sname,\n"
+ " s.name,\n"
+ " s.name AS
fullname,\n"
+ " CAST(16 AS
SMALLINT) AS ntype,\n"
+ " (CASE WHEN
s.system THEN \'SYSTEM SCHEMA\' ELSE \'SCHEMA\' END) AS type,\n"
+ " s.system,\n"
+ " c.remark AS
remark\n"
+ " FROM sys.schemas
s\n"
+ " LEFT OUTER JOIN
sys.comments c ON s.id = c.id\n"
+ " ORDER BY system,
name, sname, ntype)\n"
+ ;
+ size_t len =
strlen(with_clause) + 500 + strlen(line);
char *query = malloc(len);
char *q = query, *endq = query
+ len;
char *name_column = hasSchema ?
"fullname" : "name";
@@ -2558,7 +2609,8 @@ doFile(Mapi mid, stream *fp, bool useins
* | "data.my*" | no
| fullname LIKE 'data.my%' |
* | "*a.my*" | no
| fullname LIKE '%a.my%' |
*/
- q += snprintf(q, endq - q,
"SELECT type, fullname, remark FROM sys.describe_all_objects\n");
+ q += snprintf(q, endq - q,
"%s", with_clause);
+ q += snprintf(q, endq - q,
"SELECT type, fullname, remark FROM describe_all_objects\n");
q += snprintf(q, endq - q,
"WHERE (ntype & %u) > 0\n", x);
if (!wantsSystem) {
q += snprintf(q, endq -
q, "AND NOT system\n");
diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -198,7 +198,7 @@ AS_CASE([$enable_gdk-$enable_monetdb5],
[no-yes], [AC_MSG_ERROR([MonetDB5 requires GDK.])],
[no-auto], [
enable_monetdb5=no
- disable_monetdb5="(MonetDB5 requires GDK.)"])
+ why_not_monetdb5="(MonetDB5 requires GDK.)"])
dft_sql=yes
AC_ARG_ENABLE([sql],
@@ -211,7 +211,7 @@ AS_CASE([$enable_monetdb5-$enable_sql],
AC_MSG_ERROR([MonetDB/SQL requires MonetDB5.])],
[no-auto], [
enable_sql=no
- disable_sql="(MonetDB/SQL requires MonetDB5.)"])
+ why_not_sql="(MonetDB/SQL requires MonetDB5.)"])
dft_geom=auto
AC_ARG_ENABLE([geom],
@@ -224,7 +224,7 @@ AS_CASE([$enable_monetdb5-$enable_geom],
AC_MSG_ERROR([geom module requires MonetDB5])],
[no-auto], [
enable_geom=no
- disable_geom="(geom module requires MonetDB5)"])
+ why_not_geom="(geom module requires MonetDB5)"])
dft_fits=auto
AC_ARG_ENABLE([fits],
@@ -265,7 +265,7 @@ AS_CASE([$enable_geom-$have_shp],
AC_MSG_ERROR([ESRI Shapefile vault requires the geom module])],
[no-auto], [
have_shp=no
- disable_shp="(ESRI Shapefile vault requires the geom module)"])
+ why_not_shp="(ESRI Shapefile vault requires the geom module)"])
dft_embedded=no
AC_ARG_ENABLE([embedded],
@@ -820,7 +820,7 @@ AS_CASE([x$enable_debug.$enable_optimize
[xyes.*], [
enable_debug=yes
AS_VAR_IF([enable_optimize], [no], [],
- [disable_optimize="(as debug is enabled)"])
+ [why_not_optimize="(as debug is enabled)"])
enable_optimize=no
],
[x*.*no], [
@@ -831,7 +831,7 @@ AS_CASE([x$enable_debug.$enable_optimize
# enable-optimize overrules other defaults
enable_optimize=yes
AS_VAR_IF([enable_debug], [no], [],
- [disable_debug="(as optimize is enabled)"])
+ [why_not_debug="(as optimize is enabled)"])
enable_debug=no
],
[x*],
@@ -1098,13 +1098,13 @@ AS_VAR_IF([have_python2], [no],
have_python2=yes],
[AS_VAR_IF([have_python], [auto],
[have_python2=no
- why_have_python2="(Python 2 executable
not found)"],
+ why_not_python2="(Python 2 executable
not found)"],
[AC_MSG_ERROR([Python 2 executable not
found])])])],
[AS_CASE([`"$PYTHON2" -V 2>&1`],
["Python 2."[[67]]*], [],
[AS_VAR_IF([have_python2], [auto], [
have_python2=no
- why_have_python2="(Python 2 executable
too old)"], [
+ why_not_python2="(Python 2 executable
too old)"], [
AC_MSG_ERROR([Python 2 executable too
old])])])])])])
AS_VAR_IF([have_python2], [no],
@@ -1162,7 +1162,7 @@ AS_VAR_IF([have_python3], [no],
have_python3=yes],
[AS_VAR_IF([have_python3], [auto],
[have_python3=no
- why_have_python3="(Python 3 executable
not found)"],
+ why_not_python3="(Python 3 executable
not found)"],
[AC_MSG_ERROR([Python3 executable not
found])])])])])])
AS_VAR_IF([have_python3], [no],
@@ -1239,8 +1239,8 @@ AS_CASE([$YACC],
AS_VAR_IF([enable_sql], [yes], [
AC_MSG_ERROR([MonetDB/SQL requires bison])])
enable_sql=no
- AS_VAR_IF([disable_sql], [], [
- disable_sql="(MonetDB/SQL requires bison)"])], [
+ AS_VAR_IF([why_not_sql], [], [
+ why_not_sql="(MonetDB/SQL requires bison)"])], [
AC_MSG_WARN([ignoring missing bison in embedded
configuration])])
])
@@ -1327,9 +1327,9 @@ AS_VAR_IF([have_bz2], [no], [], [
[AC_CHECK_LIB([bz2], [BZ2_bzopen],
[AC_DEFINE([HAVE_LIBBZ2], 1, [Define if you have the
bz2 library])],
[AS_VAR_IF([have_bz2], [auto], [], [AC_MSG_ERROR([-lbz2
library not found])])
- have_bz2=no; why_have_bz2="(bz2 library not found)"])],
+ have_bz2=no; why_not_bz2="(bz2 library not found)"])],
[AS_VAR_IF([have_bz2], [auto], [], [AC_MSG_ERROR([bzlib.h
header not found])])
- have_bz2=no; why_have_bz2="(bzlib.h header not
found)"])
+ have_bz2=no; why_not_bz2="(bzlib.h header not found)"])
LDFLAGS="$save_LDFLAGS"
CPPFLAGS="$save_CPPFLAGS"])
AS_VAR_IF([have_bz2], [no], [BZ_CFLAGS=""; BZ_LIBS=""])
@@ -1364,9 +1364,9 @@ AS_VAR_IF([have_snappy], [no], [], [
[AC_CHECK_LIB([snappy], [snappy_max_compressed_length],
[AC_DEFINE([HAVE_LIBSNAPPY], 1, [Define if you have the
snappy library])],
[AS_VAR_IF([have_snappy], [auto], [],
[AC_MSG_ERROR([-lsnappy library not found])])
- have_snappy=no; why_have_snappy="(snappy library not
found)"])],
+ have_snappy=no; why_not_snappy="(snappy library not
found)"])],
[AS_VAR_IF([have_snappy], [auto], [], [AC_MSG_ERROR([snappy-c.h
header not found])])
- have_snappy=no; why_have_snappy="(snappy-c.h header
not found)"])
+ have_snappy=no; why_not_snappy="(snappy-c.h header not
found)"])
LDFLAGS="$save_LDFLAGS"
CPPFLAGS="$save_CPPFLAGS"])
AS_VAR_IF([have_snappy], [no], [snappy_CFLAGS=""; snappy_LIBS=""])
@@ -1400,9 +1400,9 @@ AS_VAR_IF([have_lz4], [no], [], [
[AC_CHECK_LIB([lz4], [LZ4_compress_fast],
[AC_DEFINE([HAVE_LIBLZ4], 1, [Define if you have the
lz4 library])],
[AS_VAR_IF([have_lz4], [auto], [], [AC_MSG_ERROR([-llz4
library not found])])
- have_lz4=no; why_have_lz4="(lz4 library not found)"])],
+ have_lz4=no; why_not_lz4="(lz4 library not found)"])],
[AS_VAR_IF([have_lz4], [auto], [], [AC_MSG_ERROR([lz4.h header
not found])])
- have_lz4=no; why_have_lz4="(lz4.h header not found)"])
+ have_lz4=no; why_not_lz4="(lz4.h header not found)"])
LDFLAGS="$save_LDFLAGS"
CPPFLAGS="$save_CPPFLAGS"])
AS_VAR_IF([have_lz4], [no], [lz4_CFLAGS=""; lz4_LIBS=""])
@@ -1507,7 +1507,7 @@ AS_VAR_IF([have_pthread], [no], [], [
AS_VAR_IF([have_pthread], [auto], [], [
AC_MSG_ERROR([pthread library not
found])])
have_pthread=no
- why_have_pthread="(pthread library not found)"])
+ why_not_pthread="(pthread library not found)"])
PTHREAD_LIBS="$LIBS"])
AC_SEARCH_LIBS([pthread_kill], [],
@@ -1570,14 +1570,14 @@ AS_VAR_IF([have_readline], [no], [], [
[AS_VAR_IF([have_readline], [yes], [
AC_MSG_ERROR([readline library
not found])])
have_readline=no
- why_have_readline="(readline library
not found)" ],
+ why_not_readline="(readline library
not found)" ],
[-lncurses])],
[-ltermcap])],
),
[AS_VAR_IF([have_readline], [yes], [
AC_MSG_ERROR([readline header file not found])])
have_readline=no
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list