Changeset: 0816b84fbfad for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0816b84fbfad
Added Files:
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.powerpc64.int128
Removed Files:
sql/scripts/97_comments.sql
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/mclient.c
configure.ag
sql/backends/monet5/sql_cat.c
sql/backends/monet5/sql_upgrades.c
sql/scripts/51_sys_schema_extension.sql
sql/scripts/99_system.sql
sql/scripts/Makefile.ag
sql/storage/bat/bat_table.c
sql/test/BugTracker-2017/Tests/crash_correlated_subqueries_in_select.Bug-6254.stable.out
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: default
Log Message:
Merge with Mar2018 branch.
diffs (truncated from 19756 to 300 lines):
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],
@@ -258,7 +258,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],
@@ -813,7 +813,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], [
@@ -824,7 +824,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*],
@@ -1091,13 +1091,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],
@@ -1155,7 +1155,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],
@@ -1232,8 +1232,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])])
])
@@ -1320,9 +1320,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=""])
@@ -1357,9 +1357,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=""])
@@ -1393,9 +1393,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=""])
@@ -1500,7 +1500,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], [],
@@ -1563,14 +1563,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
- why_have_readline="(readline header file not found)" ])])
+ why_not_readline="(readline header file not found)" ])])
AS_VAR_IF([have_readline], [no],
[],
@@ -1588,12 +1588,12 @@ AS_VAR_IF([have_readline], [no],
[AS_VAR_IF([have_readline], [auto],
[AC_MSG_RESULT([no])
have_readline=no
- why_have_readline="(readline/readline.h does
not contain rl_completion_func_t, is it GNU readline?)"],
+ why_not_readline="(readline/readline.h does
not contain rl_completion_func_t, is it GNU readline?)"],
[AC_MSG_ERROR([readline/readline.h does not
contain rl_completion_func_t, is it GNU readline?])])])],
[AS_VAR_IF([have_readline], [auto], [], [
AC_MSG_ERROR([readline library does not contain
rl_completion_matches])])
have_readline=no
- why_have_readline="(readline library does not contain
rl_completion_matches)" ],
+ why_not_readline="(readline library does not contain
rl_completion_matches)" ],
[$READLINE_LIBS])])
CPPFLAGS="$save_CPPFLAGS"
LIBS="$save_LIBS"
@@ -1656,14 +1656,14 @@ AS_CASE([$host],
AS_VAR_IF([have_openssl], [no], [], [
PKG_CHECK_MODULES([openssl], [openssl],
[have_openssl=yes],
- [have_openssl=no; why_have_openssl="(OpenSSL
library not found)"])
+ [have_openssl=no; why_not_openssl="(OpenSSL
library not found)"])
AS_CASE([$enable_monetdb5-$have_openssl],
[yes-no], [
AC_MSG_ERROR([OpenSSL library not found but required
for MonetDB5])],
[auto-no], [
enable_monetdb5=no
- AS_VAR_IF([disable_monetdb5], [], [
- disable_monetdb5="(OpenSSL library not found
but required for MonetDB5)"])],
+ AS_VAR_IF([why_not_monetdb5], [], [
+ why_not_monetdb5="(OpenSSL library not found
but required for MonetDB5)"])],
[*-yes], [
save_LIBS="$LIBS"
LIBS="$LIBS $openssl_LIBS"
@@ -1675,12 +1675,12 @@ AS_CASE([$host],
AC_MSG_ERROR([OpenSSL library found but
checksum algorithm required for MonetDB5 not found])],
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list