Changeset: 00c3b5eaa572 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=00c3b5eaa572 Modified Files: sql/backends/monet5/sql_user.c sql/server/rel_updates.c sql/server/sql_privileges.c Branch: nospare Log Message:
merged with default diffs (truncated from 647 to 300 lines): diff --git a/documentation/source/developers_handbook.rst b/documentation/source/developers_handbook.rst --- a/documentation/source/developers_handbook.rst +++ b/documentation/source/developers_handbook.rst @@ -100,4 +100,21 @@ index ``All`` file. Python tests API ---------------- -See many of the examples in ``sql/test/Users/Tests``. +We are using ``pymonetdb`` client in our testing infrastructure heavily. All .py tests needs to log errors in ``stderror`` +and exit abnormally if failure is present. To ease up writing testing scripts the ``SQLTestCase`` class from ``MonetDBtesting`` +module can be utilized. Following is an example of the ``SQLTestCase`` API:: + + from MonetDBtesting.sqltest import SQLTestCase + + from decimal import Decimal + + with SQLTestCase() as tc: + # using default connection context + tc.connect() + # insert into non-existing table + tc.execute('insert into foo values (888.42), (444.42);').assertFailed(err_code='42S02') + tc.execute('create table foo (salary decimal(10,2));').assertSucceeded() + tc.execute('insert into foo values (888.42), (444.42);').assertSucceeded().assertRowCount(2) + tc.execute('select * from foo;').assertSucceeded().assertDataResultMatch([(Decimal('888.42'),), (Decimal('444.42'),)]) + +For more examples check out tests in ``sql/test/Users/Tests``. diff --git a/sql/backends/monet5/sql_user.c b/sql/backends/monet5/sql_user.c --- a/sql/backends/monet5/sql_user.c +++ b/sql/backends/monet5/sql_user.c @@ -35,7 +35,7 @@ monet5_drop_user(ptr _mvc, str user) str err; Client c = MCgetClient(m->clientid); - int grant_user = c->user; + oid grant_user = c->user; c->user = MAL_ADMIN; err = AUTHremoveUser(c, user); c->user = grant_user; @@ -166,7 +166,7 @@ monet5_create_user(ptr _mvc, str user, s pwd = passwd; } /* add the user to the M5 authorisation administration */ - int grant_user = c->user; + oid grant_user = c->user; c->user = MAL_ADMIN; ret = AUTHaddUser(&uid, c, user, pwd); c->user = grant_user; diff --git a/sql/server/rel_updates.c b/sql/server/rel_updates.c --- a/sql/server/rel_updates.c +++ b/sql/server/rel_updates.c @@ -1244,7 +1244,7 @@ merge_into_table(sql_query *query, dlist mvc *sql = query->sql; char *sname = qname_schema(qname), *tname = qname_schema_object(qname); sql_table *t = NULL; - sql_rel *bt, *joined, *join_rel = NULL, *extra_project, *insert = NULL, *upd_del = NULL, *res = NULL; + sql_rel *bt, *joined, *join_rel = NULL, *extra_project, *insert = NULL, *upd_del = NULL, *res = NULL, *no_tid = NULL; int processed = 0; const char *bt_name; @@ -1347,7 +1347,9 @@ merge_into_table(sql_query *query, dlist //project joined values which didn't match on the join and insert them extra_project = rel_project(sql->sa, join_rel, rel_projections(sql, joined, NULL, 1, 0)); - extra_project = rel_setop(sql->sa, rel_dup(joined), extra_project, op_except); + no_tid = rel_project(sql->sa, rel_dup(joined), rel_projections(sql, joined, NULL, 1, 0)); + extra_project = rel_setop(sql->sa, no_tid, extra_project, op_except); + rel_setop_set_exps(sql, extra_project, rel_projections(sql, extra_project, NULL, 1, 0)); if (!(insert = merge_generate_inserts(query, t, extra_project, sts->h->data.lval, sts->h->next->data.sym))) return NULL; diff --git a/sql/server/sql_privileges.c b/sql/server/sql_privileges.c --- a/sql/server/sql_privileges.c +++ b/sql/server/sql_privileges.c @@ -842,11 +842,12 @@ sql_alter_user(mvc *sql, char *user, cha if (strNil(user)) user = NULL; /* USER == NULL -> current_user */ - if (user != NULL && backend_find_user(sql, user) < 0) - throw(SQL,"sql.alter_user", SQLSTATE(42M32) "ALTER USER: no such user '%s'", user); if (!admin_privs(sql->user_id) && !admin_privs(sql->role_id) && user != NULL && strcmp(user, get_string_global_var(sql, "current_user")) != 0) throw(SQL,"sql.alter_user", SQLSTATE(M1M05) "Insufficient privileges to change user '%s'", user); + + if (user != NULL && backend_find_user(sql, user) < 0) + throw(SQL,"sql.alter_user", SQLSTATE(42M32) "ALTER USER: no such user '%s'", user); if (schema && (schema_id = sql_find_schema(sql, schema)) < 0) throw(SQL,"sql.alter_user", SQLSTATE(3F000) "ALTER USER: no such schema '%s'", schema); if (backend_alter_user(sql, user, passwd, enc, schema_id, schema_path, oldpasswd) == FALSE) @@ -857,13 +858,13 @@ sql_alter_user(mvc *sql, char *user, cha char * sql_rename_user(mvc *sql, char *olduser, char *newuser) { + if (!admin_privs(sql->user_id) && !admin_privs(sql->role_id)) + throw(SQL,"sql.rename_user", SQLSTATE(M1M05) "ALTER USER: insufficient privileges to rename user '%s'", olduser); + if (backend_find_user(sql, olduser) < 0) throw(SQL,"sql.rename_user", SQLSTATE(42M32) "ALTER USER: no such user '%s'", olduser); if (backend_find_user(sql, newuser) >= 0) throw(SQL,"sql.rename_user", SQLSTATE(42M31) "ALTER USER: user '%s' already exists", newuser); - if (!admin_privs(sql->user_id) && !admin_privs(sql->role_id)) - throw(SQL,"sql.rename_user", SQLSTATE(M1M05) "ALTER USER: insufficient privileges to rename user '%s'", olduser); - if (backend_rename_user(sql, olduser, newuser) == FALSE) throw(SQL,"sql.rename_user", SQLSTATE(M1M05) "%s", sql->errstr); return NULL; diff --git a/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.sql b/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.sql --- a/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.sql +++ b/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.sql @@ -1,3 +1,1 @@ select cast( 1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) as bigint); - -select cast( 1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) as bigint); diff --git a/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.stable.out b/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.stable.out --- a/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.stable.out +++ b/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.stable.out @@ -68,12 +68,6 @@ stdout of test 'huge_expression_and_colu % bigint # type % 3 # length [ 101 ] -#select cast( 1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(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(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) as bigint); -% .%1 # table_name -% %1 # name -% bigint # type -% 4 # length -[ 251 ] # 16:51:10 > # 16:51:10 > Done. diff --git a/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.test b/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.test --- a/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.test +++ b/sql/test/BugDay_2005-10-06_2.9.3/Tests/huge_expression_and_column_name.SF-921173.test @@ -3,9 +3,3 @@ select cast( 1+(1+(1+(1+(1+(1+(1+(1+(1+( ---- 101 -query I rowsort -select cast( 1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1+(1)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) as bigint) ----- -251 - - diff --git a/sql/test/BugTracker-2020/Tests/All b/sql/test/BugTracker-2020/Tests/All --- a/sql/test/BugTracker-2020/Tests/All +++ b/sql/test/BugTracker-2020/Tests/All @@ -42,4 +42,5 @@ view_with_aggr_column.Bug-7023 delete-transaction-loose-inserts.Bug-7024 revokeRoleUserLoggedIN.Bug-7026 drop-table-with-auto_increment.Bug-7030 +HAVE_PYMONETDB?dbfarm-foreign-chars.Bug-7031 user-update-privs.Bug-7035 diff --git a/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.py b/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.py new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.py @@ -0,0 +1,32 @@ +import sys, os, socket, tempfile, pymonetdb + +try: + from MonetDBtesting import process +except ImportError: + import process + +def freeport(): + sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sock.bind(('', 0)) + port = sock.getsockname()[1] + sock.close() + return port + +with tempfile.TemporaryDirectory() as farm_dir: + mypath = os.path.join(farm_dir, '进起都家', 'myserver','mynode') + os.makedirs(mypath) + + prt = freeport() + with process.server(mapiport=prt, dbname='mynode', dbfarm=mypath, + stdin=process.PIPE, stdout=process.PIPE, + stderr=process.PIPE) as prc: + conn = pymonetdb.connect(database='mynode', port=prt, autocommit=True) + cur = conn.cursor() + + cur.execute('SELECT \'进起都家\';') + if cur.fetchall() != [('进起都家',)]: + sys.stderr.write("'进起都家' expected") + + cur.close() + conn.close() + prc.communicate() diff --git a/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.stable.err b/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.stable.err @@ -0,0 +1,12 @@ +stderr of test 'dbfarm-foreign-chars.Bug-7031` in directory 'sql/test/BugTracker-2020` itself: + + +# 10:13:05 > +# 10:13:05 > "/usr/bin/python3.9" "dbfarm-foreign-chars.Bug-7031.py" "dbfarm-foreign-chars.Bug-7031" +# 10:13:05 > + + +# 10:13:07 > +# 10:13:07 > "Done." +# 10:13:07 > + diff --git a/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.stable.out b/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2020/Tests/dbfarm-foreign-chars.Bug-7031.stable.out @@ -0,0 +1,12 @@ +stdout of test 'dbfarm-foreign-chars.Bug-7031` in directory 'sql/test/BugTracker-2020` itself: + + +# 10:13:05 > +# 10:13:05 > "/usr/bin/python3.9" "dbfarm-foreign-chars.Bug-7031.py" "dbfarm-foreign-chars.Bug-7031" +# 10:13:05 > + + +# 10:13:07 > +# 10:13:07 > "Done." +# 10:13:07 > + diff --git a/sql/test/SQLancer/Tests/sqlancer09.sql b/sql/test/SQLancer/Tests/sqlancer09.sql --- a/sql/test/SQLancer/Tests/sqlancer09.sql +++ b/sql/test/SQLancer/Tests/sqlancer09.sql @@ -19,3 +19,56 @@ CREATE TABLE "t0" ("tc0" TINYINT NOT NUL update t0 set tc2 = 119, tc0 = cast(t0.tc0 as bigint); update t0 set tc2 = 119, tc0 = (least(+ (cast(least(0, t0.tc0) as bigint)), sign(scale_down(100, 1)))) where true; ROLLBACK; + +START TRANSACTION; +CREATE TABLE "sys"."t0" ("c0" TIMESTAMP NOT NULL,"c1" DOUBLE,CONSTRAINT "t0_c0_pkey" PRIMARY KEY ("c0"),CONSTRAINT "t0_c0_unique" UNIQUE ("c0")); +CREATE TABLE "sys"."t1" ("c0" DECIMAL(12,3)); +COPY 8 RECORDS INTO "sys"."t1" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +19522599.000 +0.638 +0.071 +12.000 +0.156 +0.902 +-546.000 +0.603 + +CREATE TABLE "sys"."t2" ("c0" TIMESTAMP,"c1" DOUBLE); +COPY 2 RECORDS INTO "sys"."t2" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +NULL -869912003 +NULL 0.9641209077369987 + +create view v0(vc0) as (with cte0(c0) as (with cte0(c0,c1) as (values (interval '2' day, ((null)%(0.3)))), +cte1(c0,c1,c2,c3,c4) as (select all least(r'', r'2'), date '1970-01-13', ((r'')ilike(r'OF먉_')), +((-2)+(-3)), cast(true as string(105)) where false) select distinct cast(case 1.1 when 0.2 then +l1cte1.c1 when 0.4 then l1cte1.c1 when 1.03728474E9 then l1cte1.c1 when 0.2 then l1cte1.c1 else l1cte1.c1 end as string) +from t0 as l1t0, t1 as l1t1,cte0 as l1cte0,cte1 as l1cte1 where not (l1cte1.c2)) select distinct least(-1, l0t0.c1) +from t1 as l0t1, t0 as l0t0,cte0 as l0cte0 where least(cast(l0cte0.c0 as boolean), true)); + +merge into t0 using (select * from v0) as v0 on true when not matched then insert (c1, c0) values ((select 1 from t1), timestamp '1970-01-20 08:57:27'); + +merge into t0 using (select * from v0) as v0 on ((r'>\nAH')not like(cast(scale_up(99, 0.1) as string(278)))) +when not matched then insert (c1, c0) values (((((abs(-5))%((select -3 from t1 as l3t1, t2 as l3t2 where true)))) +>>((((values (1), (1)))>>((select distinct 2 from t1 as l3t1 where false))))), ifthenelse(abs(0.3) = +all(values ((select all 0.1 where true)), (case -1 when -3 then 0.1 +when -2 then -5 end), (((1)>>(1)))), case when least(true, false) then greatest(timestamp '1970-01-15 21:14:28', timestamp '1970-01-02 15:11:23') end, +nullif(timestamp '1970-01-20 08:57:27', sql_add(timestamp '1970-01-07 21:19:48', interval '-3' day)))); +ROLLBACK; + +START TRANSACTION; +CREATE TABLE "sys"."t0" ("c0" TIME NOT NULL, "c1" VARCHAR(143), + CONSTRAINT "t0_c0_pkey" PRIMARY KEY ("c0"), CONSTRAINT "t0_c0_unique" UNIQUE ("c0"), CONSTRAINT "t0_c1_unique" UNIQUE ("c1")); +COPY 7 RECORDS INTO "sys"."t0" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +21:19:08 "" +13:02:49 NULL +01:02:11 NULL +16:34:25 NULL +12:11:43 NULL +10:35:38 NULL +04:26:50 NULL + +CREATE TABLE "sys"."t1" ("c0" CHAR(375) NOT NULL, CONSTRAINT "t1_c0_pkey" PRIMARY KEY ("c0"), CONSTRAINT "t1_c0_fkey" FOREIGN KEY ("c0") REFERENCES "sys"."t0" ("c1")); +insert into t1 values (''); +insert into t1(c0) values ((select 'a')), ('b'); +insert into t1(c0) values(r']BW扗}FUp'), (cast((values (greatest(r'Aᨐ', r'_'))) as string(616))), (r''); +ROLLBACK; diff --git a/sql/test/SQLancer/Tests/sqlancer09.stable.out b/sql/test/SQLancer/Tests/sqlancer09.stable.out --- a/sql/test/SQLancer/Tests/sqlancer09.stable.out +++ b/sql/test/SQLancer/Tests/sqlancer09.stable.out @@ -30,6 +30,38 @@ stdout of test 'sqlancer09` in directory #update t0 set tc2 = 119, tc0 = (least(+ (cast(least(0, t0.tc0) as bigint)), sign(scale_down(100, 1)))) where true; [ 0 ] #ROLLBACK; +#START TRANSACTION; +#CREATE TABLE "sys"."t0" ("c0" TIMESTAMP NOT NULL,"c1" DOUBLE,CONSTRAINT "t0_c0_pkey" PRIMARY KEY ("c0"),CONSTRAINT "t0_c0_unique" UNIQUE ("c0")); +#CREATE TABLE "sys"."t1" ("c0" DECIMAL(18,3)); +#COPY 8 RECORDS INTO "sys"."t1" FROM stdin USING DELIMITERS E'\t',E'\n','"'; +#19522599.000 +#0.638 +#0.071 +#12.000 +#0.156 +#0.902 +#-546.000 +#0.603 _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list