MonetDB: Jul2017 - Remove duplicate libraries.
Changeset: 4af9c8a9bb37 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=4af9c8a9bb37 Modified Files: tools/merovingian/daemon/Makefile.ag Branch: Jul2017 Log Message: Remove duplicate libraries. The removed libraries are all already part of libmonetdb5.so. diffs (18 lines): diff --git a/tools/merovingian/daemon/Makefile.ag b/tools/merovingian/daemon/Makefile.ag --- a/tools/merovingian/daemon/Makefile.ag +++ b/tools/merovingian/daemon/Makefile.ag @@ -39,14 +39,8 @@ bin_monetdbd = { multiplex-funnel.c multiplex-funnel.h \ proxy.c proxy.h LIBS = ../utils/libmeroutil \ - ../../../common/stream/libstream \ - ../../../clients/mapilib/libmapi \ - ../../../common/utils/libmcrypt \ - ../../../common/utils/libmsabaoth \ - ../../../common/utils/libmuuid \ ../../../common/utils/libmutils \ ../../../monetdb5/tools/libmonetdb5 \ - ../../../gdk/libbat \ $(UUID_LIBS) \ $(openssl_LIBS) \ $(curl_LIBS) \ ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Be clear about which version of python-pymone...
Changeset: 930a728f591e for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=930a728f591e Modified Files: MonetDB.spec debian/control Branch: Jul2017 Log Message: Be clear about which version of python-pymonetdb we can work with. diffs (41 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -407,7 +407,7 @@ Recommends: perl-DBD-monetdb >= 1.0 Recommends: php-monetdb >= 1.0 %endif Requires: %{name}-SQL-server5%{?_isa} = %{version}-%{release} -Requires: python-pymonetdb >= 1.0 +Requires: python-pymonetdb >= 1.0.6 %description client-tests MonetDB is a database management system that is developed from a @@ -591,6 +591,8 @@ Recommends: MonetDB5-server-hugeint%{?_i %endif Suggests: %{name}-client%{?_isa} = %{version}-%{release} %endif +# versions up to 1.0.5 don't accept the queryid field in the result set +Conflicts: python-pymonetdb < 1.0.6 %description -n MonetDB5-server MonetDB is a database management system that is developed from a diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -137,7 +137,7 @@ Depends: ${shlibs:Depends}, libmonetdb-c monetdb5-server (= ${source:Version}), libdbd-monetdb-perl (>= 1.0), php-monetdb (>= 1.0), - python-pymonetdb (>= 1.0), + python-pymonetdb (>= 1.0.6), monetdb5-sql (= ${source:Version}) Description: MonetDB client testing tools MonetDB is a database management system that is developed from a @@ -196,6 +196,7 @@ Depends: ${shlibs:Depends}, ${misc:Depen Recommends: monetdb5-server-hugeint (= ${source:Version}) [amd64], monetdb5-sql (= ${source:Version}) Suggests: monetdb-client (= ${source:Version}) +Conflicts: python-pymonetdb (<< 1.0.6) Description: MonetDB database server version 5 MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Merge with Dec2016 branch.
Changeset: 1be39f94c722 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1be39f94c722 Modified Files: monetdb5/modules/mal/remote.c Branch: Jul2017 Log Message: Merge with Dec2016 branch. diffs (50 lines): diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c --- a/monetdb5/modules/mal/remote.c +++ b/monetdb5/modules/mal/remote.c @@ -748,31 +748,38 @@ str RMTput(Client cntxt, MalBlkPtr mb, M } mapi_close_handle(mhdl); } else { + int l = 0; str val = NULL; char *tpe; - char qbuf[BUFSIZ + 1]; /* FIXME: this should be dynamic */ + char qbuf[BUFSIZ + 1], *nbuf = qbuf; if (ATOMvarsized(type)) { - ATOMformat(type, *(str *)value, &val); + l = ATOMformat(type, *(str *)value, &val); } else { - ATOMformat(type, value, &val); + l = ATOMformat(type, value, &val); } tpe = getTypeIdentifier(type); + l += strlen(tpe) + strlen(ident) + 10; + if (l > BUFSIZ) + nbuf = GDKmalloc(l); if (type <= TYPE_str) - snprintf(qbuf, BUFSIZ, "%s := %s:%s;\n", ident, val, tpe); + snprintf(nbuf, l, "%s := %s:%s;\n", ident, val, tpe); else - snprintf(qbuf, BUFSIZ, "%s := \"%s\":%s;\n", ident, val, tpe); - qbuf[BUFSIZ] = '\0'; + snprintf(nbuf, l, "%s := \"%s\":%s;\n", ident, val, tpe); GDKfree(tpe); GDKfree(val); #ifdef _DEBUG_REMOTE - fprintf(stderr, "#remote.put:%s:%s\n", c->name, qbuf); + fprintf(stderr, "#remote.put:%s:%s\n", c->name, nbuf); #endif - if ((tmp = RMTquery(&mhdl, "remote.put", c->mconn, qbuf)) + if ((tmp = RMTquery(&mhdl, "remote.put", c->mconn, nbuf)) != MAL_SUCCEED) { + if (nbuf != qbuf) + GDKfree(nbuf); MT_lock_unset(&c->lock); return tmp; } + if (nbuf != qbuf) + GDKfree(nbuf); mapi_close_handle(mhdl); } MT_lock_unset(&c->lock); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Jul2017 branch.
Changeset: 438d9614c8aa for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=438d9614c8aa Modified Files: MonetDB.spec debian/control monetdb5/modules/mal/Tests/inspect00.stable.out monetdb5/modules/mal/remote.c tools/merovingian/daemon/Makefile.ag Branch: default Log Message: Merge with Jul2017 branch. diffs (123 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -407,7 +407,7 @@ Recommends: perl-DBD-monetdb >= 1.0 Recommends: php-monetdb >= 1.0 %endif Requires: %{name}-SQL-server5%{?_isa} = %{version}-%{release} -Requires: python-pymonetdb >= 1.0 +Requires: python-pymonetdb >= 1.0.6 %description client-tests MonetDB is a database management system that is developed from a @@ -591,6 +591,8 @@ Recommends: MonetDB5-server-hugeint%{?_i %endif Suggests: %{name}-client%{?_isa} = %{version}-%{release} %endif +# versions up to 1.0.5 don't accept the queryid field in the result set +Conflicts: python-pymonetdb < 1.0.6 %description -n MonetDB5-server MonetDB is a database management system that is developed from a diff --git a/debian/control b/debian/control --- a/debian/control +++ b/debian/control @@ -137,7 +137,7 @@ Depends: ${shlibs:Depends}, libmonetdb-c monetdb5-server (= ${source:Version}), libdbd-monetdb-perl (>= 1.0), php-monetdb (>= 1.0), - python-pymonetdb (>= 1.0), + python-pymonetdb (>= 1.0.6), monetdb5-sql (= ${source:Version}) Description: MonetDB client testing tools MonetDB is a database management system that is developed from a @@ -196,6 +196,7 @@ Depends: ${shlibs:Depends}, ${misc:Depen Recommends: monetdb5-server-hugeint (= ${source:Version}) [amd64], monetdb5-sql (= ${source:Version}) Suggests: monetdb-client (= ${source:Version}) +Conflicts: python-pymonetdb (<< 1.0.6) Description: MonetDB database server version 5 MonetDB is a database management system that is developed from a main-memory perspective with use of a fully decomposed storage model, diff --git a/monetdb5/modules/mal/Tests/inspect00.stable.out b/monetdb5/modules/mal/Tests/inspect00.stable.out --- a/monetdb5/modules/mal/Tests/inspect00.stable.out +++ b/monetdb5/modules/mal/Tests/inspect00.stable.out @@ -45,8 +45,8 @@ stack depth 2 [ 4@0, "h","" ] [ 5@0, "t","" ] [ 6@0, "X_2", "0@0" ] -[ 7@0, "b0", "" ] -[ 8@0, "b1", "" ] +[ 7@0, "b0", "nil" ] +[ 8@0, "b1", "nil" ] [ 9@0, "X_3", "0" ] [ 10@0,"X_4", "0@0" ] [ 11@0, "c0", "nil" ] diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c --- a/monetdb5/modules/mal/remote.c +++ b/monetdb5/modules/mal/remote.c @@ -748,31 +748,38 @@ str RMTput(Client cntxt, MalBlkPtr mb, M } mapi_close_handle(mhdl); } else { + int l = 0; str val = NULL; char *tpe; - char qbuf[BUFSIZ + 1]; /* FIXME: this should be dynamic */ + char qbuf[BUFSIZ + 1], *nbuf = qbuf; if (ATOMvarsized(type)) { - ATOMformat(type, *(str *)value, &val); + l = ATOMformat(type, *(str *)value, &val); } else { - ATOMformat(type, value, &val); + l = ATOMformat(type, value, &val); } tpe = getTypeIdentifier(type); + l += strlen(tpe) + strlen(ident) + 10; + if (l > BUFSIZ) + nbuf = GDKmalloc(l); if (type <= TYPE_str) - snprintf(qbuf, BUFSIZ, "%s := %s:%s;\n", ident, val, tpe); + snprintf(nbuf, l, "%s := %s:%s;\n", ident, val, tpe); else - snprintf(qbuf, BUFSIZ, "%s := \"%s\":%s;\n", ident, val, tpe); - qbuf[BUFSIZ] = '\0'; + snprintf(nbuf, l, "%s := \"%s\":%s;\n", ident, val, tpe); GDKfree(tpe); GDKfree(val); #ifdef _DEBUG_REMOTE - fprintf(stderr, "#remote.put:%s:%s\n", c->name, qbuf); + fprintf(stderr, "#remote.put:%s:%s\n", c->name, nbuf); #endif - if ((tmp = RMTquery(&mhdl, "remote.put", c->mconn, qbuf)) + if ((tmp = RMTquery(&mhdl, "remote.put", c->mconn, nbuf)) != MAL_SUCCEED) { + if (nbuf != qbuf) + GDKfree(nbuf); MT_lock_unset(&c->lock); return tmp; } + if (nbuf != qbuf) + GDKfree(nbuf); mapi_close_handle(mhdl); } MT_lock_unset(&c->lock); diff --git a/tools/merovingian/daemon/Makefile.ag b/tools/merovingian/daemon/Makefile.ag --- a/tools/merovingian/daemon/Makefile.ag +++ b/tools/m
MonetDB: Jul2017 - use a changeset of 'part' information in stea...
Changeset: ec563c09d093 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ec563c09d093 Modified Files: sql/backends/monet5/sql_cat.c sql/include/sql_catalog.h sql/server/rel_distribute.c sql/server/rel_optimizer.c sql/server/rel_schema.c sql/server/rel_select.c sql/storage/store.c Branch: Jul2017 Log Message: use a changeset of 'part' information in stead of directly tables. This to solve order dependence (ie is merge or replica table created before or after the partition/member). This solves bug 6328 diffs (truncated from 740 to 300 lines): 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 @@ -114,7 +114,7 @@ alter_table_add_table(mvc *sql, char *ms return sql_message("42S02!ALTER TABLE: cannot add table '%s.%s' to table '%s.%s'", psname, ptname, msname, mtname); if (mt && pt) { char *msg; - node *n = cs_find_id(&mt->tables, pt->base.id); + node *n = cs_find_id(&mt->members, pt->base.id); if (n) return sql_message("42S02!ALTER TABLE: table '%s.%s' is already part of the MERGE TABLE '%s.%s'", psname, ptname, msname, mtname); @@ -142,7 +142,7 @@ alter_table_del_table(mvc *sql, char *ms if (mt && pt) { node *n = NULL; - if (!pt || (n = cs_find_id(&mt->tables, pt->base.id)) == NULL) + if (!pt || (n = cs_find_id(&mt->members, pt->base.id)) == NULL) return sql_message("42S02!ALTER TABLE: table '%s.%s' isn't part of the MERGE TABLE '%s.%s'", psname, ptname, msname, mtname); sql_trans_del_table(sql->session->tr, mt, pt, drop_action); diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h --- a/sql/include/sql_catalog.h +++ b/sql/include/sql_catalog.h @@ -489,6 +489,11 @@ typedef enum table_types { #define TABLE_READONLY 1 #define TABLE_APPENDONLY 2 +typedef struct sql_part { + sql_base base; + struct sql_table *t; /* cached value */ +} sql_part; + typedef struct sql_table { sql_base base; sht type; /* table, view, etc */ @@ -504,7 +509,7 @@ typedef struct sql_table { changeset idxs; changeset keys; changeset triggers; - changeset tables; + changeset members; int drop_action;/* only needed for alter drop table */ int cleared;/* cleared in the current transaction */ diff --git a/sql/server/rel_distribute.c b/sql/server/rel_distribute.c --- a/sql/server/rel_distribute.c +++ b/sql/server/rel_distribute.c @@ -70,9 +70,10 @@ has_remote_or_replica( sql_rel *rel ) } static sql_rel * -rewrite_replica( mvc *sql, sql_rel *rel, sql_table *t, sql_table *p, int remote_prop) +rewrite_replica( mvc *sql, sql_rel *rel, sql_table *t, sql_part *pd, int remote_prop) { node *n, *m; + sql_table *p = find_sql_table(t->s, pd->base.name); sql_rel *r = rel_basetable(sql, p, t->base.name); for (n = rel->exps->h, m = r->exps->h; n && m; n = n->next, m = m->next) { @@ -120,19 +121,20 @@ replica(mvc *sql, sql_rel *rel, char *ur if (uri) { /* replace by the replica which matches the uri */ - for (n = t->tables.set->h; n; n = n->next) { - sql_table *p = n->data; + for (n = t->members.set->h; n; n = n->next) { + sql_part *p = n->data; + sql_table *pt = find_sql_table(t->s, p->base.name); - if (isRemote(p) && strcmp(uri, p->query) == 0) { + if (isRemote(pt) && strcmp(uri, pt->query) == 0) { rel = rewrite_replica(sql, rel, t, p, 0); break; } } } else { /* no match, use first */ - sql_table *p = NULL; + sql_part *p = NULL; - if (t->tables.set) { - p = t->tables.set->h->data; + if (t->members.set) { + p = t->members.set->h->data; rel = rewrite_replica(sql, rel, t, p, 1); } else { rel = NULL; 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 @@ -80,7 +80,7 @@ name_find_column( sql_rel *rel, char *rn
MonetDB: Dec2016 - Add a cast.
Changeset: ff6d5c3ae64c for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ff6d5c3ae64c Modified Files: monetdb5/modules/mal/remote.c Branch: Dec2016 Log Message: Add a cast. diffs (12 lines): diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c --- a/monetdb5/modules/mal/remote.c +++ b/monetdb5/modules/mal/remote.c @@ -747,7 +747,7 @@ str RMTput(Client cntxt, MalBlkPtr mb, M l = ATOMformat(type, value, &val); } tpe = getTypeIdentifier(type); - l += strlen(tpe) + strlen(ident) + 10; + l += (int) (strlen(tpe) + strlen(ident) + 10); if (l > BUFSIZ) nbuf = GDKmalloc(l); if (type <= TYPE_str) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Merge with Dec2016 branch.
Changeset: cc521978dbff for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cc521978dbff Modified Files: monetdb5/modules/mal/remote.c Branch: Jul2017 Log Message: Merge with Dec2016 branch. diffs (12 lines): diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c --- a/monetdb5/modules/mal/remote.c +++ b/monetdb5/modules/mal/remote.c @@ -758,7 +758,7 @@ str RMTput(Client cntxt, MalBlkPtr mb, M l = ATOMformat(type, value, &val); } tpe = getTypeIdentifier(type); - l += strlen(tpe) + strlen(ident) + 10; + l += (int) (strlen(tpe) + strlen(ident) + 10); if (l > BUFSIZ) nbuf = GDKmalloc(l); if (type <= TYPE_str) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: default - Merge with Jul2017 branch.
Changeset: fd7a445210e8 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fd7a445210e8 Modified Files: monetdb5/modules/mal/remote.c sql/backends/monet5/sql_cat.c sql/include/sql_catalog.h sql/server/rel_distribute.c sql/server/rel_optimizer.c sql/server/rel_schema.c sql/server/rel_select.c sql/storage/store.c Branch: default Log Message: Merge with Jul2017 branch. diffs (truncated from 752 to 300 lines): diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c --- a/monetdb5/modules/mal/remote.c +++ b/monetdb5/modules/mal/remote.c @@ -758,7 +758,7 @@ str RMTput(Client cntxt, MalBlkPtr mb, M l = ATOMformat(type, value, &val); } tpe = getTypeIdentifier(type); - l += strlen(tpe) + strlen(ident) + 10; + l += (int) (strlen(tpe) + strlen(ident) + 10); if (l > BUFSIZ) nbuf = GDKmalloc(l); if (type <= TYPE_str) 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 @@ -114,7 +114,7 @@ alter_table_add_table(mvc *sql, char *ms return sql_message("42S02!ALTER TABLE: cannot add table '%s.%s' to table '%s.%s'", psname, ptname, msname, mtname); if (mt && pt) { char *msg; - node *n = cs_find_id(&mt->tables, pt->base.id); + node *n = cs_find_id(&mt->members, pt->base.id); if (n) return sql_message("42S02!ALTER TABLE: table '%s.%s' is already part of the MERGE TABLE '%s.%s'", psname, ptname, msname, mtname); @@ -142,7 +142,7 @@ alter_table_del_table(mvc *sql, char *ms if (mt && pt) { node *n = NULL; - if (!pt || (n = cs_find_id(&mt->tables, pt->base.id)) == NULL) + if (!pt || (n = cs_find_id(&mt->members, pt->base.id)) == NULL) return sql_message("42S02!ALTER TABLE: table '%s.%s' isn't part of the MERGE TABLE '%s.%s'", psname, ptname, msname, mtname); sql_trans_del_table(sql->session->tr, mt, pt, drop_action); diff --git a/sql/include/sql_catalog.h b/sql/include/sql_catalog.h --- a/sql/include/sql_catalog.h +++ b/sql/include/sql_catalog.h @@ -489,6 +489,11 @@ typedef enum table_types { #define TABLE_READONLY 1 #define TABLE_APPENDONLY 2 +typedef struct sql_part { + sql_base base; + struct sql_table *t; /* cached value */ +} sql_part; + typedef struct sql_table { sql_base base; sht type; /* table, view, etc */ @@ -504,7 +509,7 @@ typedef struct sql_table { changeset idxs; changeset keys; changeset triggers; - changeset tables; + changeset members; int drop_action;/* only needed for alter drop table */ int cleared;/* cleared in the current transaction */ diff --git a/sql/server/rel_distribute.c b/sql/server/rel_distribute.c --- a/sql/server/rel_distribute.c +++ b/sql/server/rel_distribute.c @@ -70,9 +70,10 @@ has_remote_or_replica( sql_rel *rel ) } static sql_rel * -rewrite_replica( mvc *sql, sql_rel *rel, sql_table *t, sql_table *p, int remote_prop) +rewrite_replica( mvc *sql, sql_rel *rel, sql_table *t, sql_part *pd, int remote_prop) { node *n, *m; + sql_table *p = find_sql_table(t->s, pd->base.name); sql_rel *r = rel_basetable(sql, p, t->base.name); for (n = rel->exps->h, m = r->exps->h; n && m; n = n->next, m = m->next) { @@ -120,19 +121,20 @@ replica(mvc *sql, sql_rel *rel, char *ur if (uri) { /* replace by the replica which matches the uri */ - for (n = t->tables.set->h; n; n = n->next) { - sql_table *p = n->data; + for (n = t->members.set->h; n; n = n->next) { + sql_part *p = n->data; + sql_table *pt = find_sql_table(t->s, p->base.name); - if (isRemote(p) && strcmp(uri, p->query) == 0) { + if (isRemote(pt) && strcmp(uri, pt->query) == 0) { rel = rewrite_replica(sql, rel, t, p, 0); break; } } } else { /* no match, use first */ - sql_table *p = NULL; + sql_part *p = NULL; - if (t->tables.set) { - p = t->tables.set->h->data; + if (t->members.set) { +
MonetDB: data-vaults - Merge with default
Changeset: a370b6c9c27d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a370b6c9c27d Added Files: sql/backends/monet5/Tests/pyapi34.sql sql/backends/monet5/Tests/pyapi34.stable.err sql/backends/monet5/Tests/pyapi34.stable.out sql/test/BugTracker-2017/Tests/crash-dce.Bug-6330.stable.out.int128 sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out.int128 sql/test/BugTracker-2017/Tests/default-insert-update.Bug-6249.sql sql/test/BugTracker-2017/Tests/default-insert-update.Bug-6249.stable.err sql/test/BugTracker-2017/Tests/default-insert-update.Bug-6249.stable.out Removed Files: NT/updatecodes.py sql/test/pg_regress/Tests/oid.stable.out.oid32 sql/test/pg_regress/Tests/without_oid.stable.out.oid32 Modified Files: gdk/gdk_hash.c gdk/gdk_imprints.c geom/monetdb5/geom_upgrade.c monetdb5/optimizer/opt_mergetable.c sql/backends/monet5/Tests/All sql/backends/monet5/UDF/pyapi/connection.c sql/backends/monet5/UDF/pyapi/conversion.c sql/backends/monet5/UDF/pyapi/emit.c sql/backends/monet5/UDF/pyapi/pyheader.h sql/backends/monet5/UDF/pyapi/pytypes.c sql/backends/monet5/UDF/pyapi/pytypes.h sql/backends/monet5/UDF/pyapi/type_conversion.c sql/backends/monet5/UDF/pyapi/type_conversion.h sql/backends/monet5/sql_execute.c sql/backends/monet5/sql_gencode.c sql/backends/monet5/sql_upgrades.c sql/server/rel_dump.c sql/server/rel_exp.c sql/server/rel_exp.h sql/server/rel_optimizer.c sql/server/rel_schema.c sql/server/rel_updates.c sql/server/sql_parser.y sql/storage/bat/bat_table.c sql/storage/store.c sql/test/BugTracker-2009/Tests/copy_multiple_files.SF-2902320.stable.out sql/test/BugTracker-2009/Tests/use_order_column_first.SF-2686008.stable.out sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.stable.out sql/test/BugTracker-2010/Tests/ORDER_BY_over_UNION_EXCEPT_INTERSECT.Bug-2606.stable.out sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.sql sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.stable.out sql/test/BugTracker-2011/Tests/count-count-distinct.Bug-2808.sql sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out sql/test/BugTracker-2011/Tests/crash_on_alias.Bug-2798.stable.out.int128 sql/test/BugTracker-2012/Tests/aggregate_vs_positional_column_crash.Bug-3085.sql sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.sql sql/test/BugTracker-2012/Tests/predicate_select.Bug-3090.stable.out sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.sql sql/test/BugTracker-2013/Tests/qualified_aggrname.Bug-3332.stable.out sql/test/BugTracker-2013/Tests/rangejoin_optimizer.Bug-3411.stable.out sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.sql sql/test/BugTracker-2013/Tests/swapped_likejoin.Bug-3375.stable.out sql/test/BugTracker-2014/Tests/select-having.Bug-3458.sql sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.sql sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.stable.out sql/test/BugTracker-2015/Tests/crash.Bug-3736.stable.out sql/test/BugTracker-2015/Tests/large_join.Bug-3809.stable.out sql/test/BugTracker-2015/Tests/quantile_function_resolution.Bug-3773.stable.out sql/test/BugTracker-2015/Tests/schema_view.Bug-3708.stable.out sql/test/BugTracker-2016/Tests/memory-consumption-query-PLAN-25joins.Bug-3972.stable.out sql/test/BugTracker-2016/Tests/merge_project.Bug-3955.stable.out sql/test/BugTracker-2017/Tests/All sql/test/BugTracker-2017/Tests/crash-dce.Bug-6330.stable.err sql/test/BugTracker-2017/Tests/crash-dce.Bug-6330.stable.out sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.err sql/test/BugTracker-2017/Tests/crash-select_after_MAL_error.Bug-6332.stable.out sql/test/BugTracker-2017/Tests/nestedoperators.Bug-6292.stable.err sql/test/BugTracker/Tests/explain.SF-1739353.stable.out sql/test/BugTracker/Tests/jdbc_no_debug.SF-1739356.stable.out sql/test/Tests/order_by_complex_exp.stable.out sql/test/bugs/Tests/crash_order_by.sql sql/test/bugs/Tests/simple_view.sql sql/test/bugs/insert_delete-bug-sf-904025.sql sql/test/emptydb-upgrade-chain-hge/Tests/check.stable.out.int128 sql/test/emptydb-upgrade-chain/Tests/check.stable.out sql/test/emptydb-upgrade-chain/Tests/check.stable.out.32bit sql/test/emptydb-upgrade-chain/Tests/check.stable.out.int128 sql/test/emptydb-upgrade-hge/Tests/check.stable.out.int128 sql/test/emptydb-upgrade/Tests/check.stable.out
MonetDB: data-vaults - Merge with default
Changeset: bb59e476567d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bb59e476567d Modified Files: sql/storage/bat/bat_table.c Branch: data-vaults Log Message: Merge with default diffs (14 lines): diff --git a/sql/storage/bat/bat_table.c b/sql/storage/bat/bat_table.c --- a/sql/storage/bat/bat_table.c +++ b/sql/storage/bat/bat_table.c @@ -243,9 +243,9 @@ table_insert(sql_trans *tr, sql_table *t va_start(va, t); for (; n; n = n->next) { + sql_column *c = n->data; val = va_arg(va, void *); if (!val) break; - sql_column *c = n->data; store_funcs.append_col(tr, c, val, c->type.type->localtype); cnt++; } ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jul2017 - Do some error checking and reduce size of buf...
Changeset: 0504b1b9947d for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0504b1b9947d Modified Files: monetdb5/mal/mal_type.c monetdb5/modules/mal/remote.c Branch: Jul2017 Log Message: Do some error checking and reduce size of buffer on stack. diffs (118 lines): diff --git a/monetdb5/mal/mal_type.c b/monetdb5/mal/mal_type.c --- a/monetdb5/mal/mal_type.c +++ b/monetdb5/mal/mal_type.c @@ -64,11 +64,14 @@ str getTypeIdentifier(malType tpe){ str s,t,v; s= getTypeName(tpe); + if (s == NULL) + return NULL; for ( t=s; *t; t++) if ( !isalnum((int) *t) ) *t='_'; t--; - if (*t == '_') *t = 0; + if (*t == '_') + *t = 0; for (v=s, t=s+1; *t; t++){ if ( !(*t == '_' && *v == '_' ) ) *++v = *t; diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c --- a/monetdb5/modules/mal/remote.c +++ b/monetdb5/modules/mal/remote.c @@ -355,6 +355,8 @@ RMTgetId(char *buf, MalBlkPtr mb, InstrP if (mod == NULL) mod = "user"; rt = getTypeIdentifier(getArgType(mb,p,arg)); + if (rt == NULL) + throw(MAL, "remote.put", MAL_MALLOC_FAIL); snprintf(buf, BUFSIZ, "rmt%d_%s_%s", idtag++, var, rt); @@ -490,6 +492,8 @@ str RMTget(Client cntxt, MalBlkPtr mb, M Since the put() encodes the type as known to the remote site we can simple compare it here */ rt = getTypeIdentifier(rtype); + if (rt == NULL) + throw(MAL, "remote.get", MAL_MALLOC_FAIL); if (strcmp(ident + strlen(ident) - strlen(rt), rt)) { tmp = createException(MAL, "remote.get", ILLEGAL_ARGUMENT ": remote object type %s does not match expected type %s", @@ -678,7 +682,11 @@ str RMTput(Client cntxt, MalBlkPtr mb, M MT_lock_set(&c->lock); /* get a free, typed identifier for the remote host */ - RMTgetId(ident, mb, pci, 2); + tmp = RMTgetId(ident, mb, pci, 2); + if (tmp != MAL_SUCCEED) { + MT_lock_unset(&c->lock); + return tmp; + } /* depending on the input object generate actions to store the * object remotely*/ @@ -701,6 +709,10 @@ str RMTput(Client cntxt, MalBlkPtr mb, M stream *sout; tail = getTypeIdentifier(getBatType(type)); + if (tail == NULL) { + MT_lock_unset(&c->lock); + throw(MAL, "remote.put", MAL_MALLOC_FAIL); + } bid = *(bat *)value; if (bid != 0) { @@ -751,16 +763,29 @@ str RMTput(Client cntxt, MalBlkPtr mb, M int l = 0; str val = NULL; char *tpe; - char qbuf[BUFSIZ + 1], *nbuf = qbuf; + char qbuf[512], *nbuf = qbuf; if (ATOMvarsized(type)) { l = ATOMformat(type, *(str *)value, &val); } else { l = ATOMformat(type, value, &val); } + if (l < 0) { + MT_lock_unset(&c->lock); + throw(MAL, "remote.put", GDK_EXCEPTION); + } tpe = getTypeIdentifier(type); + if (tpe == NULL) { + MT_lock_unset(&c->lock); + GDKfree(val); + throw(MAL, "remote.put", MAL_MALLOC_FAIL); + } l += (int) (strlen(tpe) + strlen(ident) + 10); - if (l > BUFSIZ) - nbuf = GDKmalloc(l); + if (l > (int) sizeof(qbuf) && (nbuf = GDKmalloc(l)) == NULL) { + MT_lock_unset(&c->lock); + GDKfree(val); + GDKfree(tpe); + throw(MAL, "remote.put", MAL_MALLOC_FAIL); + } if (type <= TYPE_str) snprintf(nbuf, l, "%s := %s:%s;\n", ident, val, tpe); else @@ -770,16 +795,13 @@ str RMTput(Client cntxt, MalBlkPtr mb, M #ifdef _DEBUG_REMOTE fprintf(stderr, "#remote.put:%s:%s\n", c->name, nbuf); #endif - if ((tmp = RMTquery(&mhdl, "remote.put", c->mconn, nbuf)) - != MAL_SUCCEED) - { - if (nbuf != qbuf) - GDKfree(nbuf); + tmp = RMTquery(&mhdl, "remote.put", c->mconn, nbuf); + if (nbuf != qbuf) + GDKfree(nbuf); + if (tmp != MAL_SUCCEED) { MT_lock_unset(&c->lock); return tmp; } - if (nbuf != qbuf) - GDKfree(nbuf); mapi_close_handle(mhdl); } MT_lock_unset(
MonetDB: default - Merge with Jul2017 branch.
Changeset: 2ef3bf163f03 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2ef3bf163f03 Modified Files: monetdb5/mal/mal_type.c monetdb5/modules/mal/remote.c Branch: default Log Message: Merge with Jul2017 branch. diffs (118 lines): diff --git a/monetdb5/mal/mal_type.c b/monetdb5/mal/mal_type.c --- a/monetdb5/mal/mal_type.c +++ b/monetdb5/mal/mal_type.c @@ -64,11 +64,14 @@ str getTypeIdentifier(malType tpe){ str s,t,v; s= getTypeName(tpe); + if (s == NULL) + return NULL; for ( t=s; *t; t++) if ( !isalnum((int) *t) ) *t='_'; t--; - if (*t == '_') *t = 0; + if (*t == '_') + *t = 0; for (v=s, t=s+1; *t; t++){ if ( !(*t == '_' && *v == '_' ) ) *++v = *t; diff --git a/monetdb5/modules/mal/remote.c b/monetdb5/modules/mal/remote.c --- a/monetdb5/modules/mal/remote.c +++ b/monetdb5/modules/mal/remote.c @@ -355,6 +355,8 @@ RMTgetId(char *buf, MalBlkPtr mb, InstrP if (mod == NULL) mod = "user"; rt = getTypeIdentifier(getArgType(mb,p,arg)); + if (rt == NULL) + throw(MAL, "remote.put", MAL_MALLOC_FAIL); snprintf(buf, BUFSIZ, "rmt%d_%s_%s", idtag++, var, rt); @@ -490,6 +492,8 @@ str RMTget(Client cntxt, MalBlkPtr mb, M Since the put() encodes the type as known to the remote site we can simple compare it here */ rt = getTypeIdentifier(rtype); + if (rt == NULL) + throw(MAL, "remote.get", MAL_MALLOC_FAIL); if (strcmp(ident + strlen(ident) - strlen(rt), rt)) { tmp = createException(MAL, "remote.get", ILLEGAL_ARGUMENT ": remote object type %s does not match expected type %s", @@ -678,7 +682,11 @@ str RMTput(Client cntxt, MalBlkPtr mb, M MT_lock_set(&c->lock); /* get a free, typed identifier for the remote host */ - RMTgetId(ident, mb, pci, 2); + tmp = RMTgetId(ident, mb, pci, 2); + if (tmp != MAL_SUCCEED) { + MT_lock_unset(&c->lock); + return tmp; + } /* depending on the input object generate actions to store the * object remotely*/ @@ -701,6 +709,10 @@ str RMTput(Client cntxt, MalBlkPtr mb, M stream *sout; tail = getTypeIdentifier(getBatType(type)); + if (tail == NULL) { + MT_lock_unset(&c->lock); + throw(MAL, "remote.put", MAL_MALLOC_FAIL); + } bid = *(bat *)value; if (bid != 0) { @@ -751,16 +763,29 @@ str RMTput(Client cntxt, MalBlkPtr mb, M int l = 0; str val = NULL; char *tpe; - char qbuf[BUFSIZ + 1], *nbuf = qbuf; + char qbuf[512], *nbuf = qbuf; if (ATOMvarsized(type)) { l = ATOMformat(type, *(str *)value, &val); } else { l = ATOMformat(type, value, &val); } + if (l < 0) { + MT_lock_unset(&c->lock); + throw(MAL, "remote.put", GDK_EXCEPTION); + } tpe = getTypeIdentifier(type); + if (tpe == NULL) { + MT_lock_unset(&c->lock); + GDKfree(val); + throw(MAL, "remote.put", MAL_MALLOC_FAIL); + } l += (int) (strlen(tpe) + strlen(ident) + 10); - if (l > BUFSIZ) - nbuf = GDKmalloc(l); + if (l > (int) sizeof(qbuf) && (nbuf = GDKmalloc(l)) == NULL) { + MT_lock_unset(&c->lock); + GDKfree(val); + GDKfree(tpe); + throw(MAL, "remote.put", MAL_MALLOC_FAIL); + } if (type <= TYPE_str) snprintf(nbuf, l, "%s := %s:%s;\n", ident, val, tpe); else @@ -770,16 +795,13 @@ str RMTput(Client cntxt, MalBlkPtr mb, M #ifdef _DEBUG_REMOTE fprintf(stderr, "#remote.put:%s:%s\n", c->name, nbuf); #endif - if ((tmp = RMTquery(&mhdl, "remote.put", c->mconn, nbuf)) - != MAL_SUCCEED) - { - if (nbuf != qbuf) - GDKfree(nbuf); + tmp = RMTquery(&mhdl, "remote.put", c->mconn, nbuf); + if (nbuf != qbuf) + GDKfree(nbuf); + if (tmp != MAL_SUCCEED) { MT_lock_unset(&c->lock); return tmp; } - if (nbuf != qbuf) - GDKfree(nbuf); mapi_close_handle(mhdl); } MT_lock_unset(&c->lock); _