Changeset: 7a011fe7677c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7a011fe7677c Modified Files: sql/storage/bat/res_table.c sql/test/BugTracker-2017/Tests/create_table_as-missing_not_null.Bug-6329.stable.out Branch: default Log Message:
Merge with Jul2017 branch. diffs (58 lines): diff --git a/sql/storage/bat/res_table.c b/sql/storage/bat/res_table.c --- a/sql/storage/bat/res_table.c +++ b/sql/storage/bat/res_table.c @@ -91,26 +91,21 @@ res_col_create(sql_trans *tr, res_table /* we need to set the order bat otherwise mvc_export_result won't work with single-row result sets containing BATs */ if (!t->order) { oid zero = 0; - BAT *o = COLnew(0, TYPE_oid, 1, TRANSIENT); + BAT *o = BATconstant(0, TYPE_oid, &zero, 1, TRANSIENT); if (o == NULL) { BBPreclaim(b); _DELETE(c->tn); _DELETE(c->name); return NULL; } - if (BUNappend(o, &zero, FALSE) != GDK_SUCCEED) { - BBPreclaim(b); - BBPreclaim(o); - _DELETE(c->tn); - _DELETE(c->name); - return NULL; - } t->order = o->batCacheid; - bat_incref(t->order); + BBPkeepref(t->order); } } c->b = b->batCacheid; bat_incref(c->b); + if (mtype != TYPE_bat) + BBPunfix(c->b); t->cur_col++; assert(t->cur_col <= t->nr_cols); return c; diff --git a/sql/test/BugTracker-2017/Tests/create_table_as-missing_not_null.Bug-6329.stable.out b/sql/test/BugTracker-2017/Tests/create_table_as-missing_not_null.Bug-6329.stable.out --- a/sql/test/BugTracker-2017/Tests/create_table_as-missing_not_null.Bug-6329.stable.out +++ b/sql/test/BugTracker-2017/Tests/create_table_as-missing_not_null.Bug-6329.stable.out @@ -74,7 +74,7 @@ CREATE TABLE "sys"."a_6329" ( #create table b_6329 as select * from a_6329 with no data; CREATE TABLE "sys"."b_6329" ( "x" INTEGER, - "y" INTEGER NOT NULL + "y" INTEGER ); #DROP TABLE a_6329; #DROP TABLE b_6329; @@ -86,9 +86,8 @@ CREATE TABLE "sys"."a_pk_6329" ( ); #create table b_pk_6329 as select * from a_pk_6329 with no data; CREATE TABLE "sys"."b_pk_6329" ( - "x" INTEGER NOT NULL, - "y" INTEGER NOT NULL, - CONSTRAINT "b_pk_6329_x_pkey" PRIMARY KEY ("x") + "x" INTEGER, + "y" INTEGER ); #DROP TABLE a_pk_6329; #DROP TABLE b_pk_6329; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list