Changeset: dd913fc02a92 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/dd913fc02a92
Modified Files:
cmake/monetdb-defines.cmake
cmake/monetdb-options.cmake
sql/backends/monet5/sql.c
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128
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.ppc64
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128
sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128
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/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
Branch: default
Log Message:
Merged with Jul2021
diffs (truncated from 357 to 300 lines):
diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake
--- a/cmake/monetdb-defines.cmake
+++ b/cmake/monetdb-defines.cmake
@@ -297,7 +297,7 @@ macro(monetdb_configure_misc)
CACHE STRING
"Password hash algorithm, one of MD5, SHA1, RIPEMD160, SHA224, SHA256,
SHA384, SHA512, defaults to SHA512")
- if(NOT ${PASSWORD_BACKEND} MATCHES
"^MD5|SHA1|RIPEMD160|SHA224|SHA256|SHA384|SHA512$")
+ if(NOT ${PASSWORD_BACKEND} MATCHES
"^(MD5|SHA1|RIPEMD160|SHA224|SHA256|SHA384|SHA512)$")
message(FATAL_ERROR
"PASSWORD_BACKEND invalid, choose one of MD5, SHA1, RIPEMD160, SHA224,
SHA256, SHA384, SHA512")
endif()
diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake
--- a/cmake/monetdb-options.cmake
+++ b/cmake/monetdb-options.cmake
@@ -39,6 +39,10 @@ option(FITS
"Enable support for FITS (default=ON)"
ON)
+option(FORCE_COLORED_OUTPUT
+ "Force colored compiler output (GCC and Clang only; default=OFF)"
+ OFF)
+
option(GEOM
"Enable support for geom module (default=ON)"
ON)
diff --git a/cmake/monetdb-toolchain.cmake b/cmake/monetdb-toolchain.cmake
--- a/cmake/monetdb-toolchain.cmake
+++ b/cmake/monetdb-toolchain.cmake
@@ -7,6 +7,14 @@
#]]
function(monetdb_default_toolchain)
+ if (${FORCE_COLORED_OUTPUT})
+ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ MT_addCompilerFlag("-fdiagnostics-color=always"
"-fdiagnostics-color=always" "${CMAKE_C_FLAGS}" "all" CMAKE_C_FLAGS)
+ elseif ("${CMAKE_C_COMPILER_ID}" MATCHES "^(Clang|AppleClang)$")
+ MT_addCompilerFlag("-fcolor-diagnostics" "-fcolor-diagnostics"
"${CMAKE_C_FLAGS}" "all" CMAKE_C_FLAGS)
+ endif ()
+ endif ()
+
if(SANITIZER)
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
MT_addCompilerFlag("-fsanitize=address" "-fsanitize=address"
"${CMAKE_C_FLAGS}" "all" CMAKE_C_FLAGS)
@@ -18,7 +26,7 @@ function(monetdb_default_toolchain)
endif()
if(STRICT)
- if(${CMAKE_C_COMPILER_ID} MATCHES "^GNU|Clang|AppleClang$")
+ if(${CMAKE_C_COMPILER_ID} MATCHES "^(GNU|Clang|AppleClang)$")
MT_addCompilerFlag("-Werror" "-Werror" "${CMAKE_C_FLAGS}" "all"
CMAKE_C_FLAGS)
MT_addCompilerFlag("-Wall" "-Wall" "${CMAKE_C_FLAGS}" "all"
CMAKE_C_FLAGS)
MT_addCompilerFlag("-Wextra" "-Wextra" "${CMAKE_C_FLAGS}" "all"
CMAKE_C_FLAGS)
@@ -101,6 +109,14 @@ function(monetdb_default_toolchain)
endfunction()
function(monetdb_default_compiler_options)
+ if (${FORCE_COLORED_OUTPUT})
+ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ add_compile_options("-fdiagnostics-color=always")
+ elseif ("${CMAKE_C_COMPILER_ID}" MATCHES "^(Clang|AppleClang)$")
+ add_compile_options("-fcolor-diagnostics")
+ endif ()
+ endif ()
+
if(SANITIZER)
if(${CMAKE_C_COMPILER_ID} STREQUAL "GNU")
add_compile_options("-fsanitize=address")
@@ -112,7 +128,7 @@ function(monetdb_default_compiler_option
endif()
if(STRICT)
- if(${CMAKE_C_COMPILER_ID} MATCHES "^GNU|Clang|AppleClang$")
+ if(${CMAKE_C_COMPILER_ID} MATCHES "^(GNU|Clang|AppleClang)$")
add_compile_options("-Werror")
add_compile_options("-Wall")
add_compile_options("-Wextra")
@@ -149,10 +165,14 @@ function(monetdb_default_compiler_option
add_option_if_available("-Wduplicated-branches")
add_option_if_available("-Wrestrict")
add_option_if_available("-Wnested-externs")
+ add_option_if_available("-Wmissing-noreturn")
+ add_option_if_available("-Wuninitialized")
+
# since we use values of type "int8_t" as subscript,
# and int8_t may be defined as plain "char", we cannot
# allow this warning (part of -Wall)
add_option_if_available("-Wno-char-subscripts")
+
add_option_if_available("-Wunreachable-code")
elseif(${CMAKE_C_COMPILER_ID} STREQUAL "Intel")
if(WIN32)
diff --git a/sql/backends/monet5/sql.c b/sql/backends/monet5/sql.c
--- a/sql/backends/monet5/sql.c
+++ b/sql/backends/monet5/sql.c
@@ -2769,7 +2769,7 @@ mvc_export_row_wrap( Client cntxt, MalBl
tpe = BATdescriptor(tpeId);
len = BATdescriptor(lenId);
scale = BATdescriptor(scaleId);
- if( msg || tbl == NULL || atr == NULL || tpe == NULL || len == NULL ||
scale == NULL)
+ if (tbl == NULL || atr == NULL || tpe == NULL || len == NULL || scale
== NULL)
goto wrapup_result_set;
/* mimick the old rsColumn approach; */
itertbl = bat_iterator(tbl);
diff --git a/sql/backends/monet5/sql_cat.c b/sql/backends/monet5/sql_cat.c
--- a/sql/backends/monet5/sql_cat.c
+++ b/sql/backends/monet5/sql_cat.c
@@ -161,7 +161,7 @@ validate_alter_table_add_table(mvc *sql,
throw(SQL,call,SQLSTATE(42000) "ALTER TABLE: can't add a
temporary table into a %s", errtable);
if (ms->base.id != ps->base.id)
throw(SQL,call,SQLSTATE(42000) "ALTER TABLE: all children
tables of '%s.%s' must be part of schema '%s'", msname, mtname, msname);
- if (strcmp(rmt->base.name, rpt->base.name) == 0)
+ if (rmt->base.id == rpt->base.id)
throw(SQL,call,SQLSTATE(42000) "ALTER TABLE: a %s can't be a
child of itself", errtable);
node *n = members_find_child_id(rmt->members, rpt->base.id);
if (n && !update)
diff --git a/sql/scripts/51_sys_schema_extension.sql
b/sql/scripts/51_sys_schema_extension.sql
--- a/sql/scripts/51_sys_schema_extension.sql
+++ b/sql/scripts/51_sys_schema_extension.sql
@@ -457,16 +457,16 @@ INSERT INTO sys.privilege_codes (privile
(15, 'SELECT,INSERT,UPDATE,DELETE'),
(65, 'SELECT,TRUNCATE'),
(66, 'UPDATE,TRUNCATE'),
+ (67, 'SELECT,UPDATE,TRUNCATE'),
(68, 'INSERT,TRUNCATE'),
+ (69, 'SELECT,INSERT,TRUNCATE'),
+ (70, 'INSERT,UPDATE,TRUNCATE'),
+ (71, 'SELECT,INSERT,UPDATE,TRUNCATE'),
(72, 'DELETE,TRUNCATE'),
- (67, 'SELECT,UPDATE,TRUNCATE'),
- (69, 'SELECT,INSERT,TRUNCATE'),
(73, 'SELECT,DELETE,TRUNCATE'),
- (70, 'INSERT,UPDATE,TRUNCATE'),
+ (74, 'UPDATE,DELETE,TRUNCATE'),
+ (75, 'SELECT,UPDATE,DELETE,TRUNCATE'),
(76, 'INSERT,DELETE,TRUNCATE'),
- (74, 'UPDATE,DELETE,TRUNCATE'),
- (71, 'SELECT,INSERT,UPDATE,TRUNCATE'),
- (75, 'SELECT,UPDATE,DELETE,TRUNCATE'),
(77, 'SELECT,INSERT,DELETE,TRUNCATE'),
(78, 'INSERT,UPDATE,DELETE,TRUNCATE'),
(79, 'SELECT,INSERT,UPDATE,DELETE,TRUNCATE');
diff --git a/sql/server/rel_optimizer.c b/sql/server/rel_optimizer.c
--- a/sql/server/rel_optimizer.c
+++ b/sql/server/rel_optimizer.c
@@ -9303,6 +9303,9 @@ replace_column_references_with_nulls_2(m
static sql_rel *
out2inner(visitor *v, sql_rel* sel, sql_rel* join, sql_rel* inner_join_side,
operator_type new_type) {
+ /* handle inner_join relations with a simple select */
+ if (is_select(inner_join_side->op) && inner_join_side->l)
+ inner_join_side = inner_join_side->l;
if (!is_base(inner_join_side->op) &&
!is_simple_project(inner_join_side->op)) {
// Nothing to do here.
return sel;
diff --git a/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
b/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
--- a/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
+++ b/sql/test/testdb-upgrade-hge/Tests/dump.stable.out
@@ -101185,9 +101185,11 @@ 0 0
0 1
1 0
1 1
-create view keytest3 as select t2.key1, t2.key2, t1.key3 from keytest1 t1,
keytest2 t2 where t1.key1 = t2.key1 and t1.key2 = t2.key2;
+create view keytest3 as select t2.key1, t2.key2, t1.key3 from keytest1 t1,
keytest2 t2 where t1.key1 = t2.key1 and t1.key2 = t2.key2
+;
COMMENT ON VIEW "testschema"."keytest3" IS 'a view used for testing';
-create trigger keytesttrigger after update on keytest1 referencing new row as
new_row for each row insert into keytest2 values (new_row.key1, new_row.key2);
+create trigger keytesttrigger after update on keytest1 referencing new row as
new_row for each row insert into keytest2 values (new_row.key1, new_row.key2)
+;
create function keyjoin()
returns table (
key1 integer,
@@ -101200,7 +101202,8 @@ begin
from keytest1, keytest2
where keytest1.key1 = keytest2.key1 and keytest1.key2 = keytest2.key2
);
-end;
+end
+;
COMMENT ON FUNCTION "testschema"."keyjoin"() IS 'function used for testing';
CREATE TABLE "testschema"."selfref" (
"id" INTEGER NOT NULL DEFAULT next value for
"testschema"."selfref_seq",
@@ -101218,7 +101221,8 @@ create function nleaves()
returns integer
begin
return select count(*) from selfref where parentid is not null;
-end;
+end
+;
CREATE TABLE "testschema"."blobtest" (
"data" BINARY LARGE OBJECT
);
@@ -101350,20 +101354,24 @@ CREATE FUNCTION "testschema"."pyapi01"("
x = range(1, i + 1)
y = [42.0] * i
return([x,y])
-};
+}
+;
CREATE FUNCTION "testschema"."pyapi02"("i" INTEGER, "j" INTEGER, "z" INTEGER)
RETURNS INTEGER LANGUAGE PYTHON3
{
x = i * sum(j) * z
return x
-};
+}
+;
CREATE FUNCTION "testschema"."rapi01"("i" INTEGER) RETURNS TABLE ("i" INTEGER,
"d" DOUBLE) LANGUAGE R
{
return(data.frame(i=seq(1,i),d=42.0));
-};
+}
+;
CREATE FUNCTION "testschema"."rapi02"("i" INTEGER, "j" INTEGER, "z" INTEGER)
RETURNS INTEGER LANGUAGE R
{
return(i*sum(j)*z);
-};
+}
+;
CREATE FUNCTION "testschema"."capi00"("inp" INTEGER) RETURNS INTEGER LANGUAGE C
{
size_t i;
@@ -101371,7 +101379,8 @@ CREATE FUNCTION "testschema"."capi00"("i
for(i = 0; i < inp.count; i++) {
result->data[i] = inp.data[i] * 2;
}
-};
+}
+;
CREATE AGGREGATE "testschema"."aggrmedian"("val" INTEGER) RETURNS INTEGER
LANGUAGE PYTHON
{
if 'aggr_group' in locals():
@@ -101382,11 +101391,13 @@ CREATE AGGREGATE "testschema"."aggrmedia
return(x)
else:
return(numpy.median(val))
-};
+}
+;
CREATE FUNCTION "testschema"."pyapi10_mult"("i" INTEGER, "j" INTEGER) RETURNS
INTEGER LANGUAGE PYTHON_MAP
{
return(i*j)
-};
+}
+;
CREATE TABLE "testschema"."geomtest" (
"p" GEOMETRY(POINT),
"c" GEOMETRY(LINESTRING),
@@ -101420,7 +101431,7 @@ ALTER TABLE "testschema"."mt2" ADD TABLE
ALTER TABLE "testschema"."mt2" ADD TABLE "testschema"."t3";
ALTER TABLE "testschema"."mt1" ADD TABLE "testschema"."t1";
ALTER TABLE "testschema"."mt1" ADD TABLE "testschema"."t2";
-ALTER TABLE "testschema"."keytest2" ADD CONSTRAINT "keytest2_key1_key2_fkey"
FOREIGN KEY ("key1", "key2") REFERENCES "testschema"."keytest1" ("key1",
"key2");
+ALTER TABLE "testschema"."keytest2" ADD CONSTRAINT "keytest2_key1_key2_fkey"
FOREIGN KEY ("key1", "key2") REFERENCES "testschema"."keytest1" ("key1",
"key2") ON DELETE CASCADE;
ALTER TABLE "testschema"."selfref" ADD CONSTRAINT "selfref_parentid_fkey"
FOREIGN KEY ("parentid") REFERENCES "testschema"."selfref" ("id");
ALTER SEQUENCE "testschema"."selfref_seq" RESTART WITH 7 NO CYCLE;
ALTER SEQUENCE "testschema"."test_seq" RESTART WITH 8 INCREMENT BY 3 MINVALUE
5 MAXVALUE 10 CYCLE;
diff --git a/sql/test/testdb-upgrade/Tests/dump.stable.out
b/sql/test/testdb-upgrade/Tests/dump.stable.out
--- a/sql/test/testdb-upgrade/Tests/dump.stable.out
+++ b/sql/test/testdb-upgrade/Tests/dump.stable.out
@@ -101185,9 +101185,11 @@ 0 0
0 1
1 0
1 1
-create view keytest3 as select t2.key1, t2.key2, t1.key3 from keytest1 t1,
keytest2 t2 where t1.key1 = t2.key1 and t1.key2 = t2.key2;
+create view keytest3 as select t2.key1, t2.key2, t1.key3 from keytest1 t1,
keytest2 t2 where t1.key1 = t2.key1 and t1.key2 = t2.key2
+;
COMMENT ON VIEW "testschema"."keytest3" IS 'a view used for testing';
-create trigger keytesttrigger after update on keytest1 referencing new row as
new_row for each row insert into keytest2 values (new_row.key1, new_row.key2);
+create trigger keytesttrigger after update on keytest1 referencing new row as
new_row for each row insert into keytest2 values (new_row.key1, new_row.key2)
+;
create function keyjoin()
returns table (
key1 integer,
@@ -101200,7 +101202,8 @@ begin
from keytest1, keytest2
where keytest1.key1 = keytest2.key1 and keytest1.key2 = keytest2.key2
);
-end;
+end
+;
COMMENT ON FUNCTION "testschema"."keyjoin"() IS 'function used for testing';
CREATE TABLE "testschema"."selfref" (
"id" INTEGER NOT NULL DEFAULT next value for
"testschema"."selfref_seq",
@@ -101218,7 +101221,8 @@ create function nleaves()
returns integer
begin
return select count(*) from selfref where parentid is not null;
-end;
+end
+;
CREATE TABLE "testschema"."blobtest" (
"data" BINARY LARGE OBJECT
);
@@ -101350,20 +101354,24 @@ CREATE FUNCTION "testschema"."pyapi01"("
x = range(1, i + 1)
y = [42.0] * i
return([x,y])
-};
+}
+;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list