MonetDB: default - Flag changes
Changeset: 67ff27450601 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/67ff27450601 Modified Files: sql/server/rel_optimize_proj.c Branch: default Log Message: Flag changes diffs (11 lines): diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c --- a/sql/server/rel_optimize_proj.c +++ b/sql/server/rel_optimize_proj.c @@ -1375,6 +1375,7 @@ rel_groupby_cse(visitor *v, sql_rel *rel e->used = 0; list_append(l->exps, e); list_remove_node(rel->r, NULL, n); + v->changes++; } n = next; } ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Jun2020 - We need an old proj library.
Changeset: 05b7db81dd1c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/05b7db81dd1c Modified Files: configure.ag Branch: Jun2020 Log Message: We need an old proj library. diffs (12 lines): diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -1789,7 +1789,7 @@ AC_ARG_WITH([proj], [include proj support (default=auto)])], [have_proj="$withval"]) AS_VAR_IF([have_proj], [no], [], [ - PKG_CHECK_MODULES([proj], [proj], + PKG_CHECK_MODULES([proj], [proj < 8.0.0], [AC_DEFINE([HAVE_PROJ], 1, [Define if the proj library exists]) have_proj=yes], [AS_VAR_IF([have_proj], [auto], [], ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Oct2020 - Merge with Jun2020 branch.
Changeset: 703d46938bc0 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/703d46938bc0 Branch: Oct2020 Log Message: Merge with Jun2020 branch. ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: Jul2021 - Merge with Oct2020 branch.
Changeset: aaf910081dd1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/aaf910081dd1 Branch: Jul2021 Log Message: Merge with Oct2020 branch. ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Update the upgrade program, part of fix 7282
Changeset: 721b7889b3f1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/721b7889b3f1 Modified Files: sql/backends/monet5/sql_upgrades.c Branch: default Log Message: Update the upgrade program, part of fix 7282 diffs (108 lines): 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 @@ -4591,7 +4591,7 @@ sql_update_jan2022(Client c, mvc *sql) static str sql_update_default(Client c, mvc *sql) { - size_t bufsize = 8192, pos = 0; + size_t bufsize = 65536, pos = 0; char *err = NULL, *buf = GDKmalloc(bufsize); res_table *output; BAT *b; @@ -4625,6 +4625,8 @@ sql_update_default(Client c, mvc *sql) pos += snprintf(buf + pos, bufsize - pos, /* drop dependent stuff from 76_dump.sql */ "drop function sys.dump_database(boolean);\n" + "drop procedure sys.dump_table_data();\n" + "drop procedure sys.dump_table_data(string, string);\n" "drop view sys.dump_partition_tables;\n" "drop view sys.describe_partition_tables;\n" "drop view sys.dump_sequences;\n" @@ -4722,14 +4724,65 @@ sql_update_default(Client c, mvc *sql) "sch schema_name,\n" "seq sequence_name\n" "FROM sys.describe_sequences;\n" + "CREATE PROCEDURE sys.dump_table_data(sch STRING, tbl STRING)\n" + "BEGIN\n" + " DECLARE tid INT;\n" + " SET tid = (SELECT MIN(t.id) FROM sys.tables t, sys.schemas s WHERE t.name = tbl AND t.schema_id = s.id AND s.name = sch);\n" + " IF tid IS NOT NULL THEN\n" + "DECLARE k INT;\n" + "DECLARE m INT;\n" + "SET k = (SELECT MIN(c.id) FROM sys.columns c WHERE c.table_id = tid);\n" + "SET m = (SELECT MAX(c.id) FROM sys.columns c WHERE c.table_id = tid);\n" + "IF k IS NOT NULL AND m IS NOT NULL THEN\n" + " DECLARE cname STRING;\n" + " DECLARE ctype STRING;\n" + " DECLARE _cnt INT;\n" + " SET cname = (SELECT c.name FROM sys.columns c WHERE c.id = k);\n" + " SET ctype = (SELECT c.type FROM sys.columns c WHERE c.id = k);\n" + " SET _cnt = (SELECT count FROM sys.storage(sch, tbl, cname));\n" + " IF _cnt > 0 THEN\n" + "DECLARE COPY_INTO_STMT STRING;\n" + "DECLARE SELECT_DATA_STMT STRING;\n" + "SET COPY_INTO_STMT = 'COPY ' || _cnt || ' RECORDS INTO ' || sys.FQN(sch, tbl) || '(' || sys.DQ(cname);\n" + "SET SELECT_DATA_STMT = 'SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), ' || sys.prepare_esc(cname, ctype);\n" + "WHILE (k < m) DO\n" + " SET k = (SELECT MIN(c.id) FROM sys.columns c WHERE c.table_id = tid AND c.id > k);\n" + " SET cname = (SELECT c.name FROM sys.columns c WHERE c.id = k);\n" + " SET ctype = (SELECT c.type FROM sys.columns c WHERE c.id = k);\n" + " SET COPY_INTO_STMT = (COPY_INTO_STMT || ', ' || sys.DQ(cname));\n" + " SET SELECT_DATA_STMT = (SELECT_DATA_STMT || '|| ''|'' || ' || sys.prepare_esc(cname, ctype));\n" + "END WHILE;\n" + "SET COPY_INTO_STMT = (COPY_INTO_STMT || ') FROM STDIN USING DELIMITERS ''|'',E''n'',''\"'';');\n" + "SET SELECT_DATA_STMT = (SELECT_DATA_STMT || ' FROM ' || sys.FQN(sch, tbl));\n" + "INSERT INTO sys.dump_statements VALUES ((SELECT COUNT(*) FROM sys.dump_statements) + 1, COPY_INTO_STMT);\n" + "CALL sys.EVAL('INSERT INTO sys.dump_statements ' || SELECT_DATA_STMT || ';');\n" + " END IF;\n" + "END IF;\n" + " END IF;\n" + "END;\n" + "CREATE PROCEDURE sys.dump_table_data()\n" + "BEGIN\n" + " DECLARE i INT;\n" + " SET i = (SELECT MIN(t.id) FROM sys.tables t, sys.table_types ts WHERE t.type = ts.table_type_id AND ts.table_type_name = 'TABLE' AND NOT t.system);\n" + " IF i IS NOT NULL THEN\n" + "DECLARE M INT;\n" + "
MonetDB: default - Added group by x+1,(y-2)*3,2-z into group by ...
Changeset: fb6b0c5a4d0e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/fb6b0c5a4d0e Modified Files: sql/server/rel_optimize_proj.c sql/test/miscellaneous/Tests/groupby_expressions.test sql/test/miscellaneous/Tests/simple_selects.test Branch: default Log Message: Added group by x+1,(y-2)*3,2-z into group by x,y,z optimization diffs (196 lines): diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c --- a/sql/server/rel_optimize_proj.c +++ b/sql/server/rel_optimize_proj.c @@ -1333,6 +1333,121 @@ rel_project_cse(visitor *v, sql_rel *rel return rel; } +/* optimize group by x+1,(y-2)*3,2-z into group by x,y,z */ +static inline sql_rel * +rel_simplify_groupby_columns(visitor *v, sql_rel *rel) +{ + if (is_groupby(rel->op) && !list_empty(rel->r)) { + sql_rel *l = rel->l; + + for (node *n=((list*)rel->r)->h; n ; n = n->next) { + sql_exp *e = n->data; + e->used = 0; /* we need to use this flag, clean it first */ + } + for (node *n=((list*)rel->r)->h; n ; n = n->next) { + sql_exp *e = n->data; + + if (e->type == e_column) { + bool searching = true; + sql_rel *efrel = NULL; + sql_exp *exp = rel_find_exp_and_corresponding_rel(l, e, false, &efrel, NULL), *col = NULL; + + while (searching && !col) { + sql_exp *exp_col = exp; + + if (exp && is_numeric_upcast(exp)) + exp = exp->l; + if (exp && exp->type == e_func) { + list *el = exp->l; + sql_subfunc *sf = exp->f; + /* At the moment look only at injective math functions */ + if (sf->func->type == F_FUNC && !sf->func->s && + (!strcmp(sf->func->base.name, "sql_sub") || !strcmp(sf->func->base.name, "sql_add") || !strcmp(sf->func->base.name, "sql_mul"))) { + sql_exp *e1 = (sql_exp*) el->h->data, *e2 = (sql_exp*) el->h->next->data; + /* the optimization cannot be done if side-effect calls (e.g. rand()) are present */ + int e1ok = exp_is_atom(e1) && !exp_unsafe(e1, 1) && !exp_has_sideeffect(e1), e2ok = exp_is_atom(e2) && !exp_unsafe(e2, 1) && !exp_has_sideeffect(e2); + + if ((!e1ok && e2ok) || (e1ok && !e2ok)) { + sql_exp *c = e1ok ? e2 : e1; + bool done = false; + + while (!done) { + if (is_numeric_upcast(c)) + c = c->l; + if (c->type == e_column) { + if (is_simple_project(efrel->op) || is_groupby(efrel->op)) { + /* in a simple projection, self-references may occur */ + sql_exp *nc = (c->l ? exps_bind_column2(efrel->exps, c->l, c->r, NULL) : exps_bind_column(efrel->exps, c->r, NULL, NULL, 0)); + if (nc && list_position(efrel->exps, nc) < list_position(efrel->exps, exp_col)) { + exp_col = c; + c = nc; + continue; + } + } + col = c; /* 'c' is a column reference from the left relation */ + done = true; + } else { +
MonetDB: default - Approve upgrade.
Changeset: 390850340c7c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/390850340c7c Modified Files: sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128 sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64 sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128 sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.32bit sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128 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-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.32bit sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128 sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128 sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out.32bit sql/test/testdb-previous-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: Approve upgrade. diffs (truncated from 3724 to 300 lines): diff --git a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 --- a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 +++ b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 @@ -4088,6 +4088,8 @@ update sys.functions set system = true w Running database upgrade commands: drop function sys.dump_database(boolean); +drop procedure sys.dump_table_data(); +drop procedure sys.dump_table_data(string, string); drop view sys.dump_partition_tables; drop view sys.describe_partition_tables; drop view sys.dump_sequences; @@ -4183,14 +4185,65 @@ CREATE VIEW sys.dump_start_sequences AS sch schema_name, seq sequence_name FROM sys.describe_sequences; +CREATE PROCEDURE sys.dump_table_data(sch STRING, tbl STRING) +BEGIN + DECLARE tid INT; + SET tid = (SELECT MIN(t.id) FROM sys.tables t, sys.schemas s WHERE t.name = tbl AND t.schema_id = s.id AND s.name = sch); + IF tid IS NOT NULL THEN +DECLARE k INT; +DECLARE m INT; +SET k = (SELECT MIN(c.id) FROM sys.columns c WHERE c.table_id = tid); +SET m = (SELECT MAX(c.id) FROM sys.columns c WHERE c.table_id = tid); +IF k IS NOT NULL AND m IS NOT NULL THEN + DECLARE cname STRING; + DECLARE ctype STRING; + DECLARE _cnt INT; + SET cname = (SELECT c.name FROM sys.columns c WHERE c.id = k); + SET ctype = (SELECT c.type FROM sys.columns c WHERE c.id = k); + SET _cnt = (SELECT count FROM sys.storage(sch, tbl, cname)); + IF _cnt > 0 THEN +DECLARE COPY_INTO_STMT STRING; +DECLARE SELECT_DATA_STMT STRING; +SET COPY_INTO_STMT = 'COPY ' || _cnt || ' RECORDS INTO ' || sys.FQN(sch, tbl) || '(' || sys.DQ(cname); +SET SELECT_DATA_STMT = 'SELECT (SELECT COUNT(*) FROM sys.dump_statements) + RANK() OVER(), ' || sys.prepare_esc(cname, ctype); +WHILE (k < m) DO + SET k = (SELECT MIN(c.id) FROM sys.columns c WHERE c.
MonetDB: properties - Merged with default
Changeset: de84b81989c2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/de84b81989c2 Modified Files: gdk/gdk.h gdk/gdk_batop.c gdk/gdk_bbp.c sql/backends/monet5/sql.c sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_upgrades.c sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_optimize_proj.c sql/server/rel_rel.c sql/storage/bat/bat_storage.c sql/test/BugTracker-2015/Tests/crash_in_reduce_groupby.Bug-3818.test sql/test/miscellaneous/Tests/groupby_error.test sql/test/miscellaneous/Tests/groupby_expressions.test sql/test/miscellaneous/Tests/simple_selects.test Branch: properties Log Message: Merged with default diffs (truncated from 5865 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -762,3 +762,4 @@ cab90a348501b045e19cee5cebcc44f3800bd0a8 cab90a348501b045e19cee5cebcc44f3800bd0a8 Jul2021_SP5_release 5872f047d97c98d3a848514438b8f97fa446855d Jan2022_11 025239a5a6f122042798c0f1132a2c6298514e06 Jan2022_13 +025239a5a6f122042798c0f1132a2c6298514e06 Jan2022_SP2_release diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -775,7 +775,6 @@ void MSresetInstructions(MalBlkPtr mb, i void MSresetStack(Client cntxt, MalBlkPtr mb, MalStkPtr glb); void MSresetVariables(MalBlkPtr mb); void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout, protocol_version protocol, size_t blocksize); -str MSserveClient(Client cntxt); str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces); str OIDXdropImplementation(Client cntxt, BAT *b); str QLOGcalls(BAT **r); diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -246,19 +246,33 @@ macro(monetdb_configure_sizes) check_type_size(socklen_t HAVE_SOCKLEN_T LANGUAGE C) cmake_pop_check_state() + cmake_push_check_state() + check_type_size(__int128 SIZEOF___INT128 LANGUAGE C) + check_type_size(__int128_t SIZEOF___INT128_T LANGUAGE C) + check_type_size(__uint128_t SIZEOF___UINT128_T LANGUAGE C) if(INT128) -cmake_push_check_state() -check_type_size(__int128 SIZEOF___INT128 LANGUAGE C) -check_type_size(__int128_t SIZEOF___INT128_T LANGUAGE C) -check_type_size(__uint128_t SIZEOF___UINT128_T LANGUAGE C) -if(HAVE_SIZEOF___INT128 OR HAVE_SIZEOF___INT128_T OR HAVE_SIZEOF___UINT128_T) +if(HAVE_SIZEOF___INT128) set(HAVE_HGE TRUE) message(STATUS "Huge integers are available") else() - message(STATUS "128-bit integers not supported by this compiler") + if(HAVE_SIZEOF___INT128_T AND HAVE_SIZEOF___UINT128_T) +set(HAVE_HGE TRUE) +message(STATUS "Huge integers are available") + else() +message(STATUS "128-bit integers not supported by this compiler") + endif() endif() -cmake_pop_check_state() + endif() + if(HAVE_SIZEOF___INT128) +set(HAVE___INT128 TRUE) endif() + if(HAVE_SIZEOF___INT128_T) +set(HAVE___INT128_T TRUE) + endif() + if(HAVE_SIZEOF___UINT128_T) +set(HAVE___UINT128_T TRUE) + endif() + cmake_pop_check_state() if(ODBC_FOUND) cmake_push_check_state() diff --git a/common/stream/stream.h b/common/stream/stream.h --- a/common/stream/stream.h +++ b/common/stream/stream.h @@ -39,17 +39,6 @@ #else # define stream_export extern #endif -#ifndef HAVE_HGE -# ifdef HAVE___INT128 -# define HAVE_HGE 1 -typedef __int128 hge; -# else -# ifdef HAVE___INT128_T -# define HAVE_HGE 1 -typedef __int128_t hge; -# endif -# endif -#endif /* Defines to help the compiler check printf-style format arguments. * These defines are also in our config.h, but we repeat them here so diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -778,6 +778,7 @@ typedef enum { * tsorted, trevsorted, twidth, tshift, tnonil, tnil, tnokey, tnosorted, * tnorevsorted, tminpos, tmaxpos, and tunique_est; in addition, the * value should be set if the BBP field BBP_logical(bid) is changed. + * This corresponds with any field that gets saved in the BBP.dir file. * * theaplock: this lock should be held when reading or writing any of * the fields mentioned above for batDirtydesc, and also when reading or @@ -797,8 +798,9 @@ typedef struct BAT { bool batTransient:1,/* should the BAT persist on disk? */ batCopiedtodisk:1, /* once written */ -batDirtyflushed:1, /* was dirty before commit started? */ batDirtydesc:1;/* bat descriptor dirty marker */ + /* not part of bitfields since not in BATiter */ + bool batDirtyflushed; /* was dirty before commit started? */ uint16_t selcnt;/* how often used in equi select without hash */ uint16_t unused;/* value=0 for
MonetDB: Jan2022 - Disable foreign keys between temp and non tem...
Changeset: 576f8bb3782a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/576f8bb3782a Modified Files: sql/server/rel_schema.c sql/test/miscellaneous/Tests/simple_selects.test Branch: Jan2022 Log Message: Disable foreign keys between temp and non temp tables. Fixes crash diffs (52 lines): diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c --- a/sql/server/rel_schema.c +++ b/sql/server/rel_schema.c @@ -433,6 +433,14 @@ column_constraint_type(mvc *sql, const c } if (!rt) return SQL_ERR; + if (!rt->s) { /* disable foreign key on declared table */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key with declared tables"); + return res; + } + if (isTempSchema(t->s) != isTempSchema(rt->s)) { /* disable foreign key between temp and non temp */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables"); + return res; + } if (!ns || !*ns) { /* add this to be safe */ (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: key name name cannot be empty"); return res; @@ -679,6 +687,14 @@ table_foreign_key(mvc *sql, const char * int ref_actions = n->next->next->next->next->data.i_val; assert(n->next->next->next->next->type == type_int); + if (!ft->s) { /* disable foreign key on declared table */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key with declared tables"); + return SQL_ERR; + } + if (isTempSchema(t->s) != isTempSchema(ft->s)) { /* disable foreign key between temp and non temp */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables"); + return SQL_ERR; + } if (!ns || !*ns) { /* add this to be safe */ (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: key name name cannot be empty"); return SQL_ERR; diff --git a/sql/test/miscellaneous/Tests/simple_selects.test b/sql/test/miscellaneous/Tests/simple_selects.test --- a/sql/test/miscellaneous/Tests/simple_selects.test +++ b/sql/test/miscellaneous/Tests/simple_selects.test @@ -939,3 +939,15 @@ CREATE INDEX ups ON tmp.x (x) statement ok drop table x + +statement ok +START TRANSACTION + +statement ok +create temp table foo (i int primary key) on commit preserve rows + +statement error 42000!CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables +create table bar (i int, FOREIGN KEY (i) REFERENCES foo(i)) + +statement ok +ROLLBACK ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: default - Merged with Jan2022
Changeset: 819bfb3503d5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/819bfb3503d5 Modified Files: sql/server/rel_schema.c sql/test/miscellaneous/Tests/simple_selects.test Branch: default Log Message: Merged with Jan2022 diffs (55 lines): diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c --- a/sql/server/rel_schema.c +++ b/sql/server/rel_schema.c @@ -434,6 +434,14 @@ column_constraint_type(mvc *sql, const c } if (!rt) return SQL_ERR; + if (!rt->s) { /* disable foreign key on declared table */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key with declared tables"); + return res; + } + if (isTempSchema(t->s) != isTempSchema(rt->s)) { /* disable foreign key between temp and non temp */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables"); + return res; + } if (!ns || !*ns) { /* add this to be safe */ (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: key name name cannot be empty"); return res; @@ -680,6 +688,14 @@ table_foreign_key(mvc *sql, const char * int ref_actions = n->next->next->next->next->data.i_val; assert(n->next->next->next->next->type == type_int); + if (!ft->s) { /* disable foreign key on declared table */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key with declared tables"); + return SQL_ERR; + } + if (isTempSchema(t->s) != isTempSchema(ft->s)) { /* disable foreign key between temp and non temp */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables"); + return SQL_ERR; + } if (!ns || !*ns) { /* add this to be safe */ (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: key name name cannot be empty"); return SQL_ERR; diff --git a/sql/test/miscellaneous/Tests/simple_selects.test b/sql/test/miscellaneous/Tests/simple_selects.test --- a/sql/test/miscellaneous/Tests/simple_selects.test +++ b/sql/test/miscellaneous/Tests/simple_selects.test @@ -1006,6 +1006,18 @@ drop index tmp.ups statement ok drop table x +statement ok +START TRANSACTION + +statement ok +create temp table foo (i int primary key) on commit preserve rows + +statement error 42000!CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables +create table bar (i int, FOREIGN KEY (i) REFERENCES foo(i)) + +statement ok +ROLLBACK + # some private functions related errors statement error 42000!SELECT: no such binary operator 'scale_up'(decimal,tinyint) select scale_up(12.1, 10) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: unlogged - Allow with data creation of unlogged tables.
Changeset: 604e4bf0f0ec for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/604e4bf0f0ec Modified Files: sql/server/rel_schema.c Branch: unlogged Log Message: Allow with data creation of unlogged tables. diffs (12 lines): diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c --- a/sql/server/rel_schema.c +++ b/sql/server/rel_schema.c @@ -1376,7 +1376,7 @@ rel_create_table(sql_query *query, int t if (!is_project(sq->op)) /* make sure sq is a projection */ sq = rel_project(sql->sa, sq, rel_projections(sql, sq, NULL, 1, 1)); - if (tt != tt_table && with_data) + if ((tt != tt_table && tt != tt_unlogged_table) && with_data) return sql_error(sql, 02, SQLSTATE(42000) "%s TABLE: cannot create %s 'with data'", action, TABLE_TYPE_DESCRIPTION(tt, properties)); ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: unlogged - Make sure unloggedTable initialized correctl...
Changeset: 6bff36d13eeb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/6bff36d13eeb Modified Files: sql/storage/store.c Branch: unlogged Log Message: Make sure unloggedTable initialized correctly after restart. diffs (14 lines): diff --git a/sql/storage/store.c b/sql/storage/store.c --- a/sql/storage/store.c +++ b/sql/storage/store.c @@ -5616,6 +5616,10 @@ sql_trans_create_table(sql_table **tres, } else if (!cs_add(&tr->localtmps, t, true)) { return -1; } + + if (isUnloggedTable(t)) + t->persistence = SQL_PERSIST; // It's not a temporary + if (isRemote(t)) t->persistence = SQL_REMOTE; ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: unlogged - Very small fix.
Changeset: ac95f2e25754 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/ac95f2e25754 Modified Files: sql/storage/bat/bat_storage.c Branch: unlogged Log Message: Very small fix. diffs (12 lines): diff --git a/sql/storage/bat/bat_storage.c b/sql/storage/bat/bat_storage.c --- a/sql/storage/bat/bat_storage.c +++ b/sql/storage/bat/bat_storage.c @@ -4863,7 +4863,7 @@ swap_bats(sql_trans *tr, sql_column *col return update_conflict ? LOG_CONFLICT : LOG_ERR; assert(d && d->cs.ts == tr->tid); if ((!inTransaction(tr, col->t) && (odelta != d || isTempTable(col->t)) && isGlobal(col->t)) || (!isNew(col->t) && isLocalTemp(col->t))) - trans_add(tr, &col->base, d, &tc_gc_col, &commit_update_col, &log_update_col); + trans_add(tr, &col->base, d, &tc_gc_col, &commit_update_col, isUnloggedTable(col->t)?NULL:&log_update_col); if (d->cs.bid) temp_destroy(d->cs.bid); if (d->cs.uibid) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org
MonetDB: unlogged - Merge with default.
Changeset: a5307d752c32 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/a5307d752c32 Modified Files: sql/backends/monet5/sql_upgrades.c sql/storage/bat/bat_storage.c Branch: unlogged Log Message: Merge with default. diffs (truncated from 5861 to 300 lines): diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -762,3 +762,4 @@ cab90a348501b045e19cee5cebcc44f3800bd0a8 cab90a348501b045e19cee5cebcc44f3800bd0a8 Jul2021_SP5_release 5872f047d97c98d3a848514438b8f97fa446855d Jan2022_11 025239a5a6f122042798c0f1132a2c6298514e06 Jan2022_13 +025239a5a6f122042798c0f1132a2c6298514e06 Jan2022_SP2_release diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out --- a/clients/Tests/exports.stable.out +++ b/clients/Tests/exports.stable.out @@ -775,7 +775,6 @@ void MSresetInstructions(MalBlkPtr mb, i void MSresetStack(Client cntxt, MalBlkPtr mb, MalStkPtr glb); void MSresetVariables(MalBlkPtr mb); void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout, protocol_version protocol, size_t blocksize); -str MSserveClient(Client cntxt); str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces); str OIDXdropImplementation(Client cntxt, BAT *b); str QLOGcalls(BAT **r); diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -246,19 +246,33 @@ macro(monetdb_configure_sizes) check_type_size(socklen_t HAVE_SOCKLEN_T LANGUAGE C) cmake_pop_check_state() + cmake_push_check_state() + check_type_size(__int128 SIZEOF___INT128 LANGUAGE C) + check_type_size(__int128_t SIZEOF___INT128_T LANGUAGE C) + check_type_size(__uint128_t SIZEOF___UINT128_T LANGUAGE C) if(INT128) -cmake_push_check_state() -check_type_size(__int128 SIZEOF___INT128 LANGUAGE C) -check_type_size(__int128_t SIZEOF___INT128_T LANGUAGE C) -check_type_size(__uint128_t SIZEOF___UINT128_T LANGUAGE C) -if(HAVE_SIZEOF___INT128 OR HAVE_SIZEOF___INT128_T OR HAVE_SIZEOF___UINT128_T) +if(HAVE_SIZEOF___INT128) set(HAVE_HGE TRUE) message(STATUS "Huge integers are available") else() - message(STATUS "128-bit integers not supported by this compiler") + if(HAVE_SIZEOF___INT128_T AND HAVE_SIZEOF___UINT128_T) +set(HAVE_HGE TRUE) +message(STATUS "Huge integers are available") + else() +message(STATUS "128-bit integers not supported by this compiler") + endif() endif() -cmake_pop_check_state() + endif() + if(HAVE_SIZEOF___INT128) +set(HAVE___INT128 TRUE) endif() + if(HAVE_SIZEOF___INT128_T) +set(HAVE___INT128_T TRUE) + endif() + if(HAVE_SIZEOF___UINT128_T) +set(HAVE___UINT128_T TRUE) + endif() + cmake_pop_check_state() if(ODBC_FOUND) cmake_push_check_state() diff --git a/common/stream/stream.h b/common/stream/stream.h --- a/common/stream/stream.h +++ b/common/stream/stream.h @@ -39,17 +39,6 @@ #else # define stream_export extern #endif -#ifndef HAVE_HGE -# ifdef HAVE___INT128 -# define HAVE_HGE 1 -typedef __int128 hge; -# else -# ifdef HAVE___INT128_T -# define HAVE_HGE 1 -typedef __int128_t hge; -# endif -# endif -#endif /* Defines to help the compiler check printf-style format arguments. * These defines are also in our config.h, but we repeat them here so diff --git a/gdk/gdk.h b/gdk/gdk.h --- a/gdk/gdk.h +++ b/gdk/gdk.h @@ -778,6 +778,7 @@ typedef enum { * tsorted, trevsorted, twidth, tshift, tnonil, tnil, tnokey, tnosorted, * tnorevsorted, tminpos, tmaxpos, and tunique_est; in addition, the * value should be set if the BBP field BBP_logical(bid) is changed. + * This corresponds with any field that gets saved in the BBP.dir file. * * theaplock: this lock should be held when reading or writing any of * the fields mentioned above for batDirtydesc, and also when reading or @@ -797,8 +798,9 @@ typedef struct BAT { bool batTransient:1,/* should the BAT persist on disk? */ batCopiedtodisk:1, /* once written */ -batDirtyflushed:1, /* was dirty before commit started? */ batDirtydesc:1;/* bat descriptor dirty marker */ + /* not part of bitfields since not in BATiter */ + bool batDirtyflushed; /* was dirty before commit started? */ uint16_t selcnt;/* how often used in equi select without hash */ uint16_t unused;/* value=0 for now (sneakily used by mat.c) */ int batSharecnt;/* incoming view count */ @@ -962,6 +964,8 @@ typedef struct BATiter { int8_t type; oid tseq; BUN hfree, vhfree; + BUN nokey[2]; + BUN nosorted, norevsorted; BUN minpos, maxpos; double unique_est; bool key:1, @@ -1008,6 +1012,10 @@ bat_iterator_nolock(BAT *b) (size_t) b->batCount << b->tshift : 0, .vhfree
MonetDB: unlogged - Merge with default.
Changeset: e7eacf25e47d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e7eacf25e47d Modified Files: sql/server/rel_schema.c Branch: unlogged Log Message: Merge with default. diffs (55 lines): diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c --- a/sql/server/rel_schema.c +++ b/sql/server/rel_schema.c @@ -435,6 +435,14 @@ column_constraint_type(mvc *sql, const c } if (!rt) return SQL_ERR; + if (!rt->s) { /* disable foreign key on declared table */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key with declared tables"); + return res; + } + if (isTempSchema(t->s) != isTempSchema(rt->s)) { /* disable foreign key between temp and non temp */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables"); + return res; + } if (!ns || !*ns) { /* add this to be safe */ (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: key name name cannot be empty"); return res; @@ -681,6 +689,14 @@ table_foreign_key(mvc *sql, const char * int ref_actions = n->next->next->next->next->data.i_val; assert(n->next->next->next->next->type == type_int); + if (!ft->s) { /* disable foreign key on declared table */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key with declared tables"); + return SQL_ERR; + } + if (isTempSchema(t->s) != isTempSchema(ft->s)) { /* disable foreign key between temp and non temp */ + (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables"); + return SQL_ERR; + } if (!ns || !*ns) { /* add this to be safe */ (void) sql_error(sql, 02, SQLSTATE(42000) "CONSTRAINT FOREIGN KEY: key name name cannot be empty"); return SQL_ERR; diff --git a/sql/test/miscellaneous/Tests/simple_selects.test b/sql/test/miscellaneous/Tests/simple_selects.test --- a/sql/test/miscellaneous/Tests/simple_selects.test +++ b/sql/test/miscellaneous/Tests/simple_selects.test @@ -1006,6 +1006,18 @@ drop index tmp.ups statement ok drop table x +statement ok +START TRANSACTION + +statement ok +create temp table foo (i int primary key) on commit preserve rows + +statement error 42000!CONSTRAINT FOREIGN KEY: cannot create foreign key between temporary and non temporary tables +create table bar (i int, FOREIGN KEY (i) REFERENCES foo(i)) + +statement ok +ROLLBACK + # some private functions related errors statement error 42000!SELECT: no such binary operator 'scale_up'(decimal,tinyint) select scale_up(12.1, 10) ___ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org