Changeset: c7d1b716b250 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c7d1b716b250 Added Files: sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.py sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.err sql/test/BugTracker-2019/Tests/python-loader-string.Bug-6759.stable.out Modified Files: NT/rules.msc clients/mapiclient/mclient.c configure.ag gdk/gdk_logger.c monetdb5/modules/mal/tablet.c sql/backends/monet5/sql.c sql/backends/monet5/sql_cat.c sql/backends/monet5/sql_upgrades.c sql/common/sql_types.c sql/common/sql_types.h sql/include/sql_catalog.h sql/server/rel_psm.c sql/server/rel_psm.h sql/server/rel_schema.c sql/server/rel_select.c sql/server/rel_unnest.c sql/server/rel_unnest.h sql/server/sql_mvc.c sql/server/sql_mvc.h sql/server/sql_tokens.h sql/storage/sql_catalog.c sql/storage/sql_storage.h sql/storage/store.c sql/test/BugTracker-2009/Tests/All sql/test/BugTracker-2018/Tests/All sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.sql sql/test/BugTracker-2018/Tests/sqlitelogictest-having-not-null-not-in.Bug-6557.stable.out sql/test/BugTracker-2019/Tests/All sql/test/BugTracker-2019/Tests/duplicates-not-eliminated-long-CASE-stmt.Bug-6697.sql sql/test/BugTracker/Tests/All sql/test/SQLite_regress/sqllogictest/sqllogictest.py testing/Mtest.py.in tools/merovingian/daemon/controlrunner.c Branch: grouping-analytics Log Message:
Merge with default diffs (truncated from 1788 to 300 lines): diff --git a/NT/rules.msc b/NT/rules.msc --- a/NT/rules.msc +++ b/NT/rules.msc @@ -42,6 +42,7 @@ BITSMCHN=X64 # force W_CFLAGS off in debug builds: using icc, you get way more # warnings about casts which results in the code being uncompilable W_CFLAGS = +HAVE_MAL_DEBUGGER = 1 !ENDIF !IFDEF ENABLE_STRICT # strict mode: treat warnings as errors @@ -386,6 +387,11 @@ create_winconfig_conds_new_py: !ELSE $(ECHO) HAVE_SHP_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py" !ENDIF +!IFDEF HAVE_MAL_DEBUGGER + $(ECHO) HAVE_MAL_DEBUGGER_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py" +!ELSE + $(ECHO) HAVE_MAL_DEBUGGER_FALSE='' >> "$(TOPDIR)\winconfig_conds_new.py" +!ENDIF !IFDEF HAVE_SQL $(ECHO) HAVE_SQL_FALSE='#' >> "$(TOPDIR)\winconfig_conds_new.py" !ELSE diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -3664,6 +3664,9 @@ main(int argc, char **argv) if (mode == SQL) dump_version(mid, toConsole, "Database:"); + mnstr_printf(toConsole, "FOLLOW US on https://twitter.com/MonetDB "); + mnstr_printf(toConsole, "or https://github.com/MonetDB/MonetDB\n"); + mnstr_printf(toConsole, "Type \\q to quit, \\? for a list of available commands\n"); if (mode == SQL) mnstr_printf(toConsole, "auto commit mode: %s\n", diff --git a/configure.ag b/configure.ag --- a/configure.ag +++ b/configure.ag @@ -838,6 +838,7 @@ AS_VAR_IF([enable_assert], [no], [ AC_MSG_RESULT([no])], [AC_MSG_RESULT([yes])]) +AM_CONDITIONAL([HAVE_MAL_DEBUGGER], [test "x$enable_assert" != xno]) AC_MSG_CHECKING([for --enable-optimize]) AS_CASE([$enable_optimize], [yes], [ diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c --- a/gdk/gdk_logger.c +++ b/gdk/gdk_logger.c @@ -3034,8 +3034,10 @@ pre_allocate(logger *lg) p = (lng) getfilepos(getFile(lg->log)); if (p == -1) return GDK_FAIL; - if (p > LOG_LARGE) + if (p > LOG_LARGE) { + lg->id++; return logger_open(lg); + } if (p + DBLKSZ > lg->end) { p &= ~(DBLKSZ - 1); p += SEGSZ; diff --git a/monetdb5/modules/mal/tablet.c b/monetdb5/modules/mal/tablet.c --- a/monetdb5/modules/mal/tablet.c +++ b/monetdb5/modules/mal/tablet.c @@ -670,7 +670,7 @@ tablet_error(READERtask *task, lng row, BUNappend(task->cntxt->error_msg, msg, false) != GDK_SUCCEED || BUNappend(task->cntxt->error_input, fcn, false) != GDK_SUCCEED) task->besteffort = 0; - if (!is_lng_nil(row) && task->rowerror) + if (!is_lng_nil(row) && task->rowerror && row < task->limit) task->rowerror[row]++; } if (task->as->error == NULL) { 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 @@ -294,7 +294,7 @@ create_table_or_view(mvc *sql, char* sna int check = 0; if (STORE_READONLY) - return sql_error(sql, 06, "25006!schema statements cannot be executed on a readonly database."); + return sql_error(sql, 06, SQLSTATE(25006) "schema statements cannot be executed on a readonly database."); if (!s) return sql_message(SQLSTATE(3F000) "CREATE %s: schema '%s' doesn't exist", (t->query) ? "TABLE" : "VIEW", sname); @@ -472,8 +472,7 @@ create_table_from_emit(Client cntxt, cha return msg; /* for some reason we don't have an allocator here, so make one */ - sql->sa = sa_create(); - if (!sql->sa) { + if (!(sql->sa = sa_create())) { msg = sql_error(sql, 02, SQLSTATE(HY001) "CREATE TABLE: %s", MAL_MALLOC_FAIL); goto cleanup; } @@ -481,52 +480,52 @@ create_table_from_emit(Client cntxt, cha if (!sname) sname = "sys"; if (!(s = mvc_bind_schema(sql, sname))) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: no such schema '%s'", sname); + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: no such schema '%s'", sname); goto cleanup; } if (!(t = mvc_create_table(sql, s, tname, tt_table, 0, SQL_DECLARED_TABLE, CA_COMMIT, -1, 0))) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not create table '%s'", tname); + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could not create table '%s'", tname); goto cleanup; } - for(i = 0; i < ncols; i++) { + for (i = 0; i < ncols; i++) { BAT *b = columns[i].b; - sql_subtype *tpe = sql_bind_localtype(ATOMname(b->ttype)); + str atoname = ATOMname(b->ttype); + sql_subtype tpe; sql_column *col = NULL; - if (!tpe) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not find type for column"); - goto cleanup; + if (!strcmp(atoname, "str")) + sql_find_subtype(&tpe, "clob", 0, 0); + else { + sql_subtype *t = sql_bind_localtype(atoname); + if (!t) { + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could not find type for column"); + goto cleanup; + } + tpe = *t; } - col = mvc_create_column(sql, t, columns[i].name, tpe); - if (!col) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not create column %s", columns[i].name); + if (!(col = mvc_create_column(sql, t, columns[i].name, &tpe))) { + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could not create column %s", columns[i].name); goto cleanup; } } - msg = create_table_or_view(sql, sname, t->base.name, t, 0); - if (msg != MAL_SUCCEED) { + if ((msg = create_table_or_view(sql, sname, t->base.name, t, 0)) != MAL_SUCCEED) goto cleanup; - } - t = mvc_bind_table(sql, s, tname); - if (!t) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not bind table %s", tname); + if (!(t = mvc_bind_table(sql, s, tname))) { + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could not bind table %s", tname); goto cleanup; } - for(i = 0; i < ncols; i++) { + for (i = 0; i < ncols; i++) { BAT *b = columns[i].b; sql_column *col = NULL; - col = mvc_bind_column(sql,t, columns[i].name); - if (!col) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not bind column %s", columns[i].name); + if (!(col = mvc_bind_column(sql, t, columns[i].name))) { + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could not bind column %s", columns[i].name); goto cleanup; } - msg = mvc_append_column(sql->session->tr, col, b); - if (msg != MAL_SUCCEED) { + if ((msg = mvc_append_column(sql->session->tr, col, b)) != MAL_SUCCEED) goto cleanup; - } } cleanup: @@ -552,8 +551,7 @@ append_to_table_from_emit(Client cntxt, return msg; /* for some reason we don't have an allocator here, so make one */ - sql->sa = sa_create(); - if (!sql->sa) { + if (!(sql->sa = sa_create())) { msg = sql_error(sql, 02, SQLSTATE(HY001) "CREATE TABLE: %s", MAL_MALLOC_FAIL); goto cleanup; } @@ -561,27 +559,23 @@ append_to_table_from_emit(Client cntxt, if (!sname) sname = "sys"; if (!(s = mvc_bind_schema(sql, sname))) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: no such schema '%s'", sname); + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: no such schema '%s'", sname); goto cleanup; } - t = mvc_bind_table(sql, s, tname); - if (!t) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not bind table %s", tname); + if (!(t = mvc_bind_table(sql, s, tname))) { + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could not bind table %s", tname); goto cleanup; } - for(i = 0; i < ncols; i++) { + for (i = 0; i < ncols; i++) { BAT *b = columns[i].b; sql_column *col = NULL; - col = mvc_bind_column(sql,t, columns[i].name); - if (!col) { - msg = sql_error(sql, 02, "3F000!CREATE TABLE: could not bind column %s", columns[i].name); + if (!(col = mvc_bind_column(sql,t, columns[i].name))) { + msg = sql_error(sql, 02, SQLSTATE(3F000) "CREATE TABLE: could not bind column %s", columns[i].name); goto cleanup; } - msg = mvc_append_column(sql->session->tr, col, b); - if (msg != MAL_SUCCEED) { + if ((msg = mvc_append_column(sql->session->tr, col, b)) != MAL_SUCCEED) goto cleanup; - } } cleanup: 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 @@ -694,7 +694,7 @@ drop_seq(mvc *sql, char *sname, char *na } static str -drop_func(mvc *sql, char *sname, char *name, sqlid fid, int type, int action) +drop_func(mvc *sql, char *sname, char *name, sqlid fid, sql_ftype type, int action) { sql_schema *s = NULL; char is_aggr = (type == F_AGGR); @@ -1391,7 +1391,7 @@ SQLdrop_function(Client cntxt, MalBlkPtr str sname = *getArgReference_str(stk, pci, 1); char *fname = *getArgReference_str(stk, pci, 2); sqlid fid = (sqlid)*getArgReference_int(stk, pci, 3); - int type = *getArgReference_int(stk, pci, 4); + sql_ftype type = (sql_ftype) *getArgReference_int(stk, pci, 4); int action = *getArgReference_int(stk, pci, 5); initcontext(); 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 @@ -82,7 +82,7 @@ sql_fix_system_tables(Client c, mvc *sql " %d, %d, %s, %s, %s, %d, %s);\n", func->base.id, func->base.name, func->imp, func->mod, FUNC_LANG_INT, - func->type, + (int) func->type, func->side_effect ? "true" : "false", func->varres ? "true" : "false", func->vararg ? "true" : "false", @@ -149,7 +149,7 @@ sql_fix_system_tables(Client c, mvc *sql " (%d, '%s', '%s', '%s', %d, %d, false," " %s, %s, %d, %s);\n", aggr->base.id, aggr->base.name, aggr->imp, - aggr->mod, FUNC_LANG_INT, aggr->type, + aggr->mod, FUNC_LANG_INT, (int) aggr->type, aggr->varres ? "true" : "false", aggr->vararg ? "true" : "false", aggr->s ? aggr->s->base.id : s->base.id, @@ -1527,13 +1527,13 @@ sql_update_apr2019(Client c, mvc *sql) "returns timestamp\n" "external name sql.date_trunc;\n" "grant execute on function sys.date_trunc(string, timestamp) to public;\n" - "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'date_trunc' and type = %d;\n", F_FUNC); + "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'date_trunc' and type = %d;\n", (int) F_FUNC); /* 22_clients.sql */ pos += snprintf(buf + pos, bufsize - pos, "create procedure sys.setprinttimeout(\"timeout\" integer)\n" "external name clients.setprinttimeout;\n" - "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'setprinttimeout' and type = %d;\n", F_PROC); + "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys') and name = 'setprinttimeout' and type = %d;\n", (int) F_PROC); /* 26_sysmon.sql */ pos += snprintf(buf + pos, bufsize - pos, @@ -1903,13 +1903,13 @@ sql_update_storagemodel(Client c, mvc *s " and name in ('storage', 'tablestorage', 'schemastorage', 'storagemodelinput', 'storagemodel', 'tablestoragemodel');\n"); pos += snprintf(buf + pos, bufsize - pos, "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys')" - " and name in ('storage') and type = %d;\n", F_UNION); + " and name in ('storage') and type = %d;\n", (int) F_UNION); pos += snprintf(buf + pos, bufsize - pos, "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys')" - " and name in ('storagemodelinit') and type = %d;\n", F_PROC); + " and name in ('storagemodelinit') and type = %d;\n", (int) F_PROC); pos += snprintf(buf + pos, bufsize - pos, "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys')" - " and name in ('columnsize', 'heapsize', 'hashsize', 'imprintsize') and type = %d;\n", F_FUNC); + " and name in ('columnsize', 'heapsize', 'hashsize', 'imprintsize') and type = %d;\n", (int) F_FUNC); if (schema) pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", schema); @@ -2005,7 +2005,7 @@ sql_update_deltas(Client c, mvc *sql) " returns table (\"id\" int, \"cleared\" boolean, \"immutable\" bigint, \"inserted\" bigint, \"updates\" bigint, \"deletes\" bigint, \"level\" int)" " external name \"sql\".\"deltas\";\n" "update sys.functions set system = true where schema_id = (select id from sys.schemas where name = 'sys')" - " and name in ('deltas') and type = %d;\n", F_UNION); + " and name in ('deltas') and type = %d;\n", (int) F_UNION); if (schema) pos += snprintf(buf + pos, bufsize - pos, "set schema \"%s\";\n", schema); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list