Changeset: a1cdd7cf75bb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a1cdd7cf75bb Modified Files: sql/backends/monet5/sql_statement.c sql/backends/monet5/sql_statement.h sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out sql/test/BugTracker-2016/Tests/null_in_null.Bug-3900.stable.out sql/test/SQLancer/Tests/sqlancer02.stable.out Branch: default Log Message:
fixed issue with tail_type (as st_uselect2 can now also be a bit returning function) diffs (103 lines): diff --git a/sql/backends/monet5/sql_statement.c b/sql/backends/monet5/sql_statement.c --- a/sql/backends/monet5/sql_statement.c +++ b/sql/backends/monet5/sql_statement.c @@ -1826,6 +1826,7 @@ stmt_uselect2(backend *be, stmt *op1, st s->nr = getDestVar(q); s->q = q; s->cand = sub; + s->reduce = reduce; return s; } return NULL; @@ -2254,6 +2255,7 @@ stmt_join2(backend *be, stmt *l, stmt *r s->nrcols = 2; s->nr = getDestVar(q); s->q = q; + s->reduce = 1; return s; } return NULL; @@ -3511,9 +3513,8 @@ tail_type(stmt *st) case st_const: st = st->op2; continue; + case st_uselect: case st_semijoin: - case st_uselect: - case st_uselect2: case st_limit: case st_limit2: case st_sample: @@ -3521,6 +3522,10 @@ tail_type(stmt *st) case st_tdiff: case st_tinter: return sql_bind_localtype("oid"); + case st_uselect2: + if (!st->reduce) + return sql_bind_localtype("bit"); + return sql_bind_localtype("oid"); case st_append: case st_append_bulk: case st_alias: diff --git a/sql/backends/monet5/sql_statement.h b/sql/backends/monet5/sql_statement.h --- a/sql/backends/monet5/sql_statement.h +++ b/sql/backends/monet5/sql_statement.h @@ -112,10 +112,12 @@ typedef struct stmt { struct stmt *op3; stmtdata op4; /* only op4 will hold other types */ - char nrcols; - char key; /* key (aka all values are unique) */ // TODO make this thing a bool - char aggr; /* aggregated */ - char partition; /* selected as mitosis candidate */ + unsigned int + nrcols:2, + key:1, /* key (aka all values are unique) */ // TODO make this thing a bool + aggr:1, /* aggregated */ + partition:1, /* selected as mitosis candidate */ + reduce:1; /* used to reduce number of rows (also for joins) */ struct stmt *cand; /* optional candidate list */ diff --git a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out --- a/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out +++ b/sql/test/BugTracker-2012/Tests/currenttime.Bug-2781.stable.out @@ -8,8 +8,8 @@ stdout of test 'currenttime.Bug-2781` in #select localtimestamp() between (timestamp '2020-07-07 14:25:20' - interval '20' second) and (timestamp '2020-07-07 14:25:20' + interval '20' second); % .%2 # table_name % %2 # name -% oid # type -% 22 # length +% boolean # type +% 5 # length [ true ] # 09:58:28 > diff --git a/sql/test/BugTracker-2016/Tests/null_in_null.Bug-3900.stable.out b/sql/test/BugTracker-2016/Tests/null_in_null.Bug-3900.stable.out --- a/sql/test/BugTracker-2016/Tests/null_in_null.Bug-3900.stable.out +++ b/sql/test/BugTracker-2016/Tests/null_in_null.Bug-3900.stable.out @@ -43,8 +43,8 @@ stdout of test 'null_in_null.Bug-3900` i #select null between null and null; % .%2 # table_name % %2 # name -% oid # type -% 22 # length +% boolean # type +% 5 # length [ NULL ] # 21:33:36 > diff --git a/sql/test/SQLancer/Tests/sqlancer02.stable.out b/sql/test/SQLancer/Tests/sqlancer02.stable.out --- a/sql/test/SQLancer/Tests/sqlancer02.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer02.stable.out @@ -51,8 +51,8 @@ stdout of test 'sqlancer02` in directory #select i between symmetric cast(1 as decimal) and cast(2 as double) from integers; % sys.%2 # table_name % %2 # name -% oid # type -% 22 # length +% boolean # type +% 5 # length [ true ] [ true ] [ false ] _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list