MonetDB: Oct2020 - Some changes to the odbc install program.
Changeset: 02f0056beb5f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=02f0056beb5f Modified Files: clients/odbc/winsetup/install.c Branch: Oct2020 Log Message: Some changes to the odbc install program. Get rid of the ODBCDriverInstalled.txt file; add optional arguments giving DSN and name of driver; use Windows call to get location of program (and hence the dlls). diffs (truncated from 340 to 300 lines): diff --git a/clients/odbc/winsetup/install.c b/clients/odbc/winsetup/install.c --- a/clients/odbc/winsetup/install.c +++ b/clients/odbc/winsetup/install.c @@ -18,10 +18,10 @@ #define DLL ".dll" #endif -static char *DriverName = "MonetDB ODBC Driver"; -static char *DataSourceName = "MonetDB"; -static char *DriverDLL = "MonetODBC" DLL; -static char *DriverDLLs = "MonetODBCs" DLL; +static const char *DriverName = "MonetDB ODBC Driver"; +static const char *DataSourceName = "MonetDB"; +static const char *DriverDLL = "MonetODBC" DLL; +static const char *DriverDLLs = "MonetODBCs" DLL; /* General error handler for installer functions */ @@ -38,10 +38,10 @@ ProcessSQLErrorMessages(const char *func do { errmsg[0] = '\0'; rc = SQLInstallerError(errnr, &errcode, - errmsg, sizeof(errmsg), &errmsglen); + errmsg, sizeof(errmsg), &errmsglen); if (rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO) { MessageBox(NULL, errmsg, func, - MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND); + MB_ICONSTOP | MB_OK | MB_TASKMODAL | MB_SETFOREGROUND); func_rc = TRUE; } errnr++; @@ -55,8 +55,8 @@ ProcessSysErrorMessage(DWORD err, const char *lpMsgBuf; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & lpMsgBuf, 0, NULL); + NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) & lpMsgBuf, 0, NULL); MessageBox(NULL, (LPCTSTR) lpMsgBuf, func, MB_OK | MB_ICONINFORMATION); LocalFree(lpMsgBuf); } @@ -71,9 +71,8 @@ CheckIfFileExists(const char *filepath, } static BOOL -InstallMyDriver(const char *driverpath) +InstallMyDriver(const char *driverpath, const char *drivername) { - char driver[300]; char outpath[301]; WORD outpathlen; DWORD usagecount; @@ -82,11 +81,13 @@ InstallMyDriver(const char *driverpath) /* the correct format of driver keywords are * "DriverName\0Driver=...\xx.DLL\0Setup=...\xx.DLL\0\0" */ - snprintf(driver, sizeof(driver), -"%s;Driver=%s\\%s;Setup=%s\\%s;APILevel=1;" -"ConnectFunctions=YYY;DriverODBCVer=%s;SQLLevel=3;", -DriverName, driverpath, DriverDLL, driverpath, DriverDLLs, -MONETDB_ODBC_VER); + size_t driverlen = strlen(drivername) + 2 * strlen(driverpath) + strlen(DriverDLL) + strlen(DriverDLLs) + 90; + char *driver = malloc(driverlen); + snprintf(driver, driverlen, +"%s;Driver=%s\\%s;Setup=%s\\%s;APILevel=1;" +"ConnectFunctions=YYY;DriverODBCVer=%s;SQLLevel=3;", +drivername, driverpath, DriverDLL, driverpath, DriverDLLs, +MONETDB_ODBC_VER); for (p = driver; *p; p++) if (*p == ';') @@ -95,16 +96,19 @@ InstallMyDriver(const char *driverpath) /* call SQLInstallDriverEx to install the driver in the * registry */ if (!SQLInstallDriverEx(driver, driverpath, - outpath, sizeof(outpath), &outpathlen, - ODBC_INSTALL_COMPLETE, &usagecount) && - ProcessSQLErrorMessages("SQLInstallDriverEx")) + outpath, sizeof(outpath), &outpathlen, + ODBC_INSTALL_COMPLETE, &usagecount) && + ProcessSQLErrorMessages("SQLInstallDriverEx")) { + free(driver); return FALSE; + } + free(driver); return TRUE; } static BOOL -RemoveMyDriver() +RemoveMyDriver(const char *drivername) { char buf[300]; DWORD usagecount; @@ -114,12 +118,12 @@ RemoveMyDriver() suppposed to do, except that it consistently causes a crash, so we do it ourselves */ snprintf(buf, sizeof(buf), "SOFTWARE\\ODBC\\ODBCINST.INI\\%s", -DriverName); +drivername); valsize = sizeof(usagecount); usagecount = 0; valtype = REG_DW
MonetDB: mtest - Yet another test not correctly converted
Changeset: 052c108ece24 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=052c108ece24 Modified Files: sql/test/Tests/psm.test Branch: mtest Log Message: Yet another test not correctly converted diffs (227 lines): diff --git a/sql/test/Tests/psm.test b/sql/test/Tests/psm.test --- a/sql/test/Tests/psm.test +++ b/sql/test/Tests/psm.test @@ -1,151 +1,127 @@ -statement error +statement ok create function my_abs(v int) returns int begin if v < 0 then - return -v - -statement error + return -v; else - return v - -statement error - end if - -statement error + return v; + end if; end -statement error +statement ok create function my_abs1(v int) returns int begin if v < 0 then - return -v - -statement error - end if - -statement error - return v - -statement error + return -v; + end if; + return v; end -statement error +query I rowsort select my_abs(-1) + +1 -statement error +query I rowsort select my_abs(1) + +1 -statement error +query I rowsort select my_abs1(1) + +1 -statement error +statement ok create function my_while(v int) returns int begin while v > 0 do - set v = v - 10 - -statement error - end while - -statement error - return v - -statement error + set v = v - 10; + end while; + return v; end -statement error +query I rowsort select my_while(105) + +-5 -statement error +statement ok create function my_declare(v int) returns int begin - declare x int - -statement error - set x = v - -statement error - return x - -statement error + declare x int; + set x = v; + return x; end -statement error +query I rowsort select my_declare(105) + +105 -statement error +statement ok create function my_complex_declare(v int) returns int begin - declare x, y, z int - -statement error - declare a int, b, c varchar(10) - -statement error - set x = v - -statement error - return x - -statement error + declare x, y, z int; + declare a int, b, c varchar(10); + set x = v; + return x; end -statement error +query I rowsort select my_complex_declare(1) + +1 -statement error +statement ok create function my_case(v int) returns int begin case v - when 1 then return 100 - -statement error - when 2 then return 200 - -statement error - else return -1 - -statement error - end case - -statement error + when 1 then return 100; + when 2 then return 200; + else return -1; + end case; end -statement error +query I rowsort select my_case(1) + +100 -statement error +query I rowsort select my_case(2) + +200 -statement error +query I rowsort select my_case(3) + +-1 -statement error +statement ok create function my_searchcase(v int) returns int begin case - when v=1 then return 100 - -statement error - when v=2 then return 200 - -statement error - else return -1 - -statement error - end case - -statement error + when v=1 then return 100; + when v=2 then return 200; + else return -1; + end case; end -statement error +query I rowsort select my_searchcase(1) + +100 -statement error +query I rowsort select my_searchcase(2) + +200 -statement error +query I rowsort select my_searchcase(3) + +-1 statement ok CREATE FUNCTION fWedgeV3(x1 float,y1 float, z1 float, x2 float, y2 float, z2 float) @@ -162,3 +138,4 @@ 0.000 0.000 0.000 + ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Missed one call
Changeset: 2c63699ec66c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2c63699ec66c Modified Files: sql/test/BugTracker-2010/Tests/vacuum.test Branch: mtest Log Message: Missed one call diffs (15 lines): diff --git a/sql/test/BugTracker-2010/Tests/vacuum.test b/sql/test/BugTracker-2010/Tests/vacuum.test --- a/sql/test/BugTracker-2010/Tests/vacuum.test +++ b/sql/test/BugTracker-2010/Tests/vacuum.test @@ -14,10 +14,8 @@ select * from vac1 18 values hashing to e6a46c50bbc43408130880abcf0e7a45 -query IT rowsort +statement ok call shrink('sys','vac1') - -18 values hashing to e6a46c50bbc43408130880abcf0e7a45 query IT rowsort select * from vac1 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - More tests wrongly converted
Changeset: 638569aac49a for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=638569aac49a Modified Files: sql/backends/monet5/UDF/udf/Tests/udf-fuse.test sql/backends/monet5/UDF/udf/Tests/udf-reverse.test sql/test/BugTracker-2014/Tests/manifold.Bug-3556.test sql/test/BugTracker-2014/Tests/querylog.Bug-3607.test sql/test/BugTracker-2016/Tests/decimal_vs_integer.Bug-3941.test sql/test/BugTracker-2016/Tests/storagemodel.test sql/test/BugTracker-2017/Tests/name-interference.Bug-6348.test sql/test/BugTracker-2019/Tests/duplicates-not-eliminated-long-CASE-stmt.Bug-6697.test sql/test/BugTracker-2020/Tests/semijoin.Bug-7001.test sql/test/BugTracker-2020/Tests/values-like-join.Bug-6954.test sql/test/Tests/procedure_syntax.test sql/test/Users/Tests/sessioncontrol.test sql/test/copy/Tests/int_parse_best.test sql/test/copy/Tests/load_stdin_incorrect_line_nr.test sql/test/copy/Tests/null_as_string_errors.test sql/test/pg_regress/Tests/vacuum.test sql/test/pg_regress/Tests/without_oid.test Branch: mtest Log Message: More tests wrongly converted diffs (truncated from 1130 to 300 lines): diff --git a/sql/backends/monet5/UDF/udf/Tests/udf-fuse.test b/sql/backends/monet5/UDF/udf/Tests/udf-fuse.test --- a/sql/backends/monet5/UDF/udf/Tests/udf-fuse.test +++ b/sql/backends/monet5/UDF/udf/Tests/udf-fuse.test @@ -35,10 +35,8 @@ select fuse(1,2) 258 -query I rowsort +statement ok call profiler.stoptrace() - -258 query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.fuse%' @@ -55,20 +53,16 @@ select fuse(1,2) 258 -query I rowsort +statement ok call profiler."starttrace"() - -258 query I rowsort select fuse(1000,2000) 65538000 -query I rowsort +statement ok call profiler.stoptrace() - -65538000 query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.fuse%' @@ -85,20 +79,16 @@ select fuse(1000,2000) 65538000 -query I rowsort +statement ok call profiler."starttrace"() - -65538000 query I rowsort select fuse(100,200) 429496729800 -query I rowsort +statement ok call profiler.stoptrace() - -429496729800 query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.fuse%' @@ -115,10 +105,8 @@ select fuse(100,200) 429496729800 -query I rowsort +statement ok call profiler."starttrace"() - -429496729800 query I rowsort select fuse(a,b) from udf_fuse @@ -128,13 +116,8 @@ 1800 258 772 -query I rowsort +statement ok call profiler.stoptrace() - -1286 -1800 -258 -772 query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.fuse%' @@ -154,13 +137,8 @@ 1800 258 772 -query I rowsort +statement ok call profiler."starttrace"() - -1286 -1800 -258 -772 query I rowsort select fuse(c,d) from udf_fuse @@ -170,13 +148,8 @@ 327686000 45876 65538000 -query I rowsort +statement ok call profiler.stoptrace() - -196612000 -327686000 -45876 -65538000 query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.fuse%' @@ -196,13 +169,8 @@ 327686000 45876 65538000 -query I rowsort +statement ok call profiler."starttrace"() - -196612000 -327686000 -45876 -65538000 query I rowsort select fuse(e,f) from udf_fuse @@ -212,13 +180,8 @@ 2147483648600 3006477108000 429496729800 -query I rowsort +statement ok call profiler.stoptrace() - -1288490189200 -2147483648600 -3006477108000 -429496729800 query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.fuse%' diff --git a/sql/backends/monet5/UDF/udf/Tests/udf-reverse.test b/sql/backends/monet5/UDF/udf/Tests/udf-reverse.test --- a/sql/backends/monet5/UDF/udf/Tests/udf-reverse.test +++ b/sql/backends/monet5/UDF/udf/Tests/udf-reverse.test @@ -38,10 +38,8 @@ select reverse('MonetDB') BDtenoM -query T rowsort +statement ok call profiler.stoptrace() - -BDtenoM query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.reverse%' @@ -58,10 +56,8 @@ select reverse('MonetDB') BDtenoM -query T rowsort +statement ok call profiler."starttrace"() - -BDtenoM query T rowsort select reverse(x) from udf_reverse @@ -71,13 +67,8 @@ acitamrofnI & ednuksiW murtneC erutcetihcrA esabataD smetsyS noitamrofnI -query T rowsort +statement ok call profiler.stoptrace() - -BDtenoM -acitamrofnI & ednuksiW murtneC -erutcetihcrA esabataD -smetsyS noitamrofnI query I rowsort select count(*) from sys.tracelog() where stmt like '% batudf.reverse%' diff --git a/sql/test/BugTracker-2014/Tests/manifold.Bug-3556.test b/sql/test/BugTracker-2014/Tests/manifold.Bug-3556.test --- a/sql/test/BugTracker-2014/Tests/manifold.Bug-3556.test +++ b/sql/test/BugTracker-2014/Tests/manifold.B
MonetDB: mtest - Converting sql/test/BugTracker directory, but m...
Changeset: 6037d7a880c8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6037d7a880c8 Added Files: sql/test/BugTracker/Tests/BETWEEN_error.SF-1911991.test sql/test/BugTracker/Tests/add_and_drop_the_same_constraint.SF-1850789.test sql/test/BugTracker/Tests/alter-default.SF-1695290.test sql/test/BugTracker/Tests/alter_col_to_set_same_constraint.SF-1850781.test sql/test/BugTracker/Tests/alter_table_add_fkey.SF-1737668.test sql/test/BugTracker/Tests/alter_table_set_not_null.SF-1997030.test sql/test/BugTracker/Tests/ambiguous_join.SF-1580565.test sql/test/BugTracker/Tests/assert_fails_on_algebra_version.SF-2019349.test sql/test/BugTracker/Tests/auto_increment.SF-1834820.test sql/test/BugTracker/Tests/bat_descriptor_problem.SF-1997643.test sql/test/BugTracker/Tests/between_having_problem.SF-1959391.test sql/test/BugTracker/Tests/between_on_strings.SF-2021508.test sql/test/BugTracker/Tests/between_with_column.SF-1959410.test sql/test/BugTracker/Tests/bind_with_cast.SF-1720934.test sql/test/BugTracker/Tests/blob_corner_cases.SF-1613902.test sql/test/BugTracker/Tests/broken_join.SF-1373391.test sql/test/BugTracker/Tests/bug_in_selection.SF-1892413.test sql/test/BugTracker/Tests/cascade_operations_in_different_sessions.SF-1823387_create.test sql/test/BugTracker/Tests/cascade_operations_in_different_sessions.SF-1823387_drop.test sql/test/BugTracker/Tests/case_in_aggr_bug.SF-1506545.test sql/test/BugTracker/Tests/case_with_aggr.SF-1876779.test sql/test/BugTracker/Tests/cast_interval2time.SF-1488247.test sql/test/BugTracker/Tests/coalesce_equal_coalesce.SF-1907905.test sql/test/BugTracker/Tests/convert_dec2varchar.SF-1774312.test sql/test/BugTracker/Tests/convert_dec2varchar_crash.SF-1775550.test sql/test/BugTracker/Tests/copy_decimal.SF-1582957.test sql/test/BugTracker/Tests/copy_into_crash.SF-1993999.test sql/test/BugTracker/Tests/copy_overflow_null_bug.SF-1842550.test sql/test/BugTracker/Tests/count_crash.SF-1918780.test sql/test/BugTracker/Tests/crash_on_cast.SF-1357271.test sql/test/BugTracker/Tests/crash_on_delete.SF-1639108.test sql/test/BugTracker/Tests/crash_on_delete.SF-1651567.test sql/test/BugTracker/Tests/crash_on_fkey_update.SF-1703497.test sql/test/BugTracker/Tests/crash_on_fkey_update2.SF-1703497.test sql/test/BugTracker/Tests/crash_on_insert.SF-1639113.test sql/test/BugTracker/Tests/create_column.SF-1643542.test sql/test/BugTracker/Tests/create_column_name_data.SF-1440214.test sql/test/BugTracker/Tests/create_same_temp_tab_after_its_drop.SF-1850809.test sql/test/BugTracker/Tests/create_table_with_data.SF-1715679.test sql/test/BugTracker/Tests/creation_of_exeception_for_select.SF-1841749.test sql/test/BugTracker/Tests/decimal.SF-1718253.test sql/test/BugTracker/Tests/decimal_prepare.SF-1655818.test sql/test/BugTracker/Tests/decl_sec_tab_in_func_body.SF-1907858.test sql/test/BugTracker/Tests/drop_function.SF-1910396.test sql/test/BugTracker/Tests/drop_sequence_crash.SF-1505973.test sql/test/BugTracker/Tests/drop_sequence_crash_2.SF-1505973.test sql/test/BugTracker/Tests/drop_system_tables.SF-1550768.test sql/test/BugTracker/Tests/full_join_crash.SF-1841754.test sql/test/BugTracker/Tests/groupby_orderby_nonselected.SF-1723863.test sql/test/BugTracker/Tests/groupby_with_alias.SF-1520575.test sql/test/BugTracker/Tests/huge_math_expre.SF-1907048.test sql/test/BugTracker/Tests/insert_date.SF-1838785.test sql/test/BugTracker/Tests/insert_not_exists.SF-1380287.test sql/test/BugTracker/Tests/insert_text_with_repeat.SF-1841759.test sql/test/BugTracker/Tests/insert_values.SF-1578838.test sql/test/BugTracker/Tests/inserting_invalid_timestamp.SF-1363557.test sql/test/BugTracker/Tests/intersect_in_subquery.SF-1339411.test sql/test/BugTracker/Tests/is_not_null_syntax_error.SF-1959456.test sql/test/BugTracker/Tests/join_table_with_floats.SF-1907060.test sql/test/BugTracker/Tests/large_prepare.SF-1363729.test sql/test/BugTracker/Tests/large_prepare_2.SF-1363729.test sql/test/BugTracker/Tests/like_exp.SF-1613949.test sql/test/BugTracker/Tests/like_for_time_values.SF-1715659.test sql/test/BugTracker/Tests/like_join.SF-1684798.test sql/test/BugTracker/Tests/like_perl.SF-1907051.test sql/test/BugTracker/Tests/limit_timestampz.SF-1774217.test sql/test/BugTracker/Tests/limits_of_decimal.SF-1685357.test sql/test/BugTracker/Tests/local_global_temporary_table.SF-1715672.test sql/test/BugTracker/Tests/mapi_connect_errors_vanish.SF-1432134.test sql/test
MonetDB: monetdbe-proxy - Making a start with describing tables.
Changeset: 8ca5a1ca2518 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8ca5a1ca2518 Modified Files: dump.sql Branch: monetdbe-proxy Log Message: Making a start with describing tables. diffs (75 lines): diff --git a/dump.sql b/dump.sql --- a/dump.sql +++ b/dump.sql @@ -7,6 +7,20 @@ CREATE FUNCTION ENI (s STRING) RETURNS S CREATE FUNCTION comment_on(ob STRING, id STRING, r STRING) RETURNS STRING BEGIN RETURN ifthenelse(r IS NOT NULL, '\nCOMMENT ON ' || ob || ' ' || id || ' IS ' || SQ(r) || ';', ''); END; +--TODO expand dump_column_definition functionality +CREATE FUNCTION dump_column_definition(tid INT) RETURNS STRING BEGIN + RETURN + SELECT + GROUP_CONCAT(DQ(c.name) || ' ' || c.type || ifthenelse(c."null" = 'false', ' NOT NULL ', ''), ', ') + --c.type_digits, + --c.type_scale, + --c.null, + --c.default, + --c.number + FROM sys._columns c + WHERE c.table_id = tid; + END; + CREATE FUNCTION dump_database(describe BOOLEAN) RETURNS STRING BEGIN @@ -76,6 +90,7 @@ BEGIN SET grant_user_priviledges = ''; END IF; + declare create_sequences STRING; SET create_sequences = ( SELECT GROUP_CONCAT('CREATE SEQUENCE ' || DQ(sch.name) || '.' || DQ(seq.name) || ' AS INTEGER;' || @@ -84,6 +99,33 @@ BEGIN sys.sequences seq LEFT OUTER JOIN sys.comments rem ON seq.id = rem.id WHERE sch.id = seq.schema_id); +IF create_sequences IS NULL THEN +SET create_sequences = ''; +END IF; + + declare create_tables STRING; +set create_tables = ( + SELECT GROUP_CONCAT('CREATE ' || ts.table_type_name || ' ' || DQ(s.name) || '.' || DQ(t.name) || dump_column_definition(t.id) || ';', '\n') + FROM sys.schemas s, table_types ts, sys._tables t LEFT OUTER JOIN sys.comments rem ON t.id = rem.id + WHERE t.type IN (0, 6) + AND t.system = FALSE + AND s.id = t.schema_id + AND ts.table_type_id = t.type + AND s.name <> 'tmp'); + +IF create_tables IS NULL THEN +SET create_tables = ''; +END IF; + + --TODO where are the parenthesis in the column definition. + --TODO COLUMN DEFINITIONS + --TODO COMMENTS ON TABLE + --TODO functions + --TODO REMOTE TABLE + --TODO PARTITION TABLE + --TODO CREATE INDEX + COMMENT + --TODO User Defined Types? + RETURN 'START TRANSACTION;\n' || create_roles || '\n' || @@ -92,7 +134,7 @@ BEGIN alter_users || '\n' || grant_user_priviledges || '\n' || create_sequences || '\n' || - --create_tables || '\n' || + create_tables || '\n' || 'COMMIT;'; END; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: monetdbe-proxy - Use a more generic comment function.
Changeset: c6beca295e87 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c6beca295e87 Modified Files: dump.sql Branch: monetdbe-proxy Log Message: Use a more generic comment function. diffs (55 lines): diff --git a/dump.sql b/dump.sql --- a/dump.sql +++ b/dump.sql @@ -1,11 +1,11 @@ START TRANSACTION; CREATE FUNCTION SQ (s STRING) RETURNS STRING BEGIN RETURN ' ''' || s || ''' '; END; -CREATE FUNCTION DQ (s STRING) RETURNS STRING BEGIN RETURN ' "' || s || '"'; END; --TODO: Figure out why this breaks with the space +CREATE FUNCTION DQ (s STRING) RETURNS STRING BEGIN RETURN '"' || s || '"'; END; --TODO: Figure out why this breaks with the space CREATE FUNCTION I (s STRING) RETURNS STRING BEGIN RETURN '\t' || s || '\n'; END; CREATE FUNCTION ENI (s STRING) RETURNS STRING BEGIN RETURN I(SQ(s)); END; -CREATE FUNCTION comment_on_schema(o STRING, r STRING) RETURNS STRING BEGIN RETURN ifthenelse(r IS NOT NULL, '\nCOMMENT ON SCHEMA ' || o || ' IS ' || SQ(r) || ';', ''); END; +CREATE FUNCTION comment_on(ob STRING, id STRING, r STRING) RETURNS STRING BEGIN RETURN ifthenelse(r IS NOT NULL, '\nCOMMENT ON ' || ob || ' ' || id || ' IS ' || SQ(r) || ';', ''); END; CREATE FUNCTION dump_database(describe BOOLEAN) RETURNS STRING @@ -43,9 +43,9 @@ BEGIN SET create_schemas = ( SELECT GROUP_CONCAT('CREATE SCHEMA ' || s.name || ifthenelse(a.name <> 'sysadmin', ' AUTHORIZATION ' || a.name, ' ') || ';' || -comment_on_schema(s.name, rem.remark), '\n') +comment_on('SCHEMA', s.name, rem.remark), '\n') FROM schemas s LEFT OUTER JOIN comments rem ON s.id = rem.id,auths a -WHERE s."authorization" = a.id AND s.system = FALSE); +WHERE s.authorization = a.id AND s.system = FALSE); IF create_schemas IS NULL THEN SET create_schemas = ''; @@ -76,7 +76,24 @@ BEGIN SET grant_user_priviledges = ''; END IF; -RETURN 'START TRANSACTION;\n' || create_roles || '\n' || create_users || '\n' || create_schemas || '\n' || alter_users || '\n' || grant_user_priviledges || '\nCOMMIT;'; + declare create_sequences STRING; + SET create_sequences = ( + SELECT GROUP_CONCAT('CREATE SEQUENCE ' || DQ(sch.name) || '.' || DQ(seq.name) || ' AS INTEGER;' || + comment_on('SEQUENCE', DQ(sch.name) || '.' || DQ(seq.name), rem.remark), '\n') + FROM sys.schemas sch, + sys.sequences seq LEFT OUTER JOIN sys.comments rem ON seq.id = rem.id + WHERE sch.id = seq.schema_id); + +RETURN +'START TRANSACTION;\n' || +create_roles || '\n' || +create_users || '\n' || +create_schemas || '\n' || +alter_users || '\n' || +grant_user_priviledges || '\n' || +create_sequences || '\n' || + --create_tables || '\n' || +'COMMIT;'; END; ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Removed unused test
Changeset: b55f4f0fff5b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b55f4f0fff5b Removed Files: sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701 sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.err sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.out Modified Files: sql/test/BugTracker-2010/Tests/All Branch: mtest Log Message: Removed unused test diffs (62 lines): diff --git a/sql/test/BugTracker-2010/Tests/All b/sql/test/BugTracker-2010/Tests/All --- a/sql/test/BugTracker-2010/Tests/All +++ b/sql/test/BugTracker-2010/Tests/All @@ -67,7 +67,6 @@ select-distinct-limit.Bug-2676 cast-varchar.Bug-2682 substring_display_width.Bug-2683 new-readonly-db.Bug-2695 -#Mbedded-crash.Bug-2701 no longer under maintenance distinct-order-by-limit.Bug-2691 join_problem.Bug-2694 TypeException_with_missing_function.Bug-2674 diff --git a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701 b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701 deleted file mode 100755 --- a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701 +++ /dev/null @@ -1,1 +0,0 @@ -echo 'select name from tables where system = false;' | Mbeddedsql5 --dbpath="$GDK_DBFARM/$TSTDB" diff --git a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat deleted file mode 100755 --- a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.bat +++ /dev/null @@ -1,1 +0,0 @@ -@echo select name from tables where system = false; | Mbeddedsql5 "--dbpath=%GDK_DBFARM%\%TSTDB%" diff --git a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.err b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.err deleted file mode 100644 --- a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.err +++ /dev/null @@ -1,12 +0,0 @@ -stderr of test 'Mbedded-crash.Bug-2701` in directory 'sql/test/BugTracker-2010` itself: - - -# 14:56:23 > -# 14:56:23 > ./Mbedded-crash.Bug-2701 Mbedded-crash.Bug-2701 -# 14:56:23 > - - -# 14:56:23 > -# 14:56:23 > Done. -# 14:56:23 > - diff --git a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.out b/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.out deleted file mode 100644 --- a/sql/test/BugTracker-2010/Tests/Mbedded-crash.Bug-2701.stable.out +++ /dev/null @@ -1,17 +0,0 @@ -stdout of test 'Mbedded-crash.Bug-2701` in directory 'sql/test/BugTracker-2010` itself: - - -# 14:56:23 > -# 14:56:23 > ./Mbedded-crash.Bug-2701 Mbedded-crash.Bug-2701 -# 14:56:23 > - -# MonetDB/GIS module v0.20.0 loaded -% .tables # table_name -% name # name -% varchar # type -% 0 # length - -# 14:56:23 > -# 14:56:23 > Done. -# 14:56:23 > - ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - sql/test/BugTracker-2019/sum-over-hge is a huge...
Changeset: 9b8749fb720b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9b8749fb720b Removed Files: sql/test/BugTracker-2019/Tests/sum-over-hge.Bug.6738.stable.out.int128 Modified Files: sql/test/BugTracker-2019/Tests/All sql/test/BugTracker-2019/Tests/sum-over-hge.Bug.6738.stable.out sql/test/BugTracker-2019/Tests/sum-over-hge.Bug.6738.test Branch: mtest Log Message: sql/test/BugTracker-2019/sum-over-hge is a hugeint related bug, so no no-int128 output diffs (242 lines): diff --git a/sql/test/BugTracker-2019/Tests/All b/sql/test/BugTracker-2019/Tests/All --- a/sql/test/BugTracker-2019/Tests/All +++ b/sql/test/BugTracker-2019/Tests/All @@ -25,7 +25,7 @@ select-distinct.Bug-6728 table-duplicate-column.Bug-6729 view-too-few-rows.Bug-6736 slow-inner-join.Bug-6737 -sum-over-hge.Bug.6738 +HAVE_HGE?sum-over-hge.Bug.6738 sequence-first-next-value.Bug-6743 sequences-defaults.Bug-6744 sequences-types.Bug-6745 diff --git a/sql/test/BugTracker-2019/Tests/sum-over-hge.Bug.6738.stable.out b/sql/test/BugTracker-2019/Tests/sum-over-hge.Bug.6738.stable.out --- a/sql/test/BugTracker-2019/Tests/sum-over-hge.Bug.6738.stable.out +++ b/sql/test/BugTracker-2019/Tests/sum-over-hge.Bug.6738.stable.out @@ -5,59 +5,6 @@ stdout of test 'sum-over-hge.Bug.6738` i # 17:13:59 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=true" "--set" "mapi_port=30631" "--set" "mapi_usock=/var/tmp/mtest-29714/.s.monetdb.30631" "--set" "monet_prompt=" "--forcemito" "--dbpath=/ufs/sjoerd/@Monet-stable/var/MonetDB/mTests_sql_test_BugTracker-2019" "--set" "embedded_c=true" # 17:13:59 > -# MonetDB 5 server v11.33.4 (hg id: 4904034be0e3+) -# This is an unreleased version -# Serving database 'mTests_sql_test_BugTracker-2019', using 8 threads -# Compiled for x86_64-pc-linux-gnu/64bit -# Found 62.693 GiB available main-memory. -# Copyright (c) 1993 - July 2008 CWI. -# Copyright (c) August 2008 - 2020 MonetDB B.V., all rights reserved -# Visit https://www.monetdb.org/ for further information -# Listening for connection requests on mapi:monetdb://methuselah.da.cwi.nl:30631/ -# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-29714/.s.monetdb.30631 -# MonetDB/GIS module loaded -# SQL catalog created, loading sql scripts once -# loading sql script: 09_like.sql -# loading sql script: 10_math.sql -# loading sql script: 11_times.sql -# loading sql script: 12_url.sql -# loading sql script: 13_date.sql -# loading sql script: 14_inet.sql -# loading sql script: 15_querylog.sql -# loading sql script: 16_tracelog.sql -# loading sql script: 17_temporal.sql -# loading sql script: 18_index.sql -# loading sql script: 20_vacuum.sql -# loading sql script: 21_dependency_views.sql -# loading sql script: 22_clients.sql -# loading sql script: 23_skyserver.sql -# loading sql script: 25_debug.sql -# loading sql script: 26_sysmon.sql -# loading sql script: 27_rejects.sql -# loading sql script: 39_analytics.sql -# loading sql script: 40_geom.sql -# loading sql script: 40_json.sql -# loading sql script: 41_md5sum.sql -# loading sql script: 45_uuid.sql -# loading sql script: 46_profiler.sql -# loading sql script: 51_sys_schema_extension.sql -# loading sql script: 60_wlcr.sql -# loading sql script: 72_fits.sql -# loading sql script: 74_netcdf.sql -# loading sql script: 75_lidar.sql -# loading sql script: 75_shp.sql -# loading sql script: 75_storagemodel.sql -# loading sql script: 80_statistics.sql -# loading sql script: 80_udf.sql -# loading sql script: 85_bam.sql -# loading sql script: 90_generator.sql -# loading sql script: 99_system.sql -# MonetDB/SQL module loaded - -# 09:51:45 > -# 09:51:45 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-18338" "--port=34628" -# 09:51:45 > - #select foo, # sum(foo) over () as s1, # 1.0 * sum(foo) over () as s2, @@ -65,8 +12,8 @@ stdout of test 'sum-over-hge.Bug.6738` i # from (select 7 as foo union all select 3 as foo) as t; % .t, ., ., . # table_name % foo, s1, s2, s3 # name -% tinyint, bigint, decimal,double # type -% 1, 2, 20, 24 # length +% tinyint, hugeint,decimal,double # type +% 1, 2, 40, 24 # length [ 7, 10, 10.00, 10 ] [ 3, 10, 10.00, 10 ] #select foo, @@ -74,7 +21,7 @@ stdout of test 'sum-over-hge.Bug.6738` i # from (select 7 as foo union all select 3 as foo) as t; % .t, . # table_name % foo, %10 # name -% tinyint, bigint # type +% tinyint, hugeint # type % 1, 1 # length [ 7, 5 ] [ 3, 5 ] @@ -84,8 +31,8 @@ stdout of test 'sum-over-hge.Bug.6738` i # from (values (1),(2),(3),(4),(5),(6)) as t(foo); % .t, ., . # table_name % foo, sumsum1,cumsum2 # name -% tinyint, bigint, decimal # type -% 1, 2, 20 # length +% tinyint, hugeint,decimal # type +% 1, 2, 40 # length [ 1, 1,
MonetDB: mtest - Fix and approve tests.
Changeset: a5a62001c552 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a5a62001c552 Modified Files: sql/test/BugTracker-2010/Tests/incomplete-utf8-sequence.Bug-2575.stable.err sql/test/BugTracker-2015/Tests/mserver-creates-but-not-accept-column-types-decimal19-decimal39.Bug-3863.test Branch: mtest Log Message: Fix and approve tests. diffs (53 lines): diff --git a/sql/test/BugTracker-2010/Tests/incomplete-utf8-sequence.Bug-2575.stable.err b/sql/test/BugTracker-2010/Tests/incomplete-utf8-sequence.Bug-2575.stable.err --- a/sql/test/BugTracker-2010/Tests/incomplete-utf8-sequence.Bug-2575.stable.err +++ b/sql/test/BugTracker-2010/Tests/incomplete-utf8-sequence.Bug-2575.stable.err @@ -63,26 +63,7 @@ stderr of test 'incomplete-utf8-sequence #warning: please don't forget to set your vault key! #(see /ufs/sjoerd/Monet-stable/etc/monetdb5.conf) -# 14:47:29 > -# 14:47:29 > mclient -lsql -ftest -i -e --host=ottar --port=36476 -# 14:47:29 > +# 13:59:32 > +# 13:59:32 > "Done." +# 13:59:32 > -MAPI = (monetdb) /var/tmp/mtest-10958/.s.monetdb.35734 -QUERY = copy 2 records into tbl_bug2575 from stdin using delimiters E'\t',E'\n',''; -100011629 .v. -100016900010 coà -ERROR = !Failed to import table 'tbl_bug2575', line 2: input not properly encoded UTF-8 -CODE = 42000 -MAPI = (monetdb) /var/tmp/mtest-9014/.s.monetdb.38503 -QUERY = copy 2 records into tbl_bug2575 from stdin using delimiters E'\t',E'\n',''; -100011629 .v. -100016900010 coà - -DROP TABLE tbl_bug2575; -ERROR = !syntax error, unexpected sqlINT in: "10001690001" -CODE = 42000 - -# 14:47:29 > -# 14:47:29 > Done. -# 14:47:29 > - diff --git a/sql/test/BugTracker-2015/Tests/mserver-creates-but-not-accept-column-types-decimal19-decimal39.Bug-3863.test b/sql/test/BugTracker-2015/Tests/mserver-creates-but-not-accept-column-types-decimal19-decimal39.Bug-3863.test --- a/sql/test/BugTracker-2015/Tests/mserver-creates-but-not-accept-column-types-decimal19-decimal39.Bug-3863.test +++ b/sql/test/BugTracker-2015/Tests/mserver-creates-but-not-accept-column-types-decimal19-decimal39.Bug-3863.test @@ -15,7 +15,7 @@ NULL TABLE NULL -query TTIITTIT rowsort +query TTIITTITT rowsort select * from describe_columns('sys', 'foo') eur @@ -25,6 +25,7 @@ 3 True NULL 0 +DECIMAL(23,3) NULL statement ok ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Silenced null-byte-hang test
Changeset: 1cfa9888bb7e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1cfa9888bb7e Modified Files: sql/test/Tests/All sql/test/Tests/null-byte-hang.SQL.py sql/test/Tests/null-byte-hang.stable.err sql/test/Tests/null-byte-hang.stable.out Branch: mtest Log Message: Silenced null-byte-hang test diffs (90 lines): diff --git a/sql/test/Tests/All b/sql/test/Tests/All --- a/sql/test/Tests/All +++ b/sql/test/Tests/All @@ -67,7 +67,7 @@ alter-sequence restart-sequence create_in_schema -null-byte-hang +HAVE_PYMONETDB?null-byte-hang orderby_limit orderby_non_selection_column diff --git a/sql/test/Tests/null-byte-hang.SQL.py b/sql/test/Tests/null-byte-hang.SQL.py --- a/sql/test/Tests/null-byte-hang.SQL.py +++ b/sql/test/Tests/null-byte-hang.SQL.py @@ -1,14 +1,17 @@ -import os, sys -try: -from MonetDBtesting import process -except ImportError: -import process +import os, sys, pymonetdb + -with process.client('sql', -args = [os.path.join(os.getenv('TSTSRCBASE'), - os.getenv('TSTDIR'), - 'null-byte-hang.sql')], -stdout = process.PIPE, stderr = process.PIPE) as c: -out, err = c.communicate() -sys.stdout.write(out) -sys.stderr.write(err) +client1 = pymonetdb.connect(port=int(os.getenv('MAPIPORT')), database=os.getenv('TSTDB')) +cur1 = client1.cursor() +f = open(os.path.join(os.getenv('TSTSRCBASE'), os.getenv('TSTDIR'), 'null-byte-hang.sql'), 'r') +q = f.read() +f.close() +try: +cur1.execute(q) +sys.stderr.write('Error expected') +except Exception as ex: +if 'NULL byte in string' not in str(ex): +sys.stderr.write('Error: NULL byte in string expected') + +cur1.close() +client1.close() diff --git a/sql/test/Tests/null-byte-hang.stable.err b/sql/test/Tests/null-byte-hang.stable.err --- a/sql/test/Tests/null-byte-hang.stable.err +++ b/sql/test/Tests/null-byte-hang.stable.err @@ -7,12 +7,6 @@ stderr of test 'null-byte-hang` in direc # 12:54:19 > -# 12:54:19 > Mtimeout -timeout 60 ./null-byte-hang.SQL null-byte-hang -# 12:54:19 > - -NULL byte in input on line 1 of input - -# 12:54:19 > # 12:54:19 > Done. # 12:54:19 > diff --git a/sql/test/Tests/null-byte-hang.stable.out b/sql/test/Tests/null-byte-hang.stable.out --- a/sql/test/Tests/null-byte-hang.stable.out +++ b/sql/test/Tests/null-byte-hang.stable.out @@ -5,24 +5,6 @@ stdout of test 'null-byte-hang` in direc # 16:20:14 > mserver5 "--config=/ufs/sjoerd/Monet-virgin-stable/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=0 --set "monet_mod_path=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/src/backends/monet5/.libs:/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/src/backends/monet5:/ufs/sjoerd/Monet-virgin-stable/lib64/MonetDB5:/ufs/sjoerd/Monet-virgin-stable/lib64/MonetDB5/lib:/ufs/sjoerd/Monet-virgin-stable/lib64/MonetDB5/bin" --set "gdk_dbfarm=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/dbfarm" --set "sql_logdir=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/sql_logs" --set "xquery_logdir=/ufs/sjoerd/src/MonetDB/virgin-stable/sql/x86_64-unknown-linux-gnu/xquery_logs" --set mapi_open=true --set xrpc_open=true --set mapi_port=30609 --set xrpc_port=42165 --set monet_prompt= --trace "--dbname=mTests_src_test" --set mal_listing=0 "--dbinit= include sql;" ; echo ; echo Over.. # 16:20:14 > -# MonetDB server v5.8.3, based on kernel v1.26.3 -# Serving database 'mTests_src_test', using 4 threads -# Compiled for x86_64-unknown-linux-gnu/64bit with 64bit OIDs dynamically linked -# Copyright (c) 1993-July 2008 CWI. -# Copyright (c) August 2008- MonetDB B.V., all rights reserved -# Visit http://monetdb.cwi.nl/ for further information -# Listening for connection requests on mapi:monetdb://ottar.ins.cwi.nl:30609/ -# MonetDB/SQL module v2.26.3 loaded - -#function user.main():void; -#clients.quit(); -#end main; - - -# 12:54:19 > -# 12:54:19 > Mtimeout -timeout 60 ./null-byte-hang.SQL null-byte-hang -# 12:54:19 > - # 12:54:19 > # 12:54:19 > Done. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - merge heads
Changeset: 265b0bd7f73d for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=265b0bd7f73d Removed Files: sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err.int128 sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.out.int128 sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.test Branch: mtest Log Message: merge heads diffs (truncated from 7344 to 300 lines): diff --git a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.py rename from sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql rename to sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.py --- a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql +++ b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.py @@ -1,3 +1,7 @@ -select 'a'+1; -select 1-'a'; -select true+1; +from MonetDBtesting.sqltest import SQLTestCase + +with SQLTestCase() as tc: +tc.connect(username="monetdb", password="monetdb") +tc.execute("select 'a'+1;").assertFailed() +tc.execute("select 1-'a';").assertFailed() +tc.execute("select true+1;").assertSucceeded().assertDataResultMatch([(2,)]) diff --git a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err --- a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err +++ b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err @@ -5,88 +5,6 @@ stderr of test 'mixed_type.SF-917372` in # 19:21:06 > mserver5 "--config=/ufs/niels/scratch/monetdb/Linux-x86_64/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=4 --set "monet_mod_path=/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/niels/scratch/monetdb/Linux-x86_64/var/MonetDB5/dbfarm" --set "sql_logdir=/ufs/niels/scratch/monetdb/Linux-x86_64/var/MonetDB5/sql_logs" --set mapi_open=true --set xrpc_open=true --set mapi_port=33392 --set xrpc_port=40415 --set monet_prompt= --trace "--dbname=mTests_src_test_BugDay_2005-10-06_2.8" --set mal_listing=0 "--dbinit= include sql;" ; echo ; echo Over.. # 19:21:06 > -# builtin opt gdk_arch = 64bitx86_64-unknown-linux-gnu -# builtin opt gdk_version = 1.27.0 -# builtin opt monet_pid = 25524 -# builtin opt prefix = /ufs/niels/scratch/monetdb/Linux-x86_64 -# builtin opt exec_prefix = ${prefix} -# builtin opt gdk_dbname = tst -# builtin opt gdk_dbfarm = ${prefix}/var/MonetDB -# builtin opt gdk_debug = 8 -# builtin opt gdk_mem_bigsize = 262144 -# builtin opt gdk_alloc_map = yes -# builtin opt gdk_mem_pagebits = 14 -# builtin opt gdk_vmtrim = yes -# builtin opt monet_admin = adm -# builtin opt monet_prompt = > -# builtin opt monet_welcome = yes -# builtin opt monet_mod_path = ${exec_prefix}/lib/MonetDB:${exec_prefix}/lib/bin -# builtin opt monet_daemon = yes -# builtin opt host = localhost -# builtin opt mapi_port = 5 -# builtin opt mapi_noheaders = no -# builtin opt mapi_debug = 0 -# builtin opt mapi_clients = 2 -# builtin opt sql_debug = 0 -# builtin opt sql_logdir = ${prefix}/var/MonetDB -# builtin opt xquery_logdir = ${prefix}/var/MonetDB -# builtin opt standoff_ns = http://monetdb.cwi.nl/standoff -# builtin opt standoff_start = start -# builtin opt standoff_end = end -# config opt prefix = /ufs/niels/scratch/monetdb/Linux-x86_64 -# config opt config = ${prefix}/etc/monetdb5.conf -# config opt prefix = /ufs/niels/scratch/monetdb/Linux-x86_64 -# config opt exec_prefix = ${prefix} -# config opt gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm -# config opt gdk_dbname = demo -# config opt gdk_alloc_map = no -# config opt gdk_embedded = no -# config opt gdk_debug = 0 -# config opt monet_mod_path = ${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin -# config opt monet_daemon = no -# config opt monet_welcome = yes -# config opt mero_msglog = ${prefix}/var/log/merovingian.log -# config opt mero_errlog = ${prefix}/var/log/merovingian.log -# config opt mero_timeinterval = 600 -# config opt mero_pidfile = ${prefix}/var/run/merovingian.pid -# config opt mero_exittimeout = 7 -# config opt mero_doproxy = yes -# config opt mero_discoveryttl = 600 -# config opt mal_init = ${exec_prefix}/lib/MonetDB5/mal_init.mal -# config opt mal_listing = 2 -# config opt checkpoint_dir = ${prefix}/var/MonetDB5/chkpnt -# config opt mapi_port = 5 -# config opt mapi_open = false -# config opt sql_logdir = ${prefix}/var/MonetDB5/sql_logs -# config opt sql_init = ${exec_prefix}/lib/MonetDB5/sql_init.sql -# cmdline opt config = /ufs/niels/scratch/monetdb/Linux-x86_64/etc/monetdb5.conf -# cmdline opt gdk_nr_threads =
MonetDB: mtest - convert tests for columRights
Changeset: d3e73668ad46 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d3e73668ad46 Modified Files: sql/test/Users/Tests/columnRights.SQL.py Branch: mtest Log Message: convert tests for columRights diffs (67 lines): diff --git a/sql/test/Users/Tests/columnRights.SQL.py b/sql/test/Users/Tests/columnRights.SQL.py --- a/sql/test/Users/Tests/columnRights.SQL.py +++ b/sql/test/Users/Tests/columnRights.SQL.py @@ -4,30 +4,43 @@ # Verify that the user cannot SELECT nor UPDATE on the column it did not get permissions for. ### -import os, sys -try: -from MonetDBtesting import process -except ImportError: -import process +from MonetDBtesting.sqltest import SQLTestCase + +with SQLTestCase() as tc: +tc.connect(username="monetdb", password="monetdb") +tc.execute("GRANT SELECT (price) ON library.orders TO alice;").assertSucceeded() +tc.execute("GRANT UPDATE (name) ON library.orders TO alice;").assertSucceeded() + +tc.connect(username="alice", password="alice") +tc.execute("SELECT price FROM library.orders;").assertSucceeded() +tc.execute("UPDATE library.orders SET name = 'book title goes here';").assertSucceeded() +tc.execute("SELECT name FROM library.orders; --insufficient rights").assertFailed() +tc.execute("UPDATE orders SET price = 0; --insufficient rights").assertFailed() -def sql_test_client(user, passwd, input): -with process.client(lang="sql", user=user, passwd=passwd, communicate=True, -stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE, -input=input, port=int(os.getenv("MAPIPORT"))) as c: -c.communicate() +# import os, sys +# try: +# from MonetDBtesting import process +# except ImportError: +# import process -sql_test_client('monetdb', 'monetdb', input="""\ -GRANT SELECT (price) ON library.orders TO alice; -GRANT UPDATE (name) ON library.orders TO alice; -""") +# def sql_test_client(user, passwd, input): +# with process.client(lang="sql", user=user, passwd=passwd, communicate=True, +# stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE, +# input=input, port=int(os.getenv("MAPIPORT"))) as c: +# c.communicate() + +# sql_test_client('monetdb', 'monetdb', input="""\ +# GRANT SELECT (price) ON library.orders TO alice; +# GRANT UPDATE (name) ON library.orders TO alice; +# """) -sql_test_client('alice', 'alice', input="""\ -SELECT price FROM orders; -UPDATE orders SET name = 'book title goes here'; -SELECT name FROM orders; --insufficient rights -UPDATE orders SET price = 0; --insufficient rights -""") +# sql_test_client('alice', 'alice', input="""\ +# SELECT price FROM orders; +# UPDATE orders SET name = 'book title goes here'; +# SELECT name FROM orders; --insufficient rights +# UPDATE orders SET price = 0; --insufficient rights +# """) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - More badly converted copy into tests
Changeset: 8fdf930ae143 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8fdf930ae143 Modified Files: sql/test/SQLancer/Tests/sqlancer08.test sql/test/Tests/load_with_offset.test sql/test/Tests/rank.test Branch: mtest Log Message: More badly converted copy into tests diffs (truncated from 1288 to 300 lines): diff --git a/sql/test/SQLancer/Tests/sqlancer08.test b/sql/test/SQLancer/Tests/sqlancer08.test --- a/sql/test/SQLancer/Tests/sqlancer08.test +++ b/sql/test/SQLancer/Tests/sqlancer08.test @@ -337,8 +337,13 @@ COPY 3 RECORDS INTO "sys"."t1" FROM stdi 1970-01-24 1970-01-24 1970-01-24 -CREATE TABLE "sys"."t2" ("tc1" DATE NOT NULL,CONSTRAINT "t2_tc1_pkey" PRIMARY KEY ("tc1")); -COPY 5 RECORDS INTO "sys"."t2" FROM stdin USING DELIMITERS E'\t',E'\n','"'; + +statement ok +CREATE TABLE "sys"."t2" ("tc1" DATE NOT NULL,CONSTRAINT "t2_tc1_pkey" PRIMARY KEY ("tc1")) + +statement ok +COPY 5 RECORDS INTO "sys"."t2" FROM stdin USING DELIMITERS E'\t',E'\n','"' + 1970-01-25 1970-01-14 1970-01-01 diff --git a/sql/test/Tests/load_with_offset.test b/sql/test/Tests/load_with_offset.test --- a/sql/test/Tests/load_with_offset.test +++ b/sql/test/Tests/load_with_offset.test @@ -9,8 +9,49 @@ CREATE TABLE my_test ( statement ok COPY 5 OFFSET 5 RECORDS INTO my_test FROM stdin USING DELIMITERS '|',E'\n' NULL as '' + +123|1||a|b +553|0||a|b +223|2||a|b +123|0||a|b +823|3||a|b +123|0||a|b +590|0||a|b +239|0||a|b +445|28||a|b -statement error +query IIITT rowsort +select * from my_test + +123 +0 +NULL +a +b +239 +0 +NULL +a +b +445 +28 +NULL +a +b +590 +0 +NULL +a +b +823 +3 +NULL +a +b + +statement ok +COPY 9 RECORDS INTO my_test FROM stdin USING DELIMITERS '|',E'\n' NULL as '' + 123|1||a|b 553|0||a|b 223|2||a|b @@ -20,23 +61,82 @@ 123|0||a|b 590|0||a|b 239|0||a|b 445|28||a|b + +query IIITT rowsort select * from my_test - -statement ok -COPY 9 RECORDS INTO my_test FROM stdin USING DELIMITERS '|',E'\n' NULL as '' - -statement error -123|1||a|b -553|0||a|b -223|2||a|b -123|0||a|b -823|3||a|b -123|0||a|b -590|0||a|b -239|0||a|b -445|28||a|b -select * from my_test + +123 +0 +NULL +a +b +123 +0 +NULL +a +b +123 +0 +NULL +a +b +123 +1 +NULL +a +b +223 +2 +NULL +a +b +239 +0 +NULL +a +b +239 +0 +NULL +a +b +445 +28 +NULL +a +b +445 +28 +NULL +a +b +553 +0 +NULL +a +b +590 +0 +NULL +a +b +590 +0 +NULL +a +b +823 +3 +NULL +a +b +823 +3 +NULL +a +b statement ok DROP TABLE my_test + diff --git a/sql/test/Tests/rank.test b/sql/test/Tests/rank.test --- a/sql/test/Tests/rank.test +++ b/sql/test/Tests/rank.test @@ -3,8 +3,7 @@ create table ranktest ( id int, k string statement ok COPY 27 RECORDS INTO ranktest FROM stdin USING DELIMITERS '|',E'\n' - -statement error + 1061|varchar 1061|int 1061|varchar @@ -32,72 +31,1103 @@ 1061|varchar 1061|int 1061|int 1061|smallint + +query I rowsort select count(*) from ranktest + +27 query I rowsort select ROW_NUMBER() over () as foo from ranktest order by foo +1 +10 +11 +12 +13 +14 +15 +16 +17 +18 +19 +2 +20 +21 +22 +23 +24 +25 +26 +27 +3 +4 +5 +6 +7 +8 +9 query II rowsort select ROW_NUMBER() over (PARTITION BY id) as foo, id from ranktest order by foo, id +1 +1061 +1 +1062 +10 +1061 +11 +1061 +12 +1061 +13 +1061 +14 +1061 +15 +1061 +16 +1061 +17 +1061 +18 +1061 +19 +1061 +2 +1061 +2 +1062 +20 +1061 +3 +1061 +3 +1062 +4 +1061 +4 +1062 +5 +1061 +5 +1062 +6 +1061 +6 +1062 +7 +1061 +7 +1062 +8 +1061 +9 +1061 query II rowsort select ROW_NUMBER() over (PARTITION BY id ORDER BY id) as foo, id from ranktest order by foo, id +1 +1061 +1 +1062 +10 +1061 +11 +1061 +12 +1061 +13 +1061 +14 +1061 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Badly converted sql/test/BugTracker-2010 tests
Changeset: 82b04ae04968 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=82b04ae04968 Modified Files: sql/test/BugTracker-2010/Tests/cast-varchar.Bug-2682.test sql/test/BugTracker-2010/Tests/copy-into-too-long-string.Bug-2358.test sql/test/BugTracker-2010/Tests/crash_with_prepare_statement.Bug-2549.test sql/test/BugTracker-2010/Tests/delete_insert.Bug-2529.test sql/test/BugTracker-2010/Tests/embedded_record_seperator.SF-2991400.test sql/test/BugTracker-2010/Tests/error-truncated.Bug-2615.test sql/test/BugTracker-2010/Tests/limit_in_prepare.Bug-2552.test sql/test/BugTracker-2010/Tests/multiple-common-table-expressions.Bug-2664.test sql/test/BugTracker-2010/Tests/prepare_on_boolean_bug.Bug-2581.test sql/test/BugTracker-2010/Tests/prepare_statements_crash_server.Bug-2599.test sql/test/BugTracker-2010/Tests/prepare_stmt.Bug-2533.Bug-2534.test sql/test/BugTracker-2010/Tests/reorder.SF-2995671.test Branch: mtest Log Message: Badly converted sql/test/BugTracker-2010 tests diffs (truncated from 426 to 300 lines): diff --git a/sql/test/BugTracker-2010/Tests/cast-varchar.Bug-2682.test b/sql/test/BugTracker-2010/Tests/cast-varchar.Bug-2682.test --- a/sql/test/BugTracker-2010/Tests/cast-varchar.Bug-2682.test +++ b/sql/test/BugTracker-2010/Tests/cast-varchar.Bug-2682.test @@ -10,8 +10,7 @@ CREATE TABLE "sys"."sensor_readings" ( statement ok COPY 20 RECORDS INTO "sensor_readings" FROM STDIN USING DELIMITERS ',',E'\n' - -statement error + 127.0.0.1,2010-08-25 14:56:12.00,2010-07-15 13:56:10.00,L318,temperature,27.56 127.0.0.1,2010-08-25 14:56:12.00,2010-07-15 13:56:12.00,L318,temperature,27.5 127.0.0.1,2010-08-25 14:56:12.00,2010-07-15 13:56:13.00,L318,temperature,27.56 @@ -32,6 +31,8 @@ 127.0.0.1,2010-08-25 14:56:12.00,201 127.0.0.1,2010-08-25 14:56:12.00,2010-07-15 13:56:31.00,L318,temperature,27.5 127.0.0.1,2010-08-25 14:56:12.00,2010-07-15 13:56:33.00,L318,temperature,27.5 127.0.0.1,2010-08-25 14:56:12.00,2010-07-15 13:56:34.00,L318,temperature,27.5 + +query TTRR rowsort SELECT location, CAST(SUBSTRING(emit_time, 0, 16) AS VARCHAR(16)) AS "time", MAX(CAST(value AS NUMERIC(5,2))) AS maxtemp, @@ -41,6 +42,11 @@ WHERE type LIKE 'temperature' AND emit_time BETWEEN '2010-07-10' AND '2010-07-20' GROUP BY location, "time" HAVING MAX(CAST(value AS NUMERIC(5,2))) - MIN(CAST(value AS NUMERIC(5,2))) > 0.05 + +L318 +2010-07-15 13:56 +27.560 +27.500 statement ok DROP TABLE "sys"."sensor_readings" diff --git a/sql/test/BugTracker-2010/Tests/copy-into-too-long-string.Bug-2358.test b/sql/test/BugTracker-2010/Tests/copy-into-too-long-string.Bug-2358.test --- a/sql/test/BugTracker-2010/Tests/copy-into-too-long-string.Bug-2358.test +++ b/sql/test/BugTracker-2010/Tests/copy-into-too-long-string.Bug-2358.test @@ -1,12 +1,13 @@ statement ok create table t (c varchar(3)) -statement ok +statement error COPY 1 RECORDS INTO t FROM STDIN USING DELIMITERS '|',' ','"' NULL AS '' + +"abcd" -statement error -"abcd" +statement ok drop table t diff --git a/sql/test/BugTracker-2010/Tests/crash_with_prepare_statement.Bug-2549.test b/sql/test/BugTracker-2010/Tests/crash_with_prepare_statement.Bug-2549.test --- a/sql/test/BugTracker-2010/Tests/crash_with_prepare_statement.Bug-2549.test +++ b/sql/test/BugTracker-2010/Tests/crash_with_prepare_statement.Bug-2549.test @@ -22,7 +22,7 @@ CREATE TABLE TB.STOCK_ITEM ( S_DATA VARCHAR(50) NOT NULL ) -statement error +statement ok PREPARE UPDATE TB.STOCK_ITEM SET S_QUANTITY = ?, diff --git a/sql/test/BugTracker-2010/Tests/delete_insert.Bug-2529.test b/sql/test/BugTracker-2010/Tests/delete_insert.Bug-2529.test --- a/sql/test/BugTracker-2010/Tests/delete_insert.Bug-2529.test +++ b/sql/test/BugTracker-2010/Tests/delete_insert.Bug-2529.test @@ -31,8 +31,7 @@ DELETE statement ok COPY 10 RECORDS INTO user_record_insertion FROM STDIN USING DELIMITERS ',',E'\n' - -statement error + Steven Teague,d5329b8f Chrystal Whitman,20cbc561 Elisabeth Luetten,4e0bfbea @@ -43,14 +42,16 @@ Randall Kaiser,f76bfe86 Rusty Wuerzen,9c29633b Wilfredo Rosenbaum,e5c469cb Cecil Herrington,000c14c7 + +statement ok INSERT INTO user_record_insertion2 (name,uid) SELECT name,uid FROM user_record_insertion -statement error +statement ok INSERT INTO user_record (name,uid) SELECT name,uid FROM user_record_insertion2 -statement error +statement ok COMMIT statement ok diff --git a/sql/test/BugTracker-2010/Tests/embedded_record_seperator.SF-2991400.test b/sql/test/BugTracker-2010/Tests/embedded_record_seperator.SF-2991400.test --- a/sql/test/BugTracker-2010/Tests/embedded_record_seperator.SF-2991400.test +++ b/sql/test/BugTracker-2010/Tests/embedded_record_seperator.SF-2991400.test @@ -3,14 +3,16 @@ create table ers (c varchar(3)) statement ok COPY 1 RECORDS INTO ers F
MonetDB: mtest - Silenced sql/test/mserver5-sql-readonly tests. ...
Changeset: 29936ede1f77 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=29936ede1f77 Added Files: sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-view.reqtests Modified Files: sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.stable.err sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.stable.out sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-view.py sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-view.stable.err sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-view.stable.out Branch: mtest Log Message: Silenced sql/test/mserver5-sql-readonly tests. Also mserver5-sql-readonly-view requires mserver5-sql-readonly-table to run first diffs (truncated from 678 to 300 lines): diff --git a/sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py b/sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py --- a/sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py +++ b/sql/test/mserver5-sql-readonly/Tests/mserver5-sql-readonly-table.py @@ -1,5 +1,6 @@ import sys -import os +from MonetDBtesting.sqltest import SQLTestCase + try: from MonetDBtesting import process except ImportError: @@ -7,97 +8,37 @@ except ImportError: def server_stop(s): out, err = s.communicate() -sys.stdout.write(out) sys.stderr.write(err) -def client(input): -with process.client('sql', -stdin=process.PIPE, -stdout=process.PIPE, -stderr=process.PIPE) as c: -out, err = c.communicate(input) -sys.stdout.write(out) -sys.stderr.write(err) - -script1 = '''\ -create table t1 (a int); -''' - -script2 = '''\ -create table t2 (a int); -''' - -script3 = '''\ -insert into t1 (a) values ( 1 ); -''' - -script4 = '''\ -select * from t1; -''' - -script5 = '''\ -drop table t2; -''' -script6 = '''\ -create table t3 (a) as select * from t1 with data; -''' - -script7 = '''\ -create table t4 (a) as select * from t1 with no data; -''' - -script8 = '''\ -drop table t1; -''' - -script9 = '''\ -create table t5 ( like t1 ); -''' - -script10 = '''\ -create temporary table t6 ( a int); -''' - -script11 = '''\ -create local temporary table t7 ( a int ); -''' - -script12 = '''\ -create global temporary table t8 ( a int ); -''' - -script13 = '''\ -update t1 set a = 2 where a = 1; -''' - -script14 = '''\ -delete from t1 where a = 1; -''' - with process.server(args=[], stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE) as s: -client(script1) -client(script3) -client(script4) -client(script2) -client(script5) +with SQLTestCase() as tc: +tc.connect(username="monetdb", password="monetdb") +tc.execute("create table t1 (a int);").assertSucceeded() +tc.execute("insert into t1 (a) values ( 1 );").assertSucceeded().assertRowCount(1) +tc.execute("select * from t1;").assertSucceeded().assertDataResultMatch([(1,)]) +tc.execute("create table t2 (a int);").assertSucceeded() +tc.execute("drop table t2;").assertSucceeded() server_stop(s) + with process.server(args=["--readonly"], stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE) as s: -client(script8) -client(script4) -client(script2) -client(script6) -client(script7) -client(script9) -client(script10) -client(script11) -client(script12) -client(script3) -client(script13) -client(script14) +with SQLTestCase() as tc: +tc.connect(username="monetdb", password="monetdb") +tc.execute("drop table t1;").assertFailed(err_message='Schema statements cannot be executed on a readonly database.') +tc.execute("select * from t1;").assertSucceeded().assertDataResultMatch([(1,)]) +tc.execute("create table t2 (a int);").assertFailed(err_message='Schema statements cannot be executed on a readonly database.') +tc.execute("create table t3 (a) as select * from t1 with data;").assertFailed(err_message='Schema statements cannot be executed on a readonly database.') +tc.execute("create table t4 (a) as select * from t1 with no data;").assertFailed(err_message='Schema statements cannot be executed on a readonly database.') +tc.execute("create table t5 ( like t1 );").assertFailed(err_message='Schema statements cannot be executed on a readonly database.') +tc.execute("create temporary table t6 ( a int);").assertFailed(err_message='Schema statements cannot be executed on a readonly database.') +tc.execute("create local temporary table t7 ( a int );").assertFailed(err_message='Schema statements cannot be executed on a readon
MonetDB: default - Implemented function usweekofyear(date) to ca...
Changeset: 9af4bc30e811 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9af4bc30e811 Modified Files: clients/Tests/MAL-signatures.stable.out clients/Tests/MAL-signatures.stable.out.int128 clients/Tests/exports.stable.out gdk/gdk_time.c gdk/gdk_time.h monetdb5/modules/atoms/mtime.c sql/common/sql_types.c sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.ppc64.int128 sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.32bit sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.int128 sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64 sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.ppc64.int128 sql/test/emptydb-upgrade-hge/Tests/upgrade.stable.out.int128 sql/test/emptydb-upgrade/Tests/upgrade.stable.out sql/test/emptydb-upgrade/Tests/upgrade.stable.out.32bit sql/test/emptydb-upgrade/Tests/upgrade.stable.out.int128 sql/test/emptydb/Tests/check.stable.out sql/test/emptydb/Tests/check.stable.out.32bit sql/test/emptydb/Tests/check.stable.out.int128 sql/test/testdb-upgrade-chain-hge/Tests/upgrade.stable.out.int128 sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.32bit sql/test/testdb-upgrade-chain/Tests/upgrade.stable.out.int128 sql/test/testdb-upgrade-hge/Tests/upgrade.stable.out.int128 sql/test/testdb-upgrade/Tests/upgrade.stable.out sql/test/testdb-upgrade/Tests/upgrade.stable.out.32bit sql/test/testdb-upgrade/Tests/upgrade.stable.out.int128 Branch: default Log Message: Implemented function usweekofyear(date) to calculate the week number US style. This fixes bug 6970. diffs (truncated from 31303 to 300 lines): diff --git a/clients/Tests/MAL-signatures.stable.out b/clients/Tests/MAL-signatures.stable.out --- a/clients/Tests/MAL-signatures.stable.out +++ b/clients/Tests/MAL-signatures.stable.out @@ -6259,6 +6259,8 @@ stdout of test 'MAL-signatures` in direc [ "batmtime", "timestamp_to_str", "pattern batmtime.timestamp_to_str(X_1:timestamp, X_2:bat[:str], X_3:bat[:oid]):bat[:str] ","MTIMEtimestamp_to_str_bulk_p1;", "" ] [ "batmtime", "timestamp_to_str", "pattern batmtime.timestamp_to_str(X_1:bat[:timestamp], X_2:str):bat[:str] ", "MTIMEtimestamp_to_str_bulk_p2;", "" ] [ "batmtime", "timestamp_to_str", "pattern batmtime.timestamp_to_str(X_1:bat[:timestamp], X_2:str, X_3:bat[:oid]):bat[:str] ","MTIMEtimestamp_to_str_bulk_p2;", "" ] +[ "batmtime", "usweekofyear", "pattern batmtime.usweekofyear(X_1:bat[:date]):bat[:int] ", "MTIMEdate_extract_usweekofyear_bulk;", "" ] +[ "batmtime", "usweekofyear", "pattern batmtime.usweekofyear(X_1:bat[:date], X_2:bat[:oid]):bat[:int] ", "MTIMEdate_extract_usweekofyear_bulk;", "" ] [ "batmtime", "weekofyear", "pattern batmtime.weekofyear(X_1:bat[:date]):bat[:int] ", "MTIMEdate_extract_weekofyear_bulk;", "" ] [ "batmtime", "weekofyear", "pattern batmtime.weekofyear(X_1:bat[:date], X_2:bat[:oid]):bat[:int] ","MTIMEdate_extract_weekofyear_bulk;", "" ] [ "batmtime", "year", "pattern batmtime.year(X_1:bat[:date]):bat[:int] ", "MTIMEdate_extract_year_bulk;", "" ] @@ -9089,6 +9091,7 @@ stdout of test 'MAL-signatures` in direc [ "mtime", "timestamp_sub_month_interval", "command mtime.timestamp_sub_month_interval(X_1:timestamp, X_2:int):timestamp ", "MTIMEtimestamp_sub_month_interval;", "" ] [ "mtime", "timestamp_sub_msec_interval", "command mtime.timestamp_sub_msec_interval(X_1:timestamp, X_2:lng):timestamp ", "MTIMEtimestamp_sub_msec_interval;","" ] [ "mtime", "timestamp_to_str", "command mtime.timestamp_to_str(X_1:timestamp, X_2:str):str ", "MTIMEtimestamp_to_str;", "" ] +[ "mtime", "usweekofyear", "command mtime.usweekofyear(X_1:date):int ", "MTIMEdate_extract_usweekofyear;", "" ] [ "mtime", "weekofyear", "command mtime.weekofyear(X_1:date):int ", "MTIMEdate_extract_weekofyear;","" ] [ "mtime", "year", "command mtime.year(X_1:date):int ", "MTIMEdate_extract_year;", "" ] [ "mtime", "year", "command mtime.year(X_1:int):int ", "MTIMEsql_year;", "" ] diff --git a/clients/Tests/MAL-signatures.stable.out.int128 b/clients/Tests/MAL-signatures.stable.out.int128 --- a/clients/Tests/MAL-signatures.stable.out.int128 +++ b/clients/Tests/MAL-signatures.stable.out.int128 @@ -8789,6 +8789,8 @@ stdout of test 'MAL-signatures` in direc [ "batmtime", "timestamp_to_str", "pattern batmtime.timestamp_to_str(X_1:timestamp, X_2:bat[:str], X_3:bat[:oi
MonetDB: Oct2020 - Document another optional build dependency.
Changeset: 63e7aeb649ea for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=63e7aeb649ea Modified Files: MonetDB.spec Branch: Oct2020 Log Message: Document another optional build dependency. diffs (27 lines): diff --git a/MonetDB.spec b/MonetDB.spec --- a/MonetDB.spec +++ b/MonetDB.spec @@ -161,16 +161,13 @@ BuildRequires: pkgconfig(libR) BuildRequires: texlive-obsolete %endif %endif -# if we were to compile with cmocka support (-DWITH_CMOCKA=ON): -# BuildRequires: pkgconfig(cmocka) -# if we were to compile with NetCDF support (-DNETCDF=ON): -# BuildRequires: pkgconfig(netcdf) -# if we were to compile with proj support (-DWITH_PROJ=ON): -# BuildRequires: pkgconfig(proj) -# if we were to compile with snappy support (-DWITH_SNAPPY=ON): -# BuildRequires: pkgconfig(snappy) -# if we were to compile with valgrind support (-DWITH_VALGRIND=ON): -# BuildRequires: pkgconfig(valgrind) +# optional packages: +# BuildRequires: pkgconfig(cmocka) # -DWITH_CMOCKA=ON +# BuildRequires: pkgconfig(gdal) # -DSHP=ON +# BuildRequires: pkgconfig(netcdf) # -DNETCDF=ON +# BuildRequires: pkgconfig(proj) # -DWITH_PROJ=ON +# BuildRequires: pkgconfig(snappy) # -DWITH_SNAPPY=ON +# BuildRequires: pkgconfig(valgrind) # -DWITH_VALGRIND=ON %if (0%{?fedora} >= 22) Recommends: %{name}-SQL-server5%{?_isa} = %{version}-%{release} ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Unify int128 and no-int128 with a single Python...
Changeset: b23280d156b9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b23280d156b9 Added Files: sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.py Removed Files: sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err.int128 sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.out.int128 sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.test Modified Files: sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.out Branch: mtest Log Message: Unify int128 and no-int128 with a single Python test diffs (263 lines): diff --git a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.py rename from sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql rename to sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.py --- a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.sql +++ b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.py @@ -1,3 +1,7 @@ -select 'a'+1; -select 1-'a'; -select true+1; +from MonetDBtesting.sqltest import SQLTestCase + +with SQLTestCase() as tc: +tc.connect(username="monetdb", password="monetdb") +tc.execute("select 'a'+1;").assertFailed() +tc.execute("select 1-'a';").assertFailed() +tc.execute("select true+1;").assertSucceeded().assertDataResultMatch([(2,)]) diff --git a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err --- a/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err +++ b/sql/test/BugDay_2005-10-06_2.8/Tests/mixed_type.SF-917372.stable.err @@ -5,88 +5,6 @@ stderr of test 'mixed_type.SF-917372` in # 19:21:06 > mserver5 "--config=/ufs/niels/scratch/monetdb/Linux-x86_64/etc/monetdb5.conf" --debug=10 --set gdk_nr_threads=4 --set "monet_mod_path=/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB5:/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB5/lib:/ufs/niels/scratch/monetdb/Linux-x86_64/lib/MonetDB5/bin" --set "gdk_dbfarm=/ufs/niels/scratch/monetdb/Linux-x86_64/var/MonetDB5/dbfarm" --set "sql_logdir=/ufs/niels/scratch/monetdb/Linux-x86_64/var/MonetDB5/sql_logs" --set mapi_open=true --set xrpc_open=true --set mapi_port=33392 --set xrpc_port=40415 --set monet_prompt= --trace "--dbname=mTests_src_test_BugDay_2005-10-06_2.8" --set mal_listing=0 "--dbinit= include sql;" ; echo ; echo Over.. # 19:21:06 > -# builtin opt gdk_arch = 64bitx86_64-unknown-linux-gnu -# builtin opt gdk_version = 1.27.0 -# builtin opt monet_pid = 25524 -# builtin opt prefix = /ufs/niels/scratch/monetdb/Linux-x86_64 -# builtin opt exec_prefix = ${prefix} -# builtin opt gdk_dbname = tst -# builtin opt gdk_dbfarm = ${prefix}/var/MonetDB -# builtin opt gdk_debug = 8 -# builtin opt gdk_mem_bigsize = 262144 -# builtin opt gdk_alloc_map = yes -# builtin opt gdk_mem_pagebits = 14 -# builtin opt gdk_vmtrim = yes -# builtin opt monet_admin = adm -# builtin opt monet_prompt = > -# builtin opt monet_welcome = yes -# builtin opt monet_mod_path = ${exec_prefix}/lib/MonetDB:${exec_prefix}/lib/bin -# builtin opt monet_daemon = yes -# builtin opt host = localhost -# builtin opt mapi_port = 5 -# builtin opt mapi_noheaders = no -# builtin opt mapi_debug = 0 -# builtin opt mapi_clients = 2 -# builtin opt sql_debug = 0 -# builtin opt sql_logdir = ${prefix}/var/MonetDB -# builtin opt xquery_logdir = ${prefix}/var/MonetDB -# builtin opt standoff_ns = http://monetdb.cwi.nl/standoff -# builtin opt standoff_start = start -# builtin opt standoff_end = end -# config opt prefix = /ufs/niels/scratch/monetdb/Linux-x86_64 -# config opt config = ${prefix}/etc/monetdb5.conf -# config opt prefix = /ufs/niels/scratch/monetdb/Linux-x86_64 -# config opt exec_prefix = ${prefix} -# config opt gdk_dbfarm = ${prefix}/var/MonetDB5/dbfarm -# config opt gdk_dbname = demo -# config opt gdk_alloc_map = no -# config opt gdk_embedded = no -# config opt gdk_debug = 0 -# config opt monet_mod_path = ${exec_prefix}/lib/MonetDB5:${exec_prefix}/lib/MonetDB5/lib:${exec_prefix}/lib/MonetDB5/bin -# config opt monet_daemon = no -# config opt monet_welcome = yes -# config opt mero_msglog = ${prefix}/var/log/merovingian.log -# config opt mero_errlog = ${prefix}/var/log/merovingian.log -# config opt mero_timeinterval = 600 -# config opt mero_pidfile = ${prefix}/var/run/merovingian.pid -# config opt mero_exittimeout = 7 -# config opt mero_doproxy = yes -# config opt mero_discoveryttl = 600 -# config opt mal_init = ${exec_prefix}/lib/MonetDB5/mal_init.mal -# config opt mal_listing = 2 -# config opt checkpoint_dir = ${prefix}/var/MonetDB5/chkpnt -# config opt mapi_port = 5 -# config
MonetDB: mtest - One more badly converted copy into test and upd...
Changeset: 6189446828ad for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6189446828ad Modified Files: sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe.SF-1146092.stable.out sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe.SF-1146092.test sql/test/BugDay_2005-10-06_2.9.3/Tests/foreign_key_in_frontend_crashes_backend.SF-935578.sql sql/test/BugDay_2005-10-06_2.9.3/Tests/foreign_key_in_frontend_crashes_backend.SF-935578.test Branch: mtest Log Message: One more badly converted copy into test and update another one diffs (truncated from 826 to 300 lines): diff --git a/sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe.SF-1146092.stable.out b/sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe.SF-1146092.stable.out --- a/sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe.SF-1146092.stable.out +++ b/sql/test/BugDay_2005-10-06_2.9.3/Tests/alter_table_describe.SF-1146092.stable.out @@ -1,9 +1,9 @@ stdout of test 'alter_table_describe.SF-1146092` in directory 'sql/test/BugDay_2005-10-06_2.9.3` itself: -# 16:42:02 > -# 16:42:02 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-179034" "--port=38242" -# 16:42:02 > +# 15:20:40 > +# 15:20:40 > "mclient" "-lsql" "-ftest" "-tnone" "-Eutf-8" "-i" "-e" "--host=/var/tmp/mtest-144955" "--port=33791" +# 15:20:40 > #CREATE TABLE "experiment" ( # "exp_id"int PRIMARY KEY, @@ -172,115 +172,115 @@ stdout of test 'alter_table_describe.SF- % 10, 0, 5, 0 # length [ "query_walk",NULL, "TABLE",NULL] #select * from describe_columns('sys', 'experiment'); -% .%3, .%3,.%3,.%3,.%3,.%3,.%3,.%3 # table_name -% name,type, digits, scale, nulls, cdefault, number, remark # name -% clob,clob, int,int,boolean,clob, int,clob # type -% 9, 3, 2, 1, 5, 0, 1, 0 # length -[ "exp_id","int", 32, 0, false, NULL, 0, NULL] -[ "user_id", "int", 32, 0, true, NULL, 1, NULL] -[ "config_id", "int", 32, 0, true, NULL, 2, NULL] -[ "table_id", "int", 32, 0, true, NULL, 3, NULL] -[ "result_id", "int", 32, 0, true, NULL, 4, NULL] +% .%3, .%3,.%3,.%3,.%3,.%3,.%3,.%3,.%3 # table_name +% name,type, digits, scale, nulls, cdefault, number, sqltype,remark # name +% clob,clob, int,int,boolean,clob, int,clob, clob # type +% 9, 3, 2, 1, 5, 0, 1, 7, 0 # length +[ "exp_id","int", 32, 0, false, NULL, 0, "INTEGER", NULL] +[ "user_id", "int", 32, 0, true, NULL, 1, "INTEGER", NULL] +[ "config_id", "int", 32, 0, true, NULL, 2, "INTEGER", NULL] +[ "table_id", "int", 32, 0, true, NULL, 3, "INTEGER", NULL] +[ "result_id", "int", 32, 0, true, NULL, 4, "INTEGER", NULL] #select * from describe_columns('sys', 'tapestry_user'); -% .%3, .%3,.%3,.%3,.%3,.%3,.%3,.%3 # table_name -% name,type, digits, scale, nulls, cdefault, number, remark # name -% clob,clob, int,int,boolean,clob, int,clob # type -% 10, 7, 2, 1, 5, 0, 1, 0 # length -[ "user_id", "int", 32, 0, false, NULL, 0, NULL] -[ "name", "varchar", 25, 0, true, NULL, 1, NULL ] -[ "email", "varchar", 50, 0, true, NULL, 2, NULL ] -[ "createdate","date", 0, 0, true, NULL, 3, NULL ] -[ "passwd","varchar", 50, 0, true, NULL, 4, NULL ] +% .%3, .%3,.%3,.%3,.%3,.%3,.%3,.%3,.%3 # table_name +% name,type, digits, scale, nulls, cdefault, number, sqltype,remark # name +% clob,clob, int,int,boolean,clob, int,clob, clob # type +% 10, 7, 2, 1, 5, 0, 1, 21, 0 # length +[ "user_id", "int", 32, 0, false, NULL, 0, "INTEGER", NULL] +[ "name", "varchar", 25, 0, true, NULL, 1, "CHARACTER VARYING(25)",NULL] +[ "email", "varchar", 50, 0, true, NULL, 2, "CHARACTER VARYING(50)",NULL] +[ "createdate","date", 0, 0, true, NULL, 3, "DATE", NULL] +[ "passwd","varchar", 50, 0, true, NULL, 4, "CHARACTER VARYING(50)",NULL] #select * from describe_columns('sys', 'config'); -% .%3, .%3,.%3,.%3,.%3,.%3,.%3,.%3 # table_name -% name,type,
MonetDB: mtest - small fix in sqltest output
Changeset: cda330ff5eb2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cda330ff5eb2 Modified Files: testing/sqltest.py Branch: mtest Log Message: small fix in sqltest output diffs (12 lines): diff --git a/testing/sqltest.py b/testing/sqltest.py --- a/testing/sqltest.py +++ b/testing/sqltest.py @@ -147,7 +147,7 @@ class SQLTestResult(object): def assertFailed(self, err_code=None, err_message=None): """assert on query failed with optional err_code if provided""" if self.query_error is None: -msg = "expected to fail but didn't\n{}".format(str(self.query_error)) +msg = "expected to fail but didn't" self.fail(msg) else: err_code_received, err_msg_received = utils.parse_mapi_err_msg(self.query_error.args[0]) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: copybinary - Adapt to Python3.6
Changeset: 7b538f7b4426 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b538f7b4426 Modified Files: sql/test/bincopy/Tests/bincopy_test_the_testdata.py Branch: copybinary Log Message: Adapt to Python3.6 diffs (12 lines): diff --git a/sql/test/bincopy/Tests/bincopy_test_the_testdata.py b/sql/test/bincopy/Tests/bincopy_test_the_testdata.py --- a/sql/test/bincopy/Tests/bincopy_test_the_testdata.py +++ b/sql/test/bincopy/Tests/bincopy_test_the_testdata.py @@ -7,7 +7,7 @@ import sys def check_testdata(args, expected): cmd = [ 'bincopydata', *(str(a) for a in args)] -output = subprocess.check_output(cmd, text=False) +output = subprocess.check_output(cmd, input=b"") if expected == output: return ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - More badly converted copy into tests
Changeset: c37fbe48fd0c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c37fbe48fd0c Modified Files: sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.test sql/test/BugTracker-2011/Tests/double_erange.Bug-2774.test sql/test/BugTracker-2012/Tests/hash_select.Bug-2947.test sql/test/BugTracker-2015/Tests/backslash_predecing_separator.Bug-3775.test sql/test/BugTracker-2015/Tests/cardinality.Bug-3761.test sql/test/BugTracker-2016/Tests/DISTINCT_with_correlated_scalar_subquery_crashes_mserver.Bug-3920.test sql/test/BugTracker-2016/Tests/outer_constant_predicate.Bug-4070.test sql/test/BugTracker-2017/Tests/skip_problem_best_effort.Bug-6442.test Branch: mtest Log Message: More badly converted copy into tests diffs (truncated from 3851 to 300 lines): diff --git a/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.test b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.test --- a/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.test +++ b/sql/test/BugTracker-2011/Tests/case-overflow.Bug-2239.test @@ -8,11 +8,12 @@ create table t2239 ( statement ok copy 3 records into t2239 from stdin - -statement error + 1537 1228 1214 + +query II rowsort select station136, cast(((CASE WHEN station136 is NULL THEN 0 ELSE station136 END) + (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) + @@ -47,6 +48,13 @@ select station136, (CASE WHEN station136 is NULL THEN 0 ELSE station136 END) + (CASE WHEN station136 is NULL THEN 0 ELSE station136 END)) as bigint) from t2239 order by station136 + +1214 +38848 +1228 +39296 +1537 +49184 statement ok rollback diff --git a/sql/test/BugTracker-2011/Tests/double_erange.Bug-2774.test b/sql/test/BugTracker-2011/Tests/double_erange.Bug-2774.test --- a/sql/test/BugTracker-2011/Tests/double_erange.Bug-2774.test +++ b/sql/test/BugTracker-2011/Tests/double_erange.Bug-2774.test @@ -123,12 +123,82 @@ insert into d2774 values (330,1e-330) query IR rowsort select * from f2774 -36 values hashing to 2580a73880058494c11dd3c3af9965f7 +300 +0.000 +302 +0.000 +304 +0.000 +306 +0.000 +307 +0.000 +308 +0.000 +310 +0.000 +312 +0.000 +314 +0.000 +316 +0.000 +318 +0.000 +320 +0.000 +322 +0.000 +323 +0.000 +324 +0.000 +326 +0.000 +328 +0.000 +330 +0.000 query IR rowsort select * from d2774 -36 values hashing to 2580a73880058494c11dd3c3af9965f7 +300 +0.000 +302 +0.000 +304 +0.000 +306 +0.000 +307 +0.000 +308 +0.000 +310 +0.000 +312 +0.000 +314 +0.000 +316 +0.000 +318 +0.000 +320 +0.000 +322 +0.000 +323 +0.000 +324 +0.000 +326 +0.000 +328 +0.000 +330 +0.000 statement ok delete from f2774 @@ -146,8 +216,29 @@ select * from d2774 statement ok copy 18 records into f2774 from stdin using delimiters ',',E'\n' + +300,1e-300 +302,1e-302 +304,1e-304 +306,1e-306 +307,1e-307 +308,1e-308 +310,1e-310 +312,1e-312 +314,1e-314 +316,1e-316 +318,1e-318 +320,1e-320 +322,1e-322 +323,1e-323 +324,1e-324 +326,1e-326 +328,1e-328 +330,1e-330 -statement error +statement ok +copy 18 records into d2774 from stdin using delimiters ',',E'\n' + 300,1e-300 302,1e-302 304,1e-304 @@ -166,32 +257,86 @@ 324,1e-324 326,1e-326 328,1e-328 330,1e-330 -copy 18 records into d2774 from stdin using delimiters ',',E'\n' -statement error -300,1e-300 -302,1e-302 -304,1e-304 -306,1e-306 -307,1e-307 -308,1e-308 -310,1e-310 -312,1e-312 -314,1e-314 -316,1e-316 -318,1e-318 -320,1e-320 -322,1e-322 -323,1e-323 -324,1e-324 -326,1e-326 -328,1e-328 -330,1e-330 +query IR rowsort select * from f2774 + +300 +0.000 +302 +0.000 +304 +0.000 +306 +0.000 +307 +0.000 +308 +0.000 +310 +0.000 +312 +0.000 +314 +0.000 +316 +0.000 +318 +0.000 +320 +0.000 +322 +0.000 +323 +0.000 +324 +0.000 +326 +0.000 +328 +0.000 +330 +0.000 query IR rowsort select * from d2774 +300 +0.000 +302 +0.000 +304 +0.000 +306 +0.000 +307 +0.000 +308 +0.000 +310 +0.000 +312 +0.000 +314 +0.000 +316 +0.000 +318 +0.000 +320 +0.000 +322 +0.000 +323 +0.000 +324 +0.000 +326 +0.000 +328 +0.000 +330 +0.000 statement ok delete from f2774 @@ -209,8 +354,20 @@ select * from d2774 statement ok copy 9 records into f2774 from stdin using delimiters ',',E'\n' + +300,1e-300 +302,1e-302 +304,1e-304 +306,1e-306 +307,1e-307 +324,1e-324 +326,1e-326 +328,1e-328 +330,1e-330 -statement error +statement ok +copy 9 records into d2774 from stdin using delimiters ',',E'\n' + 300,1e-300 302,1e-302 304,1e-304 @@ -220,23 +377,50 @@ 324,1e-324 326,1e-326 328,1e-328 330,1e-330 -copy 9 records into d2774 from stdin using delimiters ',',E'\n' -statement error -300,1e-300 -302,1e-302 -304,1e-304 -306,1e-306 -307,1e-307 -324,1e-324 -326,1e-326 -328,1e-328 -330,1e-330 +query IR rowsort select * from f2774 + +300 ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Check number of rows inserted
Changeset: 13af10c96fe5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=13af10c96fe5 Modified Files: sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.SQL.py sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py Branch: mtest Log Message: Check number of rows inserted diffs (73 lines): diff --git a/sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.SQL.py b/sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.SQL.py --- a/sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.SQL.py +++ b/sql/test/BugTracker-2011/Tests/user_create_temp_table.Bug-2916.SQL.py @@ -13,6 +13,7 @@ client = pymonetdb.connect(database=db, cursor = client.cursor() try: cursor.execute('CREATE GLOBAL TEMPORARY TABLE TempTable (i int)') +sys.stderr.write('Exception expected') except Exception as ex: if 'insufficient privileges for user \'t\' in schema \'tmp\'' not in ex.__str__(): sys.stderr.write(ex.__str__()) diff --git a/sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py b/sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py --- a/sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py +++ b/sql/test/BugTracker-2014/Tests/python-microseconds.Bug-3439.SQL.py @@ -4,35 +4,40 @@ dbh = pymonetdb.connect(port=int(os.gete cursor = dbh.cursor() cursor.execute('create table bug3439 (ts timestamp)') -cursor.execute("insert into bug3439 values ('2014-04-24 17:12:12.415')") +if cursor.execute("insert into bug3439 values ('2014-04-24 17:12:12.415')") != 1: +sys.stderr.write("Expected 1 row inserted") cursor.execute('select * from bug3439') if cursor.fetchall() != [(datetime.datetime(2014, 4, 24, 17, 12, 12, 415000),)]: sys.stderr.write("Expected [(datetime.datetime(2014, 4, 24, 17, 12, 12, 415000),)]") cursor.execute('drop table bug3439') cursor.execute('create table bug3439 (ts timestamp with time zone)') -cursor.execute("insert into bug3439 values ('2014-04-24 17:12:12.415 -02:00')") +if cursor.execute("insert into bug3439 values ('2014-04-24 17:12:12.415 -02:00')") != 1: +sys.stderr.write("Expected 1 row inserted") cursor.execute('select * from bug3439') if cursor.fetchall() != [(datetime.datetime(2014, 4, 24, 19, 12, 12, 415000),)]: sys.stderr.write("Expected [(datetime.datetime(2014, 4, 24, 19, 12, 12, 415000),)]") cursor.execute('drop table bug3439') cursor.execute('create table bug3439 (dt date)') -cursor.execute("insert into bug3439 values ('2014-04-24')") +if cursor.execute("insert into bug3439 values ('2014-04-24')") != 1: +sys.stderr.write("Expected 1 row inserted") cursor.execute('select * from bug3439') if cursor.fetchall() != [(datetime.date(2014, 4, 24),)]: sys.stderr.write("Expected [(datetime.date(2014, 4, 24),)]") cursor.execute('drop table bug3439') cursor.execute('create table bug3439 (ts time)') -cursor.execute("insert into bug3439 values ('17:12:12.415')") +if cursor.execute("insert into bug3439 values ('17:12:12.415')") != 1: +sys.stderr.write("Expected 1 row inserted") cursor.execute('select * from bug3439') if cursor.fetchall() != [(datetime.time(17, 12, 12),)]: sys.stderr.write("Expected [(datetime.time(17, 12, 12),)]") cursor.execute('drop table bug3439') cursor.execute('create table bug3439 (ts time with time zone)') -cursor.execute("insert into bug3439 values ('17:12:12.415 -02:00')") +if cursor.execute("insert into bug3439 values ('17:12:12.415 -02:00')") != 1: +sys.stderr.write("Expected 1 row inserted") cursor.execute('select * from bug3439') if cursor.fetchall() != [(datetime.time(19, 12, 12),)]: sys.stderr.write("Expected [(datetime.time(19, 12, 12),)]") diff --git a/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py b/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py --- a/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py +++ b/sql/test/BugTracker-2014/Tests/utf8bom.Bug-3436.SQL.py @@ -29,7 +29,8 @@ cursor.execute(''' start transaction; create table utf8bom (city string,id integer); ''') -cursor.execute("copy into utf8bom from r'%s' using delimiters ',',E'\\n','\"';" % os.path.join(TSTTRGDIR, 'utf8bom.csv')) +if cursor.execute("copy into utf8bom from r'%s' using delimiters ',',E'\\n','\"';" % os.path.join(TSTTRGDIR, 'utf8bom.csv')) != 2: +sys.stderr.write("Expected 2 rows inserted") cursor.execute("select * from utf8bom order by id;") if cursor.fetchall() != [('Montréal', 1621), ('New York', 8392)]: sys.stderr.write("Expected [('Montréal', 1621), ('New York', 8392)]") ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - More prepared statement tests yet to be converted
Changeset: f3720d385783 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f3720d385783 Modified Files: sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.test sql/test/BugTracker-2013/Tests/prepare-smallint.Bug-3297.test sql/test/BugTracker-2015/Tests/prepare_unop_crash.Bug-3653.test sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py sql/test/BugTracker-2016/Tests/prepare-utf8.Bug-3930.test sql/test/BugTracker-2016/Tests/rename_exps.Bug-3974.test sql/test/BugTracker-2017/Tests/error-clean-cache.Bug-6351.test sql/test/BugTracker-2017/Tests/round-or-truncate.Bug-6193.test sql/test/BugTracker-2019/Tests/prepared-merge-statement.Bug-6706.test sql/test/analytics/Tests/analytics20.test Branch: mtest Log Message: More prepared statement tests yet to be converted diffs (truncated from 314 to 300 lines): diff --git a/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.test b/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.test --- a/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.test +++ b/sql/test/BugTracker-2012/Tests/fixed_limit_for_prepare.Bug-3208.test @@ -38,7 +38,7 @@ CREATE TABLE wide("1" VARCHAR(255), "2" VARCHAR(255), "145" VARCHAR(255), "146" VARCHAR(255), "147" VARCHAR(255), "148" VARCHAR(255), "149" VARCHAR(255), "150" VARCHAR(255)) -statement error +statement ok PREPARE INSERT INTO wide("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", @@ -59,7 +59,7 @@ VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) -statement error +statement ok exec **('', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', @@ -72,7 +72,7 @@ exec **('', '', '', '', '', '', '', '', query I rowsort select count(*) from wide -0 +1 statement ok drop TABLE wide diff --git a/sql/test/BugTracker-2013/Tests/prepare-smallint.Bug-3297.test b/sql/test/BugTracker-2013/Tests/prepare-smallint.Bug-3297.test --- a/sql/test/BugTracker-2013/Tests/prepare-smallint.Bug-3297.test +++ b/sql/test/BugTracker-2013/Tests/prepare-smallint.Bug-3297.test @@ -1,42 +1,52 @@ statement ok CREATE TABLE ints ( val int ) -statement error +statement ok prepare INSERT INTO ints VALUES ( ? - 20 ) -statement error +statement ok exec **(1) -statement error +statement ok exec **(10) -statement error +statement ok exec **(100) -statement error +statement ok exec **(1000) -statement error +statement ok exec **(1) -statement error +statement ok exec **(10) -statement error +statement ok exec **(100) -statement error +statement ok exec **(1000) -statement error +statement ok exec **(1) -statement error +statement ok exec **(10) -query I rowsort +query I nosort select * from ints +-19 +-10 +80 +980 +9980 +99980 +80 +980 +9980 +99980 statement ok drop table ints diff --git a/sql/test/BugTracker-2015/Tests/prepare_unop_crash.Bug-3653.test b/sql/test/BugTracker-2015/Tests/prepare_unop_crash.Bug-3653.test --- a/sql/test/BugTracker-2015/Tests/prepare_unop_crash.Bug-3653.test +++ b/sql/test/BugTracker-2015/Tests/prepare_unop_crash.Bug-3653.test @@ -1,4 +1,4 @@ -statement error +statement ok PREPARE SELECT id FROM tables WHERE name = LOWER(?) diff --git a/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py b/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py --- a/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py +++ b/sql/test/BugTracker-2015/Tests/schemadiff.Bug-3778.SQL.py @@ -4,7 +4,7 @@ Test if server doesn't crash when remote Current result is an mal error (compilation failed) """ -import os, socket, pymonetdb, threading, tempfile +import os, sys, socket, pymonetdb, threading, tempfile try: from MonetDBtesting import process except ImportError: @@ -100,6 +100,7 @@ with tempfile.TemporaryDirectory() as tm try: c.execute("select * from " + shardtable + workers[0]['tpf'] ) +sys.stderr.write('Exception expected') except pymonetdb.OperationalError as e: if 'Parameter 1 has wrong SQL type, expected int, but got bigint instead' not in str(e): print(str(e)) diff --git a/sql/test/BugTracker-2016/Tests/prepare-utf8.Bug-3930.test b/sql/test/BugTracker-2016/Tests/prepare-utf8.Bug-3930.test --- a/sql/test/BugTracker-2016/Tests/prepare-utf8.
MonetDB: mtest - Don't forget the row counts
Changeset: 868a66d9141c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=868a66d9141c Modified Files: sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py sql/test/BugTracker-2020/Tests/global_table_propagation.Bug-6846.py sql/test/BugTracker-2020/Tests/remote-table-like.Bug-6841.py sql/test/BugTracker-2020/Tests/table-udf-on-remote.Bug-6971.py Branch: mtest Log Message: Don't forget the row counts diffs (166 lines): diff --git a/sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py b/sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py --- a/sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py +++ b/sql/test/BugTracker-2018/Tests/local_replica_table_not_detected.Bug-6620.py @@ -27,9 +27,11 @@ with tempfile.TemporaryDirectory() as fa conn1 = pymonetdb.connect(database='node1', port=prt1, autocommit=True) cur1 = conn1.cursor() cur1.execute("create table s1 (i int)") -cur1.execute("insert into s1 values (23), (42)") +if cur1.execute("insert into s1 values (23), (42)") != 2: +sys.stderr.write("2 rows inserted expected") cur1.execute("create table t1 (s varchar(10))") -cur1.execute("insert into t1 values ('abc'), ('efg')") +if cur1.execute("insert into t1 values ('abc'), ('efg')") != 2: +sys.stderr.write("2 rows inserted expected") cur1.close() conn1.close() @@ -43,9 +45,11 @@ with tempfile.TemporaryDirectory() as fa conn2 = pymonetdb.connect(database='node2', port=prt2, autocommit=True) cur2 = conn2.cursor() cur2.execute("create table s2 (i int)") -cur2.execute("insert into s2 values (23), (42)") +if cur2.execute("insert into s2 values (23), (42)") != 2: +sys.stderr.write("2 rows inserted expected") cur2.execute("create table t2 (s varchar(10))") -cur2.execute("insert into t2 values ('foo'), ('bar')") +if cur2.execute("insert into t2 values ('foo'), ('bar')") != 2: +sys.stderr.write("2 rows inserted expected") cur2.execute("create remote table s1 (i int) on 'mapi:monetdb://localhost:"+str(prt1)+"/node1';") cur2.execute("create remote table t1 (s varchar(10)) on 'mapi:monetdb://localhost:"+str(prt1)+"/node1';") diff --git a/sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py b/sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py --- a/sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py +++ b/sql/test/BugTracker-2018/Tests/remote-table-where-is-null.Bug-6601.py @@ -28,8 +28,10 @@ with tempfile.TemporaryDirectory() as fa node1_cur = node1_conn.cursor() node1_cur.execute("CREATE TABLE tbl (id INT, name TEXT)") -node1_cur.execute("INSERT INTO tbl VALUES (1, '1'), (2, '2')") -node1_cur.execute("INSERT INTO tbl (id) VALUES (3)") +if node1_cur.execute("INSERT INTO tbl VALUES (1, '1'), (2, '2')") != 2: +sys.stderr.write("2 rows inserted expected") +if node1_cur.execute("INSERT INTO tbl (id) VALUES (3)") != 1: +sys.stderr.write("1 row inserted expected") node1_cur.execute("SELECT * FROM tbl") if node1_cur.fetchall() != [(1, '1'), (2, '2'), (3, None)]: sys.stderr.write("[(1, '1'), (2, '2'), (3, None)] expected") diff --git a/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py b/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py --- a/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py +++ b/sql/test/BugTracker-2019/Tests/remote-table-non-existent-column.Bug-6750.py @@ -21,9 +21,11 @@ with tempfile.TemporaryDirectory() as fa cur1 = conn1.cursor() cur1.execute("start transaction;") cur1.execute("create table tab1 (col1 clob);") -cur1.execute("insert into tab1 values ('a');") +if cur1.execute("insert into tab1 values ('a');") != 1: +sys.stderr.write("1 row inserted expected") cur1.execute("create table tab2 (col1 tinyint);") -cur1.execute("insert into tab2 values (1);") +if cur1.execute("insert into tab2 values (1);") != 1: +sys.stderr.write("1 row inserted expected") cur1.execute("commit;") prt2 = freeport() @@ -38,11 +40,13 @@ with tempfile.TemporaryDirectory() as fa cur2.execute("create remote table tab2 (col1 double) on 'mapi:monetdb://localhost:"+str(prt1)+"/node1';") try: cur2.execute("select col2 from tab1;") # col2 doesn't exist +
MonetDB: mtest - Merged with default
Changeset: 15df7e6b4338 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=15df7e6b4338 Modified Files: sql/test/Dependencies/Tests/dependency_functions.sql sql/test/Dependencies/Tests/dependency_functions.test sql/test/miscellaneous/Tests/simple_selects.test Branch: mtest Log Message: Merged with default diffs (truncated from 130127 to 300 lines): diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -80,9 +80,9 @@ def main(): r'lib\MonetODBC.dll', # r'lib\MonetODBC.pdb', r'lib\MonetODBCs.dll', # r'lib\MonetODBCs.pdb', r'bin\stream.dll', # r'lib\stream.pdb', - vcpkg.format(r'bin\libiconv.dll'), + vcpkg.format(r'bin\iconv-2.dll'), vcpkg.format(r'bin\bz2.dll'), - vcpkg.format(r'bin\libcharset.dll'), # for libiconv.dll + vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll vcpkg.format(r'bin\libcrypto-1_1{}.dll'.format(libcrypto)), vcpkg.format(r'bin\zlib1.dll')]) print(r'') diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -145,10 +145,10 @@ def main(): r'bin\monetdb5.dll', r'bin\monetdbsql.dll', r'bin\stream.dll', - vcpkg.format(r'bin\libiconv.dll'), + vcpkg.format(r'bin\iconv-2.dll'), vcpkg.format(r'bin\bz2.dll'), + vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll vcpkg.format(r'bin\getopt.dll'), - vcpkg.format(r'bin\libcharset.dll'), # for libiconv.dll vcpkg.format(r'bin\libcrypto-1_1{}.dll'.format(libcrypto)), vcpkg.format(r'bin\libxml2.dll'), vcpkg.format(r'bin\lz4.dll'), @@ -199,10 +199,10 @@ def main(): r'lib\monetdb5.lib', r'lib\monetdbsql.lib', r'lib\stream.lib', - vcpkg.format(r'lib\libiconv.lib'), + vcpkg.format(r'lib\iconv.lib'), vcpkg.format(r'lib\bz2.lib'), + vcpkg.format(r'lib\charset.lib'), vcpkg.format(r'lib\getopt.lib'), - vcpkg.format(r'lib\libcharset.lib'), vcpkg.format(r'lib\libcrypto.lib'), vcpkg.format(r'lib\libxml2.lib'), vcpkg.format(r'lib\lz4.lib'), diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -46,76 +46,6 @@ #include "msqldump.h" -static const char * -get_with_comments_as_clause(Mapi mid) -{ - const char *query = /* check whether sys.comments exists */ - "SELECT t.id " - "FROM sys._tables t JOIN sys.schemas s ON t.schema_id = s.id " - "WHERE s.name = 'sys' AND t.name = 'comments'"; - const char *new_clause = - "WITH comments AS (SELECT * FROM sys.comments), " -"function_types AS (SELECT * FROM sys.function_types), " -"function_languages AS (SELECT * FROM sys.function_languages)"; - const char *old_clause = - "WITH comments AS (" - "SELECT 42 AS id, 'no comment' AS remark WHERE FALSE" -"), " -"function_types AS (" - "SELECT function_type_id, function_type_name, function_type_keyword " - "FROM sys.function_types, " -"(VALUES " - "(1, 'FUNCTION'), " - "(2, 'PROCEDURE'), " - "(3, 'AGGREGATE'), " - "(4, 'FILTER FUNCTION'), " - "(5, 'FUNCTION'), " - "(6, 'FUNCTION'), " - "(7, 'LOADER')) AS (id, function_type_keyword) " - "WHERE id = function_type_id" -"), " -"function_languages AS (" - "SELECT language_id, language_name, language_keyword " - "FROM sys.function_languages, (VALUES " - "(3, 'R'), " - "(4, 'C'), " - "(6, 'PYTHON'), " - "(7, 'PYTHON_MAP'), " - "(8, 'PYTHON2'), " - "(9, 'PYTHON2_MAP'), " - "(10, 'PYTHON3'), " - "(11, 'PYTHON3_MAP'), " - "(12, 'CPP')) AS (id, language_keyword) " - "WHERE id = language_id" -")"; - - bool has_sys_comments = false; - MapiHdl hdl = mapi_query(mid, query); - if (hdl) { - if (mapi_error(mid
MonetDB: default - Merged with Oct2020
Changeset: 803d2aa8de78 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=803d2aa8de78 Modified Files: gdk/gdk_utils.c tools/merovingian/daemon/controlrunner.c Branch: default Log Message: Merged with Oct2020 diffs (211 lines): diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -70,7 +70,6 @@ function(monetdb_configure_defines) # Linux specific, in the future, it might be ported to other platforms check_symbol_exists("fallocate" "fcntl.h" HAVE_FALLOCATE) check_function_exists("fcntl" HAVE_FCNTL) - check_symbol_exists("F_GETLK" "fcntl.h" HAVE_F_GETLK) check_symbol_exists("fork" "unistd.h" HAVE_FORK) check_symbol_exists("fsync" "unistd.h" HAVE_FSYNC) check_symbol_exists("ftime" "sys/timeb.h" HAVE_FTIME) @@ -181,13 +180,7 @@ macro(monetdb_macro_variables) if(HAVE_GETOPT_H) set(HAVE_GETOPT 1) endif() - # Check with STATIC_CODE_ANALYSIS # compiler options, profiling (google perf tools), valgrind - set(ENABLE_STATIC_ANALYSIS -"NO" -CACHE -STRING -"Configure for static code analysis (use only if you know what you are doing)") # Check that posix regex is available when pcre is not found # "monetdb5/module/mal/pcre.c" assumes the regex library is available # as an alternative without checking this in the C code. diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake --- a/cmake/monetdb-options.cmake +++ b/cmake/monetdb-options.cmake @@ -17,41 +17,41 @@ else() set(DEVELOPMENT FALSE) endif() -option(TESTING +option(TESTING "Enable support for testing" ON) -cmake_dependent_option(CINTEGRATION +cmake_dependent_option(CINTEGRATION "Enable support for C UDFs (default=ON)" ON "NOT WIN32" OFF) -option(PY3INTEGRATION +option(PY3INTEGRATION "Enable support for Python 3 integration into MonetDB (default=ON)" ON) -option(RINTEGRATION +option(RINTEGRATION "Enable support for R integration into MonetDB (default=ON)" ON) -option(FITS +option(FITS "Enable support for FITS (default=ON)" ON) option(GEOM "Enable support for geom module (default=ON)" - ON) + ON) -option(INT128 +option(INT128 "Enable support for 128-bit integers (default=ON)" - ON) - -option(NETCDF - "Enable support for netcdf (default=ON)" ON) -option(ODBC +option(NETCDF + "Enable support for netcdf (default=ON)" + ON) + +option(ODBC "Compile the MonetDB ODBC driver (default=ON)" ON) @@ -61,15 +61,19 @@ cmake_dependent_option(SHP "GEOM" OFF) -option(SANITIZER +option(SANITIZER "Enable support for the GCC address sanitizer (default=OFF)" OFF) -option(STRICT +option(STATIC_CODE_ANALYSIS + "configure for static code analysis (use only if you know what you are doing) (default=OFF)" + OFF) + +option(STRICT "Enable strict compiler flags (default=ON for development sources, OFF for tarball installation)" "${DEVELOPMENT}") -option(ASSERT +option(ASSERT "Enable asserts (default=ON for development sources, OFF for tarball installation)" "${DEVELOPMENT}") diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c --- a/common/utils/msabaoth.c +++ b/common/utils/msabaoth.c @@ -681,39 +681,6 @@ msab_getMyStatus(sabdb** ret) #define MAINTENANCEFILE ".maintenance" -#ifndef WIN32 -/* returns pid of the process holding the gdk lock, or 0 if that is not possible. - * 'not possible' could be for a variety of reasons. - */ -static pid_t -MT_get_locking_pid(const char *filename) -{ -#if !defined(HAVE_FCNTL) || !defined(HAVE_F_GETLK) - (void)filename; - return 0; -#else - int fd; - struct flock fl = { - .l_type = F_WRLCK, - .l_whence = SEEK_SET, - .l_start = 4, - .l_len = 1, - }; - pid_t pid = 0; - - fd = open(filename, O_RDONLY | O_CLOEXEC, 0); - if (fd < 0) - return 0; - - if (fcntl(fd, F_GETLK, &fl) == 0) - pid = fl.l_pid; - - close(fd); - return pid; -#endif -} -#endif - static sabdb * msab_getSingleStatus(const char *pathbuf, const char *dbname, sabdb *next) { @@ -732,11 +699,9 @@ msab_getSingleStatus(const char *pathbuf return next; sdb = malloc(sizeof(sabdb)); - *sdb = (sabdb) { 0 }; - sdb->uplog = NULL; - sdb->uri = NULL; - sdb->secret = NULL; - sdb->next = next; + *sdb = (sabdb) { + .next = next, + }; /* store the database name */ snprintf(buf, sizeof(buf), "%s/%s", pathbuf, dbname); @@ -788,8 +753,13 @@ msab_getSingleStatus(const char *pathbuf sdb->state = SABdbInactive; } else if (fd == -1) { #ifndef WIN32 - /* file is locked, so mserver is running. can we find it? */ - sdb->pid = MT_get_locking_pid(buf); + /* extract pro
MonetDB: mtest - There's no need to use Python for the dependenc...
Changeset: 9e11403e8ab5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9e11403e8ab5 Added Files: sql/test/Dependencies/Tests/dependency_DBobjects.reqtests sql/test/Dependencies/Tests/dependency_DBobjects.sql sql/test/Dependencies/Tests/dependency_DBobjects.stable.err sql/test/Dependencies/Tests/dependency_DBobjects.stable.out sql/test/Dependencies/Tests/dependency_DBobjects.test sql/test/Dependencies/Tests/dependency_functions.reqtests sql/test/Dependencies/Tests/dependency_functions.sql sql/test/Dependencies/Tests/dependency_functions.stable.err sql/test/Dependencies/Tests/dependency_functions.stable.out sql/test/Dependencies/Tests/dependency_functions.test sql/test/Dependencies/Tests/dependency_owner_schema_1.sql sql/test/Dependencies/Tests/dependency_owner_schema_1.stable.err sql/test/Dependencies/Tests/dependency_owner_schema_1.stable.out sql/test/Dependencies/Tests/dependency_owner_schema_1.test sql/test/Dependencies/Tests/dependency_owner_schema_2.reqtests sql/test/Dependencies/Tests/dependency_owner_schema_2.sql sql/test/Dependencies/Tests/dependency_owner_schema_2.stable.err sql/test/Dependencies/Tests/dependency_owner_schema_2.stable.out sql/test/Dependencies/Tests/dependency_owner_schema_2.test sql/test/Dependencies/Tests/dependency_owner_schema_3.reqtests sql/test/Dependencies/Tests/dependency_owner_schema_3.sql sql/test/Dependencies/Tests/dependency_owner_schema_3.stable.err sql/test/Dependencies/Tests/dependency_owner_schema_3.stable.out sql/test/Dependencies/Tests/dependency_owner_schema_3.test Removed Files: sql/test/Dependencies/Tests/Dependencies.SQL.py sql/test/Dependencies/Tests/Dependencies.stable.err sql/test/Dependencies/Tests/Dependencies.stable.out sql/test/Dependencies/dependency_DBobjects.sql sql/test/Dependencies/dependency_functions.sql sql/test/Dependencies/dependency_owner_schema_1.sql sql/test/Dependencies/dependency_owner_schema_2.sql sql/test/Dependencies/dependency_owner_schema_3.sql sql/test/Dependencies/run.all Modified Files: sql/test/Dependencies/Tests/All Branch: mtest Log Message: There's no need to use Python for the dependencies tests. Run them in sequence instead diffs (truncated from 3492 to 300 lines): diff --git a/sql/test/Dependencies/Tests/All b/sql/test/Dependencies/Tests/All --- a/sql/test/Dependencies/Tests/All +++ b/sql/test/Dependencies/Tests/All @@ -1,3 +1,7 @@ -HAVE_GEOM?Dependencies +HAVE_GEOM?dependency_owner_schema_1 +USER=monet_test&PASSWD=pass_test&HAVE_GEOM?dependency_owner_schema_2 +HAVE_GEOM?dependency_DBobjects +HAVE_GEOM?dependency_functions +HAVE_GEOM?dependency_owner_schema_3 HAVE_GEOM?dependency_loop view_table_udf diff --git a/sql/test/Dependencies/Tests/Dependencies.SQL.py b/sql/test/Dependencies/Tests/Dependencies.SQL.py deleted file mode 100644 --- a/sql/test/Dependencies/Tests/Dependencies.SQL.py +++ /dev/null @@ -1,35 +0,0 @@ -import os, sys -try: -from MonetDBtesting import process -except ImportError: -import process - -def client(cmd, infile, user = 'monetdb', passwd = 'monetdb'): -with process.client(cmd, user = user, passwd = passwd, -stdin = open(infile), stdout = process.PIPE, -stderr = process.PIPE) as clt: -out, err = clt.communicate() -sys.stdout.write(out) -sys.stderr.write(err) - -def main(): -sys.stdout.write('Dependencies between User and Schema\n') -client('sql', os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'dependency_owner_schema_1.sql')) -sys.stdout.write('done\n') - -client('sql', os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'dependency_owner_schema_2.sql'), user = 'monet_test', passwd = 'pass_test') -sys.stdout.write('done\n') - -sys.stdout.write('Dependencies between database objects\n') -client('sql', os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'dependency_DBobjects.sql')) -sys.stdout.write('done\n') - -sys.stdout.write('Dependencies between functions with same name\n') -client('sql', os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'dependency_functions.sql')) -sys.stdout.write('done\n') - -sys.stdout.write('Cleanup\n') -client('sql', os.path.join(os.getenv('RELSRCDIR'), os.pardir, 'dependency_owner_schema_3.sql')) -sys.stdout.write('done\n') - -main() diff --git a/sql/test/Dependencies/Tests/Dependencies.stable.err b/sql/test/Dependencies/Tests/Dependencies.stable.err deleted file mode 100644 --- a/sql/test/Dependencies/Tests/Dependencies.stable.err +++ /dev/null @@ -1,107 +0,0 @@ -stderr of test 'Dependencies` in directory 'sql/test/Dependencies` itself: - - -# 09:38:22 > -# 09:38:22 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_open=
MonetDB: Oct2020 - Reinstate build option STATIC_CODE_ANALYSIS.
Changeset: d70aa4abcb3c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=d70aa4abcb3c Modified Files: cmake/monetdb-defines.cmake cmake/monetdb-options.cmake monetdb_config.h.in Branch: Oct2020 Log Message: Reinstate build option STATIC_CODE_ANALYSIS. diffs (109 lines): diff --git a/cmake/monetdb-defines.cmake b/cmake/monetdb-defines.cmake --- a/cmake/monetdb-defines.cmake +++ b/cmake/monetdb-defines.cmake @@ -180,13 +180,7 @@ macro(monetdb_macro_variables) if(HAVE_GETOPT_H) set(HAVE_GETOPT 1) endif() - # Check with STATIC_CODE_ANALYSIS # compiler options, profiling (google perf tools), valgrind - set(ENABLE_STATIC_ANALYSIS -"NO" -CACHE -STRING -"Configure for static code analysis (use only if you know what you are doing)") # Check that posix regex is available when pcre is not found # "monetdb5/module/mal/pcre.c" assumes the regex library is available # as an alternative without checking this in the C code. diff --git a/cmake/monetdb-options.cmake b/cmake/monetdb-options.cmake --- a/cmake/monetdb-options.cmake +++ b/cmake/monetdb-options.cmake @@ -17,41 +17,41 @@ else() set(DEVELOPMENT FALSE) endif() -option(TESTING +option(TESTING "Enable support for testing" ON) -cmake_dependent_option(CINTEGRATION +cmake_dependent_option(CINTEGRATION "Enable support for C UDFs (default=ON)" ON "NOT WIN32" OFF) -option(PY3INTEGRATION +option(PY3INTEGRATION "Enable support for Python 3 integration into MonetDB (default=ON)" ON) -option(RINTEGRATION +option(RINTEGRATION "Enable support for R integration into MonetDB (default=ON)" ON) -option(FITS +option(FITS "Enable support for FITS (default=ON)" ON) option(GEOM "Enable support for geom module (default=ON)" - ON) + ON) -option(INT128 +option(INT128 "Enable support for 128-bit integers (default=ON)" - ON) - -option(NETCDF - "Enable support for netcdf (default=ON)" ON) -option(ODBC +option(NETCDF + "Enable support for netcdf (default=ON)" + ON) + +option(ODBC "Compile the MonetDB ODBC driver (default=ON)" ON) @@ -61,15 +61,19 @@ cmake_dependent_option(SHP "GEOM" OFF) -option(SANITIZER +option(SANITIZER "Enable support for the GCC address sanitizer (default=OFF)" OFF) -option(STRICT +option(STATIC_CODE_ANALYSIS + "configure for static code analysis (use only if you know what you are doing) (default=OFF)" + OFF) + +option(STRICT "Enable strict compiler flags (default=ON for development sources, OFF for tarball installation)" "${DEVELOPMENT}") -option(ASSERT +option(ASSERT "Enable asserts (default=ON for development sources, OFF for tarball installation)" "${DEVELOPMENT}") diff --git a/monetdb_config.h.in b/monetdb_config.h.in --- a/monetdb_config.h.in +++ b/monetdb_config.h.in @@ -214,6 +214,8 @@ #cmakedefine LIBDIR "@LIBDIR@" #cmakedefine LOCALSTATEDIR "@LOCALSTATEDIR@" +#cmakedefine STATIC_CODE_ANALYSIS 1 + // End Section: monetdb macro variables // Section: monetdb configure misc ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Silenced more tests, and don't forget row count...
Changeset: 0e0f8b453845 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=0e0f8b453845 Modified Files: sql/test/merge-partitions/Tests/mergepart23.SQL.py sql/test/rename/Tests/rename00.SQL.py sql/test/rename/Tests/rename00.stable.err sql/test/rename/Tests/rename00.stable.out sql/test/rename/Tests/rename11.py sql/test/rename/Tests/rename11.stable.err sql/test/rename/Tests/rename11.stable.out Branch: mtest Log Message: Silenced more tests, and don't forget row count on update statements diffs (truncated from 349 to 300 lines): diff --git a/sql/test/merge-partitions/Tests/mergepart23.SQL.py b/sql/test/merge-partitions/Tests/mergepart23.SQL.py --- a/sql/test/merge-partitions/Tests/mergepart23.SQL.py +++ b/sql/test/merge-partitions/Tests/mergepart23.SQL.py @@ -62,8 +62,8 @@ with tempfile.TemporaryDirectory() as fa tc.execute('SELECT "minimum", "maximum" FROM range_partitions;').assertSucceeded().assertDataResultMatch([("5","10"),(None,None),("11","20")]) tc.execute('ALTER TABLE testme ADD TABLE subtable2 AS PARTITION FROM 11 TO 20;').assertSucceeded() tc.execute('ALTER TABLE anothertest ADD TABLE subtable4 AS PARTITION FROM 21 TO 30;').assertSucceeded() -tc.execute("INSERT INTO testme VALUES (5, 'one'), (12, 'two'), (13, 'three'), (15, 'four'), (NULL, 'five');").assertSucceeded() -tc.execute("INSERT INTO anothertest VALUES (11, 'one'), (12, 'two'), (13, 'three'), (15, 'four');").assertSucceeded() +tc.execute("INSERT INTO testme VALUES (5, 'one'), (12, 'two'), (13, 'three'), (15, 'four'), (NULL, 'five');").assertSucceeded().assertRowCount(5) +tc.execute("INSERT INTO anothertest VALUES (11, 'one'), (12, 'two'), (13, 'three'), (15, 'four');").assertSucceeded().assertRowCount(4) tc.execute('SELECT a,b FROM testme;').assertSucceeded().assertDataResultMatch([(5,"one"),(None,"five"),(12,"two"),(13,"three"),(15,"four")]) tc.execute('SELECT a,b FROM anothertest;').assertSucceeded().assertDataResultMatch([(11,"one"),(12,"two"),(13,"three"),(15,"four")]) tc.execute('SELECT "minimum", "maximum" FROM range_partitions;').assertSucceeded().assertDataResultMatch([("5","10"),(None,None),("11","20"),("11","20"),("21","30")]) @@ -94,7 +94,7 @@ with tempfile.TemporaryDirectory() as fa tc.execute('CREATE TABLE subtable2 (a int, b varchar(32));').assertSucceeded() tc.execute('CREATE TABLE subtable3 (a int, b varchar(32));').assertSucceeded() tc.execute('ALTER TABLE upsme ADD TABLE subtable3 AS PARTITION FOR NULL VALUES;').assertSucceeded() -tc.execute("INSERT INTO upsme VALUES (NULL, 'one');").assertSucceeded() +tc.execute("INSERT INTO upsme VALUES (NULL, 'one');").assertSucceeded().assertRowCount(1) tc.execute('ALTER TABLE upsme ADD TABLE subtable1 AS PARTITION IN (15, 25, 35);').assertSucceeded() tc.execute('ALTER TABLE upsme ADD TABLE subtable2 AS PARTITION IN (45, 55, 65);').assertSucceeded() tc.execute('SELECT "value" FROM value_partitions;').assertSucceeded().assertDataResultMatch([(None,),("15",),("25",),("35",),("45",),("55",),("65",)]) @@ -105,8 +105,8 @@ with tempfile.TemporaryDirectory() as fa stderr=process.PIPE) as s: with SQLTestCase() as tc: tc.connect(username="monetdb", password="monetdb", port=myport, database='db1') -tc.execute("INSERT INTO upsme VALUES (10, 'two'), (40, 'three'), (NULL, 'four');").assertSucceeded() -tc.execute("INSERT INTO subtable3 VALUES (NULL, 'five');").assertSucceeded() +tc.execute("INSERT INTO upsme VALUES (10, 'two'), (40, 'three'), (NULL, 'four');").assertSucceeded().assertRowCount(3) +tc.execute("INSERT INTO subtable3 VALUES (NULL, 'five');").assertSucceeded().assertRowCount(1) tc.execute('SELECT a,b FROM upsme;').assertSucceeded().assertDataResultMatch([(10,"two"),(40,"three"),(None,"one"),(None,"four"),(None,"five")]) tc.execute('SELECT a,b FROM subtable1;').assertSucceeded().assertDataResultMatch([(10,"two")]) tc.execute('SELECT a,b FROM subtable2;').assertSucceeded().assertDataResultMatch([(40,"three")]) diff --git a/sql/test/rename/Tests/rename00.SQL.py b/sql/test/rename/Tests/rename00.SQL.py --- a/sql/test/rename/Tests/rename00.SQL.py +++ b/sql/test/rename/Tests/rename00.SQL.py @@ -1,4 +1,7 @@ import os, socket, sys, tempfile + +from MonetDBtesting.sqltest import SQLTestCase + try: from MonetDBtesting import process except ImportError: @@ -13,29 +16,8 @@ def freeport(): def server_stop(s): out, err = s.communicate() -sys.stdout.write(out) sys.stderr.write(err) -def client(input): -with process.client('sql', port=myport, dbname='db1', stdin=process.PIPE, stdout=process.PIPE, stderr=proces
MonetDB: mtest - This test can be converted
Changeset: 2efcfb34824e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2efcfb34824e Added Files: sql/test/miscellaneous/Tests/prepare.test Branch: mtest Log Message: This test can be converted diffs (12 lines): diff --git a/sql/test/miscellaneous/Tests/prepare.test b/sql/test/miscellaneous/Tests/prepare.test new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/prepare.test @@ -0,0 +1,7 @@ +statement error +prepare select 1=?+? + +statement error +exec ** (1,0) + + ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Silenced sql/test/miscellaneous Python tests
Changeset: 455aab28d0d9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=455aab28d0d9 Modified Files: sql/test/miscellaneous/Tests/pk_fk_stress.SQL.py sql/test/miscellaneous/Tests/pk_fk_stress.stable.out sql/test/miscellaneous/Tests/table_udf_missing_var.py sql/test/miscellaneous/Tests/table_udf_missing_var.stable.out Branch: mtest Log Message: Silenced sql/test/miscellaneous Python tests diffs (244 lines): diff --git a/sql/test/miscellaneous/Tests/pk_fk_stress.SQL.py b/sql/test/miscellaneous/Tests/pk_fk_stress.SQL.py --- a/sql/test/miscellaneous/Tests/pk_fk_stress.SQL.py +++ b/sql/test/miscellaneous/Tests/pk_fk_stress.SQL.py @@ -8,6 +8,8 @@ barrier1 = threading.Barrier(3) barrier2 = threading.Barrier(3) MAX_ITERATIONS = 100 +vals = [[(1,)],[(3,), (4,)],[(7,)],[(10,)],[(13,)],[(16,)],[(19,)],[(22,)],[(25,)],[(28,)],[(31,)],[(34,)],[(37,)],[(40,)],[(43,)],[(46,)],[(49,)],[(52,)],[(55,)], +[(58,)],[(61,)],[(64,)],[(67,)], [(70,)],[(73,)]] cursor1.execute(""" START TRANSACTION; @@ -26,6 +28,8 @@ class TestClient1(threading.Thread): def run(self): i = 0 +vals_i = 0 + while i < MAX_ITERATIONS: next_action = i % 4 @@ -33,7 +37,9 @@ class TestClient1(threading.Thread): self._cursor.execute('INSERT INTO tbl1;') elif next_action == 1: self._cursor.execute('SELECT col1 FROM tbl1;') -print([x[0] for x in self._cursor.fetchall()]) +if self._cursor.fetchall() != vals[vals_i]: +sys.stderr.write("Expected %s" % str(vals[vals_i])) +vals_i += 1 elif next_action == 2: self._cursor.execute(""" START TRANSACTION; @@ -58,6 +64,8 @@ class TestClient2(threading.Thread): def run(self): i = 0 +vals_i = 0 + while i < MAX_ITERATIONS: next_action = i % 4 @@ -66,7 +74,9 @@ class TestClient2(threading.Thread): self._cursor.execute('INSERT INTO tbl2;') elif next_action == 1: self._cursor.execute('SELECT col2 FROM tbl2;') -print([x[0] for x in self._cursor.fetchall()]) +if self._cursor.fetchall() != vals[vals_i]: +sys.stderr.write("Expected %s" % str(vals[vals_i])) +vals_i += 1 elif next_action == 2: self._cursor.execute(""" START TRANSACTION; diff --git a/sql/test/miscellaneous/Tests/pk_fk_stress.stable.out b/sql/test/miscellaneous/Tests/pk_fk_stress.stable.out --- a/sql/test/miscellaneous/Tests/pk_fk_stress.stable.out +++ b/sql/test/miscellaneous/Tests/pk_fk_stress.stable.out @@ -5,108 +5,6 @@ stdout of test 'pk_fk_stress` in directo # 12:07:15 > "/usr/bin/python3" "pk_fk_stress.py" "pk_fk_stress" # 12:07:15 > -[1] -[1] -[3, 4] -[3, 4] -[7] -[7] -[10] -[10] -[13] -[13] -[16] -[16] -[19] -[19] -[22] -[22] -[25] -[25] -[28] -[28] -[31] -[31] -[34] -[34] -[37] -[37] -[40] -[40] -[43] -[43] -[46] -[46] -[49] -[49] -[52] -[52] -[55] -[55] -[58] -[58] -[61] -[61] -[64] -[64] -[67] -[67] -[70] -[70] -[73] -[73] -# MonetDB 5 server v11.35.10 (hg id: f9ad2ccd83b7) -# This is an unreleased version -# Serving database 'mTests_sql_test_miscellaneous', using 8 threads -# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers -# Found 15.498 GiB available main-memory of which we use 12.631 GiB -# Copyright (c) 1993 - July 2008 CWI. -# Copyright (c) August 2008 - 2020 MonetDB B.V., all rights reserved -# Visit https://www.monetdb.org/ for further information -# Listening for connection requests on mapi:monetdb://localhost.localdomain:35955/ -# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-34961/.s.monetdb.35955 -# MonetDB/GIS module loaded -# SQL catalog created, loading sql scripts once -# loading sql script: 09_like.sql -# loading sql script: 10_math.sql -# loading sql script: 12_url.sql -# loading sql script: 13_date.sql -# loading sql script: 14_inet.sql -# loading sql script: 15_querylog.sql -# loading sql script: 16_tracelog.sql -# loading sql script: 17_temporal.sql -# loading sql script: 18_index.sql -# loading sql script: 20_vacuum.sql -# loading sql script: 21_dependency_views.sql -# loading sql script: 22_clients.sql -# loading sql script: 23_skyserver.sql -# loading sql script: 25_debug.sql -# loading sql script: 26_sysmon.sql -# loading sql script: 27_rejects.sql -# loading sql script: 39_analytics.sql -# loading sql script: 39_analytics_hge.sql -# loading sql script: 40_geom.sql -# loading sql script: 40_json.sql -# loading sql script: 40_json_hge.sql -# loading sql script: 41_md5sum.sql -# loading sql script: 45_uuid.sql -# loading sql script: 46_profiler.sql -# loading sql script: 51_sys_schema_extension.sql -# loading sql script: 60_wlcr.sql -# loading sql script: 61_wlcr.sql -# loading sql script: 7
MonetDB: mtest - Converted trivial sql/test/miscellaneous tests
Changeset: 8834171c50f1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8834171c50f1 Added Files: sql/test/miscellaneous/Tests/alter_table_add_column.test sql/test/miscellaneous/Tests/column_aliases.test sql/test/miscellaneous/Tests/create_func_temp.test sql/test/miscellaneous/Tests/declared_tables.test sql/test/miscellaneous/Tests/groupby_expressions.test sql/test/miscellaneous/Tests/groupings.test sql/test/miscellaneous/Tests/simple_plans.test sql/test/miscellaneous/Tests/simple_selects.test sql/test/miscellaneous/Tests/update_delete_aliases.test sql/test/miscellaneous/Tests/values.test sql/test/miscellaneous/Tests/vessels.test sql/test/miscellaneous/Tests/view-mul-digits.test sql/test/miscellaneous/Tests/with_update_stmts.test Branch: mtest Log Message: Converted trivial sql/test/miscellaneous tests diffs (truncated from 2661 to 300 lines): diff --git a/sql/test/miscellaneous/Tests/alter_table_add_column.test b/sql/test/miscellaneous/Tests/alter_table_add_column.test new file mode 100644 --- /dev/null +++ b/sql/test/miscellaneous/Tests/alter_table_add_column.test @@ -0,0 +1,462 @@ +statement ok +START TRANSACTION + +statement ok +CREATE SCHEMA "schema1" + +statement ok +CREATE TABLE "schema1"."table1" ("col1" CHAR(32)) + +statement ok +INSERT INTO "schema1"."table1" VALUES (NULL) + +query T rowsort +SELECT * FROM "schema1"."table1" + +NULL + +statement ok +ALTER TABLE "schema1"."table1" ADD "col2" varchar(40) + +statement ok +ALTER TABLE "schema1"."table1" ADD "col3" varchar(40) + +statement ok +ALTER TABLE "schema1"."table1" ADD "col4" varchar(40) + +statement ok +ALTER TABLE "schema1"."table1" ADD "col5" varchar(40) + +statement ok +ALTER TABLE "schema1"."table1" DROP "col2" + +statement ok +ALTER TABLE "schema1"."table1" DROP "col3" + +statement ok +ALTER TABLE "schema1"."table1" ADD "col2" varchar(40) + +statement ok +ALTER TABLE "schema1"."table1" ADD "col3" varchar(40) + +query T rowsort +SELECT * FROM "schema1"."table1" + +NULL +NULL +NULL +NULL +NULL + +query ITTI rowsort +SELECT Columns."number", Columns."name", Columns."type", Columns.type_scale FROM sys.columns as Columns +WHERE Columns.table_id = (SELECT Tables."id" FROM sys.tables as Tables + WHERE Tables.schema_id = (SELECT "schema"."id" FROM sys.schemas as "schema" WHERE "schema"."name" = 'schema1') AND Tables."name" = 'table1') +ORDER BY Columns."number" + +0 +col1 +char +0 +1 +col4 +varchar +0 +2 +col5 +varchar +0 +3 +col2 +varchar +0 +4 +col3 +varchar +0 + +query T rowsort +SELECT * FROM "schema1"."table1" + +NULL +NULL +NULL +NULL +NULL + +statement ok +create table "schema1"."table2" ( + "col1" varchar(32), + "col2" varchar(32), + "col3" varchar(32), + "col4" varchar(32), + "col5" date, + "col6" char(32), + "col7" varchar(32), + "col8" varchar(32), + "col9" timestamp, + "col10" varchar(32), + "col11" varchar(32), + "col12" timestamp, + "col13" bigint, + "col14" timestamp, + "col15" date, + "col16" timestamp) + +statement ok +insert into "schema1"."table2" values ('1','1','1','1',date '1990-10-01','1','1','1',timestamp '2008-03-01 00:00','1','9',timestamp '2011-04-04 04:04',1,timestamp '2014-07-07 07:07',date '1966-12-31',timestamp '2017-10-10 10:10'), + ('1','1','1','1',date '1890-02-20','1','1','1',timestamp '2009-04-02 01:01','4','4',timestamp '2012-05-05 05:05',2,timestamp '2015-08-08 08:08',date '1978-12-21',timestamp '2018-11-11 11:11'), + ('1','1','1','1',date '1790-03-30','1','1','1',timestamp '2010-05-03 02:02','8','7',timestamp '2013-06-06 06:06',3,timestamp '2016-09-09 09:09',date '1987-12-11',timestamp '2019-12-12 00:00') + +query ITTI rowsort +select columns."number", columns."name", columns."type", columns.type_scale from sys."columns" as columns +where columns.table_id = (select tables."id" from sys."tables" as tables + where tables.schema_id = (select "schema"."id" from sys."schemas" as "schema" where "schema"."name" = 'schema1') and tables."name" = 'table2') order by columns."number" + +0 +col1 +varchar +0 +1 +col2 +varchar +0 +10 +col11 +varchar +0 +11 +col12 +timestamp +0 +12 +col13 +bigint +0 +13 +col14 +timestamp +0 +14 +col15 +date +0 +15 +col16 +timestamp +0 +2 +col3 +varchar +0 +3 +col4 +varchar +0 +4 +col5 +date +0 +5 +col6 +char +0 +6 +col7 +varchar +0 +7 +col8 +varchar +0 +8 +col9 +timestamp +0 +9 +col10 +varchar +0 + +statement ok +ALTER TABLE "schema1"."table2" ADD COLUMN "col17" varchar(42) + +statement ok +UPDATE "schema1"."table2" SET "col17" = CONVERT("col5", varchar(42)) + +statement ok +ALTER TABLE "schema1"."table2" DROP COLUMN "col5" CASCADE + +statement ok +ALTER TABLE "schema1"."table2" RENAME COLUMN "col17" TO "col5" + +statement ok +ALTER TABLE "schema1"."table2" ADD "col18" varchar(42) + +query ITTI
MonetDB: mtest - assert with err code and err message sqltest
Changeset: 07a413a09f4b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=07a413a09f4b Modified Files: testing/sqltest.py Branch: mtest Log Message: assert with err code and err message sqltest diffs (32 lines): diff --git a/testing/sqltest.py b/testing/sqltest.py --- a/testing/sqltest.py +++ b/testing/sqltest.py @@ -144,17 +144,25 @@ class SQLTestResult(object): print('', file=err_file) print('', file=err_file) -def assertFailed(self, err_code=None): +def assertFailed(self, err_code=None, err_message=None): """assert on query failed with optional err_code if provided""" if self.query_error is None: msg = "expected to fail but didn't\n{}".format(str(self.query_error)) self.fail(msg) else: -if err_code: -err_code_received, err_msg_received = utils.parse_mapi_err_msg(self.query_error.args[0]) +err_code_received, err_msg_received = utils.parse_mapi_err_msg(self.query_error.args[0]) +if err_code and err_message: +if err_code != err_code_received or err_message.lower() != err_msg_received.lower(): +msg = "expected to fail with error code {} and error message {} but failed with error code {} and error message {}".format(err_code, err_message, err_code_received, err_msg_received) +self.fail(msg) +elif err_code and not err_message: if err_code_received != err_code: msg = "expected to fail with error code {} but failed with error code {}".format(err_code, err_code_received) self.fail(msg) +elif err_message and not err_code: +if err_message.lower() != err_msg_received.lower(): +msg = "expected to fail with error message {} but failed with error message {}".format(err_message, err_msg_received) +self.fail(msg) return self def assertSucceeded(self): ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Improved MAL module detection on histogram filt...
Changeset: 39f77b410cdb for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=39f77b410cdb Modified Files: monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.test sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.test sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.test sql/test/BugTracker-2017/Tests/side-effect.Bug-6397.test sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-query.test sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-0join-view.test sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-1join-query.test sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-1join-view.test sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-2join-query.test sql/test/FeatureRequests/Tests/foreign_key_outer_join_dead_code_elimination-explain-2join-view.test sql/test/mapi/Tests/sql_int128.test sql/test/remote/Tests/partition_elim.test testing/explain.py Branch: mtest Log Message: Improved MAL module detection on histogram filter, but more improvements are needed diffs (truncated from 517 to 300 lines): diff --git a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.test b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.test --- a/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.test +++ b/monetdb5/extras/mal_optimizer_template/Tests/opt_sql_append.test @@ -18,7 +18,7 @@ query T python .explain.function_histogr explain copy into ttt from '/tmp/xyz' user.main -2 +1 querylog.define 1 sql.mvc @@ -68,7 +68,7 @@ query T python .explain.function_histogr explain copy into ttt from '/tmp/xyz' user.main -2 +1 querylog.define 1 sql.mvc diff --git a/sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.test b/sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.test --- a/sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.test +++ b/sql/test/BugTracker-2010/Tests/LIMIT_OFFSET_big-endian.Bug-2622.test @@ -106,7 +106,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo user.main -2 +1 querylog.define 1 sql.mvc @@ -130,7 +130,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo OFFSET 2 user.main -2 +1 querylog.define 1 sql.mvc @@ -156,7 +156,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo LIMIT 2 user.main -2 +1 querylog.define 1 sql.mvc @@ -182,7 +182,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo LIMIT 1 OFFSET 2 user.main -2 +1 querylog.define 1 sql.mvc @@ -208,7 +208,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo LIMIT 2 OFFSET 1 user.main -2 +1 querylog.define 1 sql.mvc @@ -234,7 +234,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo ORDER BY a user.main -2 +1 querylog.define 1 sql.mvc @@ -260,7 +260,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo ORDER BY a OFFSET 2 user.main -2 +1 querylog.define 1 sql.mvc @@ -288,7 +288,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo ORDER BY a LIMIT 2 user.main -2 +1 querylog.define 1 sql.mvc @@ -318,7 +318,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo ORDER BY a LIMIT 2 OFFSET 1 user.main -2 +1 querylog.define 1 sql.mvc @@ -348,7 +348,7 @@ query T python .explain.function_histogr EXPLAIN select * from oblo ORDER BY a LIMIT 1 OFFSET 2 user.main -2 +1 querylog.define 1 sql.mvc diff --git a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.test b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.test --- a/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.test +++ b/sql/test/BugTracker-2012/Tests/rewrite_like_into_likesubselect.Bug-3179.test @@ -8,7 +8,7 @@ query T python .explain.function_histogr explain select name,func from functions where name like '%optimizers%' user.main -2 +1 querylog.define 1 bat.pack @@ -32,7 +32,7 @@ query T python .explain.function_histogr explain select name,func from functions where name not like '%optimizers%' user.main -2 +1 querylog.define 1 bat.pack @@ -56,7 +56,7 @@ query T python .explain.function_histogr explain select name,func from functions where name ilike '%optimizers%' user.main -2 +1 querylog.define 1 bat.pack @@ -80,7 +80,7 @@ query T python .explain.function_histogr explain select name,func from functions where name not ilike '%optimizers%' user.main -2 +1 querylog.define 1 bat.pack @@ -132,7 +132,7 @@ query T python .explain.function_histogr explain select name,func from func
MonetDB: copybinary - Add tests for big- and native endian support
Changeset: fdda5aa075a1 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fdda5aa075a1 Added Files: sql/test/bincopy/Tests/bincopy_big_endians_on_client.SQL.py sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.err sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.out sql/test/bincopy/Tests/bincopy_big_endians_on_server.SQL.py sql/test/bincopy/Tests/bincopy_big_endians_on_server.stable.err sql/test/bincopy/Tests/bincopy_big_endians_on_server.stable.out sql/test/bincopy/Tests/bincopy_native_endians_on_client.SQL.py sql/test/bincopy/Tests/bincopy_native_endians_on_client.stable.err sql/test/bincopy/Tests/bincopy_native_endians_on_client.stable.out sql/test/bincopy/Tests/bincopy_native_endians_on_server.SQL.py sql/test/bincopy/Tests/bincopy_native_endians_on_server.stable.err sql/test/bincopy/Tests/bincopy_native_endians_on_server.stable.out Modified Files: sql/test/bincopy/Tests/All sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.out sql/test/bincopy/Tests/bincopy_little_endians_on_server.stable.out sql/test/bincopy/Tests/bincopy_support.py Branch: copybinary Log Message: Add tests for big- and native endian support diffs (truncated from 680 to 300 lines): diff --git a/sql/test/bincopy/Tests/All b/sql/test/bincopy/Tests/All --- a/sql/test/bincopy/Tests/All +++ b/sql/test/bincopy/Tests/All @@ -43,3 +43,7 @@ bincopy_uuids_on_server bincopy_little_endians_on_client bincopy_little_endians_on_server +bincopy_big_endians_on_client +bincopy_big_endians_on_server +bincopy_native_endians_on_client +bincopy_native_endians_on_server diff --git a/sql/test/bincopy/Tests/bincopy_big_endians_on_client.SQL.py b/sql/test/bincopy/Tests/bincopy_big_endians_on_client.SQL.py new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_big_endians_on_client.SQL.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +from bincopy_support import run_test +from bincopy_support import BIG_ENDIANS as testcode + +run_test('client', testcode) diff --git a/sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.err b/sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.err @@ -0,0 +1,33 @@ +stderr of test 'bincopy_big_endians_on_client` in directory 'sql/test/bincopy` itself: + + +# 10:14:36 > +# 10:14:36 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_listenaddr=all" "--set" "mapi_port=32242" "--set" "mapi_usock=/var/tmp/mtest-23528/.s.monetdb.32242" "--forcemito" "--dbpath=/home/jvr/monets/copybinary/inst/var/MonetDB/mTests_sql_test_bincopy" "--set" "embedded_c=true" +# 10:14:36 > + +# builtin opt gdk_dbpath = /home/jvr/monets/copybinary/inst/var/monetdb5/dbfarm/demo +# builtin opt mapi_port = 5 +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# builtin opt raw_strings = false +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_listenaddr = all +# cmdline opt mapi_port = 32242 +# cmdline opt mapi_usock = /var/tmp/mtest-23528/.s.monetdb.32242 +# cmdline opt gdk_dbpath = /home/jvr/monets/copybinary/inst/var/MonetDB/mTests_sql_test_bincopy +# cmdline opt embedded_c = true + +# 10:14:36 > +# 10:14:36 > "/usr/bin/python3" "bincopy_big_endians_on_client.SQL.py" "bincopy_big_endians_on_client" +# 10:14:36 > + + +# 10:14:36 > +# 10:14:36 > mclient -lsql -ftest -tnone -Eutf-8 -i -e --host=/var/tmp/mtest-23528 --port=32242 --database=mTests_sql_test_bincopy +# 10:14:36 > + + +# 10:14:36 > +# 10:14:36 > "Done." +# 10:14:36 > + diff --git a/sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.out b/sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_big_endians_on_client.stable.out @@ -0,0 +1,64 @@ +stdout of test 'bincopy_big_endians_on_client` in directory 'sql/test/bincopy` itself: + + +# 10:14:36 > +# 10:14:36 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_listenaddr=all" "--set" "mapi_port=32242" "--set" "mapi_usock=/var/tmp/mtest-23528/.s.monetdb.32242" "--forcemito" "--dbpath=/home/jvr/monets/copybinary/inst/var/MonetDB/mTests_sql_test_bincopy" "--set" "embedded_c=true" +# 10:14:36 > + +# MonetDB 5 server v11.40.0 (hg id: ba5e1cd846) +# This is an unreleased version +# Serving database 'mTests_sql_test_bincopy', using 8 threads +# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers +# Found 31.139 GiB available main-memory of which we use 25.378 GiB +# Copyright (c) 1993 - July 2008 CWI. +# Copyright (c) August 2008 - 2020 MonetDB B.V., all rights reserved +# Visit https://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://hank:32242/ +# Listening for UNIX domain connection re
MonetDB: copybinary - Add tests for little endian loading
Changeset: cfed65e2151b for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=cfed65e2151b Added Files: sql/test/bincopy/Tests/bincopy_little_endians_on_client.SQL.py sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.err sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.out sql/test/bincopy/Tests/bincopy_little_endians_on_server.SQL.py sql/test/bincopy/Tests/bincopy_little_endians_on_server.stable.err sql/test/bincopy/Tests/bincopy_little_endians_on_server.stable.out Modified Files: sql/test/bincopy/Tests/All sql/test/bincopy/Tests/bincopy_support.py Branch: copybinary Log Message: Add tests for little endian loading diffs (truncated from 326 to 300 lines): diff --git a/sql/test/bincopy/Tests/All b/sql/test/bincopy/Tests/All --- a/sql/test/bincopy/Tests/All +++ b/sql/test/bincopy/Tests/All @@ -40,3 +40,6 @@ bincopy_json_objects_on_client bincopy_json_objects_on_server bincopy_uuids_on_client bincopy_uuids_on_server + +bincopy_little_endians_on_client +bincopy_little_endians_on_server diff --git a/sql/test/bincopy/Tests/bincopy_little_endians_on_client.SQL.py b/sql/test/bincopy/Tests/bincopy_little_endians_on_client.SQL.py new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_little_endians_on_client.SQL.py @@ -0,0 +1,6 @@ +#!/usr/bin/env python3 + +from bincopy_support import run_test +from bincopy_support import LITTLE_ENDIANS as testcode + +run_test('client', testcode) diff --git a/sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.err b/sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.err @@ -0,0 +1,33 @@ +stderr of test 'bincopy_little_endians_on_client` in directory 'sql/test/bincopy` itself: + + +# 13:58:57 > +# 13:58:57 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_listenaddr=all" "--set" "mapi_port=35125" "--set" "mapi_usock=/var/tmp/mtest-25729/.s.monetdb.35125" "--forcemito" "--dbpath=/home/jvr/monets/copybinary/inst/var/MonetDB/mTests_sql_test_bincopy" "--set" "embedded_c=true" +# 13:58:57 > + +# builtin opt gdk_dbpath = /home/jvr/monets/copybinary/inst/var/monetdb5/dbfarm/demo +# builtin opt mapi_port = 5 +# builtin opt sql_optimizer = default_pipe +# builtin opt sql_debug = 0 +# builtin opt raw_strings = false +# cmdline opt gdk_nr_threads = 0 +# cmdline opt mapi_listenaddr = all +# cmdline opt mapi_port = 35125 +# cmdline opt mapi_usock = /var/tmp/mtest-25729/.s.monetdb.35125 +# cmdline opt gdk_dbpath = /home/jvr/monets/copybinary/inst/var/MonetDB/mTests_sql_test_bincopy +# cmdline opt embedded_c = true + +# 13:58:57 > +# 13:58:57 > "/usr/bin/python3" "bincopy_little_endians_on_client.SQL.py" "bincopy_little_endians_on_client" +# 13:58:57 > + + +# 13:58:57 > +# 13:58:57 > mclient -lsql -ftest -tnone -Eutf-8 -i -e --host=/var/tmp/mtest-25729 --port=35125 --database=mTests_sql_test_bincopy +# 13:58:57 > + + +# 13:58:58 > +# 13:58:58 > "Done." +# 13:58:58 > + diff --git a/sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.out b/sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_little_endians_on_client.stable.out @@ -0,0 +1,66 @@ +stdout of test 'bincopy_little_endians_on_client` in directory 'sql/test/bincopy` itself: + + +# 13:58:57 > +# 13:58:57 > "mserver5" "--debug=10" "--set" "gdk_nr_threads=0" "--set" "mapi_listenaddr=all" "--set" "mapi_port=35125" "--set" "mapi_usock=/var/tmp/mtest-25729/.s.monetdb.35125" "--forcemito" "--dbpath=/home/jvr/monets/copybinary/inst/var/MonetDB/mTests_sql_test_bincopy" "--set" "embedded_c=true" +# 13:58:57 > + +# MonetDB 5 server v11.40.0 (hg id: ba5e1cd846) +# This is an unreleased version +# Serving database 'mTests_sql_test_bincopy', using 8 threads +# Compiled for x86_64-pc-linux-gnu/64bit with 128bit integers +# Found 31.139 GiB available main-memory of which we use 25.378 GiB +# Copyright (c) 1993 - July 2008 CWI. +# Copyright (c) August 2008 - 2020 MonetDB B.V., all rights reserved +# Visit https://www.monetdb.org/ for further information +# Listening for connection requests on mapi:monetdb://hank:35125/ +# Listening for UNIX domain connection requests on mapi:monetdb:///var/tmp/mtest-25729/.s.monetdb.35125 +# MonetDB/GIS module loaded +# MonetDB/SQL module loaded + +# 13:58:57 > +# 13:58:57 > "/usr/bin/python3" "bincopy_little_endians_on_client.SQL.py" "bincopy_little_endians_on_client" +# 13:58:57 > + + +# 13:58:57 > +# 13:58:57 > mclient -lsql -ftest -tnone -Eutf-8 -i -e --host=/var/tmp/mtest-25729 --port=35125 --database=mTests_sql_test_bincopy +# 13:58:57 > + +#START TRANSACTION; +#CREATE TABLE foo(t TINYINT, s SMALLINT, i INT, b BIGINT); +#COPY BINARY INTO foo FROM R'${TSTTRGBASE}/mTests/sql/test/
MonetDB: copybinary - Also byteswap floating point testdata
Changeset: 9cabfad252e9 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=9cabfad252e9 Modified Files: clients/examples/C/bincopydata.c common/utils/copybinary.h Branch: copybinary Log Message: Also byteswap floating point testdata diffs (47 lines): diff --git a/clients/examples/C/bincopydata.c b/clients/examples/C/bincopydata.c --- a/clients/examples/C/bincopydata.c +++ b/clients/examples/C/bincopydata.c @@ -149,7 +149,8 @@ gen_floats(FILE *f, bool byteswap, long for (long i = 0; i < nrecs; i++) { float fl = (float)i; fl += 0.5; - (void)byteswap; + if (byteswap) + COPY_BINARY_CONVERT32(fl); fwrite(&fl, sizeof(fl), 1, f); } } @@ -162,7 +163,8 @@ gen_doubles(FILE *f, bool byteswap, long for (long i = 0; i < nrecs; i++) { double fl = (double)i; fl += 0.5; - (void)byteswap; + if (byteswap) + COPY_BINARY_CONVERT64(fl); fwrite(&fl, sizeof(fl), 1, f); } } diff --git a/common/utils/copybinary.h b/common/utils/copybinary.h --- a/common/utils/copybinary.h +++ b/common/utils/copybinary.h @@ -78,16 +78,16 @@ typedef struct { // This makes it possible to also convert timestamps. #define COPY_BINARY_CONVERT16(lhs) \ - do { (lhs) = COPY_BINARY_BYTESWAP16(lhs); } while (0) + do { *(uint16_t*)&(lhs) = COPY_BINARY_BYTESWAP16(lhs); } while (0) #define COPY_BINARY_CONVERT32(lhs) \ - do { (lhs) = COPY_BINARY_BYTESWAP32(lhs); } while (0) + do { *(uint32_t*)&(lhs) = COPY_BINARY_BYTESWAP32(lhs); } while (0) #define COPY_BINARY_CONVERT64(lhs) \ - do { (lhs) = COPY_BINARY_BYTESWAP64(lhs); } while (0) + do { *(uint64_t*)&(lhs) = COPY_BINARY_BYTESWAP64(lhs); } while (0) #define COPY_BINARY_CONVERT128(lhs) \ - do { (lhs) = COPY_BINARY_BYTESWAP128(lhs); } while (0) + do { *(uhge*)&(lhs) = COPY_BINARY_BYTESWAP128(lhs); } while (0) #define COPY_BINARY_CONVERT_DATE(d) \ do { COPY_BINARY_CONVERT16((d).year); } while (0) ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: copybinary - Test the test data generator
Changeset: 504dd6f010b7 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=504dd6f010b7 Added Files: sql/test/bincopy/Tests/bincopy_test_the_testdata.py sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.err sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.out Modified Files: sql/test/bincopy/Tests/All Branch: copybinary Log Message: Test the test data generator diffs (142 lines): diff --git a/sql/test/bincopy/Tests/All b/sql/test/bincopy/Tests/All --- a/sql/test/bincopy/Tests/All +++ b/sql/test/bincopy/Tests/All @@ -1,3 +1,4 @@ +bincopy_test_the_testdata bincopy_ints_on_client bincopy_ints_on_server diff --git a/sql/test/bincopy/Tests/bincopy_test_the_testdata.py b/sql/test/bincopy/Tests/bincopy_test_the_testdata.py new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_test_the_testdata.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 + +import math +import subprocess +import struct +import sys + +def check_testdata(args, expected): +cmd = [ 'bincopydata', *(str(a) for a in args)] +output = subprocess.check_output(cmd, text=False) + +if expected == output: +return + +def show(bs): +return " ".join(f"{c:02X}{' ' if i % 4 == 3 else ''}" for i, c in enumerate(bs)) + +print(f'WHEN RUNNING: {cmd}') +print(f"EXPECTED: {show(expected)}") +print(f"GOT: {show(output)}") + +sys.exit(1) + +# The first few tests generate 12 shorts so the byte \x0A is included and +# we can see bincopydata does not accidentally perform line ending conversion. + +# native endian by default +check_testdata( +['smallints', 12, '-'], +struct.pack('=12h', *range(12)) +) + +# native endian, explicitly +check_testdata( +['--native-endian', 'smallints', 12, '-'], +struct.pack('=12h', *range(12)) +) + +# big endian +check_testdata( +['--big-endian', 'smallints', 12, '-'], +struct.pack('>12h', *range(12)) +) + +# little endian +check_testdata( +['--little-endian', 'smallints', 12, '-'], +struct.pack('<12h', *range(12)) +) + + + +# Also try some floating point data. +# Should be IEEE 754 format. +# Admittedly very limited tests but better than nothing. + +# native endian by default +check_testdata( +['floats', 12, '-'], +struct.pack('=12f', *(0.5 + f for f in range(12))) +) +check_testdata( +['doubles', 12, '-'], +struct.pack('=12d', *(0.5 + f for f in range(12))) +) + +# native endian, explicitly +check_testdata( +['--native-endian', 'floats', 12, '-'], +struct.pack('=12f', *(0.5 + f for f in range(12))) +) +check_testdata( +['--native-endian', 'doubles', 12, '-'], +struct.pack('=12d', *(0.5 + f for f in range(12))) +) + +# big endian +check_testdata( +['--big-endian', 'floats', 12, '-'], +struct.pack('>12f', *(0.5 + f for f in range(12))) +) +check_testdata( +['--big-endian', 'doubles', 12, '-'], +struct.pack('>12d', *(0.5 + f for f in range(12))) +) + +# little endian +check_testdata( +['--little-endian', 'floats', 12, '-'], +struct.pack('<12f', *(0.5 + f for f in range(12))) +) +check_testdata( +['--little-endian', 'doubles', 12, '-'], +struct.pack('<12d', *(0.5 + f for f in range(12))) +) diff --git a/sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.err b/sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.err new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.err @@ -0,0 +1,12 @@ +stderr of test 'bincopy_test_the_testdata` in directory 'sql/test/bincopy` itself: + + +# 12:12:56 > +# 12:12:56 > "/usr/bin/python3" "bincopy_test_the_testdata.py" "bincopy_test_the_testdata" +# 12:12:56 > + + +# 12:12:56 > +# 12:12:56 > "Done." +# 12:12:56 > + diff --git a/sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.out b/sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.out new file mode 100644 --- /dev/null +++ b/sql/test/bincopy/Tests/bincopy_test_the_testdata.stable.out @@ -0,0 +1,12 @@ +stdout of test 'bincopy_test_the_testdata` in directory 'sql/test/bincopy` itself: + + +# 12:12:56 > +# 12:12:56 > "/usr/bin/python3" "bincopy_test_the_testdata.py" "bincopy_test_the_testdata" +# 12:12:56 > + + +# 12:12:56 > +# 12:12:56 > "Done." +# 12:12:56 > + ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: copybinary - Allow bincopydata to write to stdout
Changeset: e6ef0cb430a2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e6ef0cb430a2 Modified Files: clients/examples/C/bincopydata.c Branch: copybinary Log Message: Allow bincopydata to write to stdout diffs (21 lines): diff --git a/clients/examples/C/bincopydata.c b/clients/examples/C/bincopydata.c --- a/clients/examples/C/bincopydata.c +++ b/clients/examples/C/bincopydata.c @@ -334,7 +334,16 @@ main(int argc, char *argv[]) if (*end != '\0') croak(1, "NRECS must be an integer, not '%s'", args[1]); - dest = fopen(args[2], "wb"); + char *destfilename = args[2]; + if (strcmp(destfilename, "-") == 0) { +#ifdef _MSC_VER + _setmode(1, O_BINARY); +#endif + dest = stdout; + } else { + dest = fopen(destfilename, "wb"); + } + if (dest == NULL) croak(2, "Cannot open '%s' for writing", args[2]); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: copybinary - Actually perfom the byteswapping
Changeset: 5932c727ed46 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=5932c727ed46 Modified Files: clients/examples/C/bincopydata.c clients/examples/C/bincopydata.h clients/examples/C/bincopytemporaldata.c clients/examples/C/bincopyuuid.c common/utils/copybinary.h sql/backends/monet5/sql_bincopyfrom.c Branch: copybinary Log Message: Actually perfom the byteswapping diffs (truncated from 813 to 300 lines): diff --git a/clients/examples/C/bincopydata.c b/clients/examples/C/bincopydata.c --- a/clients/examples/C/bincopydata.c +++ b/clients/examples/C/bincopydata.c @@ -4,7 +4,7 @@ static char *exe_name = "name; g++) { - if (strcmp(g->name, argv[1]) == 0) { + if (strcmp(g->name, args[0]) == 0) { gen = g->gen; break; } } if (gen == NULL) - croak(1, "Unknown TYPE: %s", argv[1]); + croak(1, "Unknown TYPE: %s", args[0]); char *end; - nrecs = strtol(argv[2], &end, 10); + nrecs = strtol(args[1], &end, 10); if (*end != '\0') - croak(1, "NRECS must be an integer, not '%s'", argv[2]); + croak(1, "NRECS must be an integer, not '%s'", args[1]); - dest = fopen(argv[3], "wb"); + dest = fopen(args[2], "wb"); if (dest == NULL) - croak(2, "Cannot open '%s' for writing", argv[3]); + croak(2, "Cannot open '%s' for writing", args[2]); - gen(dest, nrecs); + gen(dest, byteswap, nrecs); fclose(dest); diff --git a/clients/examples/C/bincopydata.h b/clients/examples/C/bincopydata.h --- a/clients/examples/C/bincopydata.h +++ b/clients/examples/C/bincopydata.h @@ -1,22 +1,22 @@ #include "monetdb_config.h" ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: copybinary - Pass the byteswap parameter to sql.importC...
Changeset: 953456cbe1d8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=953456cbe1d8 Modified Files: monetdb5/optimizer/opt_bincopyfrom.c sql/backends/monet5/sql.c sql/backends/monet5/sql_bincopyfrom.c sql/server/rel_updates.c Branch: copybinary Log Message: Pass the byteswap parameter to sql.importColumn diffs (138 lines): diff --git a/monetdb5/optimizer/opt_bincopyfrom.c b/monetdb5/optimizer/opt_bincopyfrom.c --- a/monetdb5/optimizer/opt_bincopyfrom.c +++ b/monetdb5/optimizer/opt_bincopyfrom.c @@ -15,7 +15,7 @@ #include "opt_bincopyfrom.h" static str transform(MalBlkPtr mb, InstrPtr importTable); -static int extract_column(MalBlkPtr mb, InstrPtr old, int idx, str proto_path, int proto_bat_var, int count_var); +static int extract_column(MalBlkPtr mb, InstrPtr old, int idx, str proto_path, int proto_bat_var, int count_var, bool byteswap); str OPTbincopyfromImplementation(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) @@ -96,6 +96,7 @@ transform(MalBlkPtr mb, InstrPtr old) int onclient_arg = *(int*)getVarValue(mb, getArg(old, old->retc + 2)); bool onserver = !onclient_arg; bool onclient = !onserver; + bool byteswap = *(bit*)getVarValue(mb, getArg(old, old->retc + 3)); // In the following loop we pick a "prototype column". // This is always a column with a non-nil path and will be the first column for @@ -114,7 +115,7 @@ transform(MalBlkPtr mb, InstrPtr old) int tail_type = ATOMstorage(getBatType(var_type)); if (tail_type >= prototype_type) continue; - int path_idx = old->retc + 3 + i; + int path_idx = old->retc + 4 + i; int path_var = getArg(old, path_idx); if (VALisnil(&getVarConstant(mb, path_var))) continue; @@ -127,7 +128,7 @@ transform(MalBlkPtr mb, InstrPtr old) return createException(MAL, "optimizer.bincopyfrom", SQLSTATE(42000) "all paths are nil"); // Always emit the prototype column first - int prototype_count_var = extract_column(mb, old, prototype_idx, NULL, -1, -1); + int prototype_count_var = extract_column(mb, old, prototype_idx, NULL, -1, -1, byteswap); assert(mb->stop > 0); int prototype_bat_var = getArg(getInstrPtr(mb, mb->stop - 1), 0); assert(prototype_count_var == getArg(getInstrPtr(mb, mb->stop - 1), 1)); @@ -138,7 +139,7 @@ transform(MalBlkPtr mb, InstrPtr old) for (int i = 0; i < old->retc; i++) { if (i == prototype_idx) continue; - int new_row_count_var = extract_column(mb, old, i, prototype_path, prototype_bat_var, row_count_var); + int new_row_count_var = extract_column(mb, old, i, prototype_path, prototype_bat_var, row_count_var, byteswap); if (onclient) row_count_var = new_row_count_var; // chain the importColumn statements } @@ -149,7 +150,7 @@ transform(MalBlkPtr mb, InstrPtr old) } static int -extract_column(MalBlkPtr mb, InstrPtr old, int idx, str proto_path, int proto_bat_var, int count_var) +extract_column(MalBlkPtr mb, InstrPtr old, int idx, str proto_path, int proto_bat_var, int count_var, bool byteswap) { int var = getArg(old, idx); int var_type = getVarType(mb, var); @@ -163,7 +164,7 @@ extract_column(MalBlkPtr mb, InstrPtr ol int onclient = *(int*)getVarValue(mb, getArg(old, old->retc + 2)); - int path_idx = old->retc + 3 + idx; + int path_idx = old->retc + 4 + idx; int path_var = getArg(old, path_idx); str path = (str)getVarValue(mb, path_var); @@ -182,6 +183,7 @@ extract_column(MalBlkPtr mb, InstrPtr ol int new_count_var = newTmpVariable(mb, TYPE_oid); pushReturn(mb, p, new_count_var); pushStr(mb, p, method); + pushBit(mb, p, byteswap); pushStr(mb, p, path); pushInt(mb, p, onclient); if (count_var < 0) 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 @@ -5498,8 +5498,8 @@ static mel_func sql_init_funcs[] = { pattern("sql", "copy_from", mvc_import_table_wrap, true, "Import a table from bstream s with the \ngiven tuple and seperators (sep/rsep)", args(1,14, batvarargany("",0),arg("t",ptr),arg("sep",str),arg("rsep",str),arg("ssep",str),arg("ns",str),arg("fname",str),arg("nr",lng),arg("offset",lng),arg("locked",int),arg("best",int),arg("fwf",str),arg("onclient",int),arg("escape",int))), //we use bat.single now //pattern("sql", "single", CMDBATsingle, false, "", args(1,2, batargany("",2),argany("x",2))), - pattern("sql", "importTable", mvc_bin_import_table_wrap, true, "Import a table from the files (f
MonetDB: copybinary - Accept COPY [ (LITTLE | BIG | NATIVE) ENDI...
Changeset: 31bc09e41382 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=31bc09e41382 Modified Files: clients/mapiclient/mhelp.c sql/backends/monet5/sql.mal sql/scripts/51_sys_schema_extension.sql sql/server/rel_updates.c sql/server/sql_parser.y sql/server/sql_scan.c sql/server/sql_tokens.h Branch: copybinary Log Message: Accept COPY [ (LITTLE | BIG | NATIVE) ENDIAN] BINARY syntax diffs (201 lines): diff --git a/clients/mapiclient/mhelp.c b/clients/mapiclient/mhelp.c --- a/clients/mapiclient/mhelp.c +++ b/clients/mapiclient/mhelp.c @@ -108,8 +108,8 @@ SQLhelp sqlhelp1[] = { NULL}, {"COPY BINARY", "Append binary representations into a table", -"COPY [nrofrecords] BINARY INTO qname [column_list] FROM string [',' ...] [ON { CLIENT | SERVER }] [NO CONSTRAINT]", -"nrofrecords,qname,column_list", +"COPY [( BIG | LITTLE | NATIVE) ENDIAN] BINARY INTO qname [column_list] FROM string [',' ...] [ON { CLIENT | SERVER }] [NO CONSTRAINT]", +"qname,column_list", "See also https://www.monetdb.org/Documentation/Cookbooks/SQLrecipes/BinaryBulkLoad"}, {"COPY INTO", "Parse a csv file into a table or write a query result to a csv file", diff --git a/sql/backends/monet5/sql.mal b/sql/backends/monet5/sql.mal --- a/sql/backends/monet5/sql.mal +++ b/sql/backends/monet5/sql.mal @@ -366,7 +366,7 @@ comment "Import a table from bstream s w pattern single(x:any_2):bat[:any_2] address CMDBATsingle; -unsafe pattern importTable( sname:str, tname:str, onclient:int, fname:str... )(:bat[:any]...) +unsafe pattern importTable( sname:str, tname:str, onclient:int, bswap:bit, fname:str... )(:bat[:any]...) address mvc_bin_import_table_wrap comment "Import a table from the files (fname)"; diff --git a/sql/scripts/51_sys_schema_extension.sql b/sql/scripts/51_sys_schema_extension.sql --- a/sql/scripts/51_sys_schema_extension.sql +++ b/sql/scripts/51_sys_schema_extension.sql @@ -30,6 +30,7 @@ INSERT INTO sys.keywords (keyword) VALUE ('BEGIN'), ('BEST'), ('BETWEEN'), + ('BIG'), ('BIGINT'), ('BIGSERIAL'), ('BINARY'), @@ -93,6 +94,7 @@ INSERT INTO sys.keywords (keyword) VALUE ('ELSEIF'), ('ENCRYPTED'), ('END'), + ('ENDIAN'), ('EPOCH'), ('ESCAPE'), ('EVERY'), @@ -148,6 +150,7 @@ INSERT INTO sys.keywords (keyword) VALUE ('LEVEL'), ('LIKE'), ('LIMIT'), + ('LITTLE'), ('LOADER'), ('LOCAL'), ('LOCALTIME'), @@ -162,6 +165,7 @@ INSERT INTO sys.keywords (keyword) VALUE ('MINVALUE'), ('MONTH'), ('NAME'), + ('NATIVE'), ('NATURAL'), ('NEW'), ('NEXT'), 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 @@ -1670,7 +1670,7 @@ copyfrom(sql_query *query, dlist *qname, } static sql_rel * -bincopyfrom(sql_query *query, dlist *qname, dlist *columns, dlist *files, int constraint, int onclient) +bincopyfrom(sql_query *query, dlist *qname, dlist *columns, dlist *files, int constraint, int onclient, endianness endian) { mvc *sql = query->sql; char *sname = qname_schema(qname); @@ -1705,6 +1705,8 @@ bincopyfrom(sql_query *query, dlist *qna if (!collist) return NULL; + (void)endian; + f->res = table_column_types(sql->sa, t); sql_find_subtype(&strtpe, "varchar", 0, 0); args = append( append( append( new_exp_list(sql->sa), @@ -1968,7 +1970,7 @@ rel_updates(sql_query *query, symbol *s) { dlist *l = s->data.lval; - ret = bincopyfrom(query, l->h->data.lval, l->h->next->data.lval, l->h->next->next->data.lval, l->h->next->next->next->data.i_val, l->h->next->next->next->next->data.i_val); + ret = bincopyfrom(query, l->h->data.lval, l->h->next->data.lval, l->h->next->next->data.lval, l->h->next->next->next->data.i_val, l->h->next->next->next->next->data.i_val, l->h->next->next->next->next->next->data.i_val); sql->type = Q_UPDATE; } break; diff --git a/sql/server/sql_parser.y b/sql/server/sql_parser.y --- a/sql/server/sql_parser.y +++ b/sql/server/sql_parser.y @@ -542,6 +542,7 @@ int yydebug=1; opt_bounds opt_column opt_encrypted + opt_endianness opt_for_each opt_from_grantor opt_grantor @@ -620,6 +621,7 @@ int yydebug=1; sqlDOUBLE sqlREAL PRECISION PARTIAL SIMPLE ACTION CASCADE RESTRICT BOOL_FALSE BOOL_TRUE CURRENT_DATE CURRENT_TIMESTAMP CURRENT_TIME LOCALTIMESTAMP LOCALTIME + BIG LITTLE NATIVE ENDIAN LEX_ERROR /* the tokens used in geom */ @@ -2769,13 +2771,14 @@ copyfrom_stmt: append_list(l, $4); append_symbol(l, $6); $$ = _symbol_create_list( SQL_COPYLOADER, l ); } - | COPY BINARY INTO qname opt_column_list FROM string_commalist opt_on_location o
MonetDB: mmt - some more partition flag (re)set's
Changeset: 321c1a2646a5 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=321c1a2646a5 Modified Files: sql/storage/store.c Branch: mmt Log Message: some more partition flag (re)set's diffs (27 lines): diff --git a/sql/storage/store.c b/sql/storage/store.c --- a/sql/storage/store.c +++ b/sql/storage/store.c @@ -3519,6 +3519,7 @@ table_dup(sql_trans *tr, int flags, sql_ t->persistence = ot->persistence; t->commit_action = ot->commit_action; t->access = ot->access; + t->partition = ot->partition; t->query = (ot->query) ? sa_strdup(sa, ot->query) : NULL; t->properties = ot->properties; @@ -4459,6 +4460,7 @@ rollforward_update_table(sql_trans *tr, if (mode == R_APPLY && ok == LOG_OK) { ft->cleared = 0; tt->access = ft->access; + tt->partition = ft->partition; if (strcmp(tt->base.name, ft->base.name) != 0) { /* apply possible renaming */ list_hash_delete(tt->s->tables.set, tt, NULL); @@ -4879,6 +4881,7 @@ reset_table(sql_trans *tr, sql_table *ft ft->cleared = 0; ft->access = pft->access; + ft->partition = pft->partition; /* apply possible renaming -> transaction rollbacks or when it starts, inherit from the previous transaction */ if (strcmp(ft->base.name, pft->base.name) != 0) { ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Oct2020 - Merge with Jun2020 branch.
Changeset: 347220845608 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=347220845608 Modified Files: tools/merovingian/daemon/controlrunner.c Branch: Oct2020 Log Message: Merge with Jun2020 branch. ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: Jun2020 - Properly pair lock/unlock of mutex.
Changeset: 3c8118f75ad2 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3c8118f75ad2 Modified Files: tools/merovingian/daemon/controlrunner.c Branch: Jun2020 Log Message: Properly pair lock/unlock of mutex. diffs (40 lines): diff --git a/tools/merovingian/daemon/controlrunner.c b/tools/merovingian/daemon/controlrunner.c --- a/tools/merovingian/daemon/controlrunner.c +++ b/tools/merovingian/daemon/controlrunner.c @@ -351,6 +351,7 @@ static void ctl_handle_client( dpair dp; /* we need to find the right dpair, that is we * sort of assume the control signal is right */ + bool topdb_locked = true; pthread_mutex_lock(&_mero_topdp_lock); dp = _mero_topdp->next; /* don't need the console/log */ while (dp != NULL) { @@ -363,6 +364,7 @@ static void ctl_handle_client( } if (strcmp(p, "stop") == 0) { mtype type = dp->type; + topdb_locked = false; pthread_mutex_unlock(&_mero_topdp_lock); /* Try to shutdown the profiler before the DB. * If we are unable to shutdown the profiler, we @@ -394,9 +396,9 @@ static void ctl_handle_client( } else if (dp->type == MEROFUN && strcmp(dp->dbname, q) == 0) { /* multiplexDestroy needs topdp lock to remove itself */ char *dbname = strdup(dp->dbname); + topdb_locked = false; pthread_mutex_unlock(&_mero_topdp_lock); multiplexDestroy(dbname); - pthread_mutex_lock(&_mero_topdp_lock); free(dbname); len = snprintf(buf2, sizeof(buf2), "OK\n"); send_client("="); @@ -405,7 +407,8 @@ static void ctl_handle_client( dp = dp->next; } - pthread_mutex_unlock(&_mero_topdp_lock); + if (topdb_locked) + pthread_mutex_unlock(&_mero_topdp_lock); if (dp == NULL) { Mfprintf(_mero_ctlerr, "%s: received stop signal for " "non running database: %s\n", origin, q); ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Silenced merge-partitions Python tests
Changeset: 3d7a3d8e2d0c for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=3d7a3d8e2d0c Modified Files: sql/test/merge-partitions/Tests/mergepart23.SQL.py sql/test/merge-partitions/Tests/mergepart23.stable.err sql/test/merge-partitions/Tests/mergepart23.stable.out sql/test/merge-partitions/Tests/mergepart29.SQL.py sql/test/merge-partitions/Tests/mergepart29.stable.err sql/test/merge-partitions/Tests/mergepart29.stable.out Branch: mtest Log Message: Silenced merge-partitions Python tests diffs (truncated from 767 to 300 lines): diff --git a/sql/test/merge-partitions/Tests/mergepart23.SQL.py b/sql/test/merge-partitions/Tests/mergepart23.SQL.py --- a/sql/test/merge-partitions/Tests/mergepart23.SQL.py +++ b/sql/test/merge-partitions/Tests/mergepart23.SQL.py @@ -1,5 +1,7 @@ import os, socket, sys, tempfile +from MonetDBtesting.sqltest import SQLTestCase + try: from MonetDBtesting import process except ImportError: @@ -14,94 +16,9 @@ def freeport(): def server_stop(s): out, err = s.communicate() -sys.stdout.write(out) sys.stderr.write(err) -def client(input): -with process.client('sql', port=myport, dbname='db1', stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE) as c: -out, err = c.communicate(input) -sys.stdout.write(out) -sys.stderr.write(err) - - -script1 = ''' -CREATE MERGE TABLE testme (a int, b varchar(32)) PARTITION BY RANGE ON (a); -CREATE TABLE subtable1 (a int, b varchar(32)); -CREATE TABLE subtable2 (a int, b varchar(32)); -CREATE TABLE subtable3 (a int, b varchar(32)); -CREATE TABLE subtable4 (a int, b varchar(32)); -CREATE TABLE subtable5 (a int, b varchar(32)); -ALTER TABLE testme ADD TABLE subtable1 AS PARTITION FROM 5 TO 10; -ALTER TABLE testme ADD TABLE subtable5 AS PARTITION FOR NULL VALUES; -CREATE MERGE TABLE anothertest (a int, b varchar(32)) PARTITION BY RANGE USING (a + 1); -ALTER TABLE anothertest ADD TABLE subtable3 AS PARTITION FROM 11 TO 20; -SELECT "minimum", "maximum" FROM range_partitions; -''' - -script2 = ''' -SELECT "minimum", "maximum" FROM range_partitions; -DROP TABLE subtable1; --error, subtable1 is a child of testme -DROP TABLE subtable3; --error, subtable3 is a child of anothertest -ALTER TABLE anothertest ADD TABLE subtable1 AS PARTITION FROM 11 TO 20; --error, subtable1 is part of another table -SELECT "minimum", "maximum" FROM range_partitions; -''' - -script3 = ''' -SELECT "minimum", "maximum" FROM range_partitions; -ALTER TABLE testme ADD TABLE subtable2 AS PARTITION FROM 11 TO 20; -ALTER TABLE anothertest ADD TABLE subtable4 AS PARTITION FROM 21 TO 30; -INSERT INTO testme VALUES (5, 'one'), (12, 'two'), (13, 'three'), (15, 'four'), (NULL, 'five'); -INSERT INTO anothertest VALUES (11, 'one'), (12, 'two'), (13, 'three'), (15, 'four'); -SELECT a,b FROM testme; -SELECT a,b FROM anothertest; -SELECT "minimum", "maximum" FROM range_partitions; -ALTER TABLE testme DROP TABLE subtable1; -ALTER TABLE testme DROP TABLE subtable2; -ALTER TABLE testme DROP TABLE subtable5; -ALTER TABLE anothertest DROP TABLE subtable3; -ALTER TABLE anothertest DROP TABLE subtable4; -SELECT "minimum", "maximum" FROM range_partitions; -ALTER TABLE testme DROP COLUMN "a"; --error, a is a partition column -ALTER TABLE anothertest DROP COLUMN "a"; --error, a is used on partition expression -DROP TABLE testme; -DROP TABLE subtable1; -DROP TABLE subtable2; -DROP TABLE anothertest; -DROP TABLE subtable3; -DROP TABLE subtable4; -DROP TABLE subtable5; -''' - -script4 = ''' -CREATE MERGE TABLE upsme (a int, b varchar(32)) PARTITION BY VALUES USING (a + 5); -CREATE TABLE subtable1 (a int, b varchar(32)); -CREATE TABLE subtable2 (a int, b varchar(32)); -CREATE TABLE subtable3 (a int, b varchar(32)); -ALTER TABLE upsme ADD TABLE subtable3 AS PARTITION FOR NULL VALUES; -INSERT INTO upsme VALUES (NULL, 'one'); -ALTER TABLE upsme ADD TABLE subtable1 AS PARTITION IN (15, 25, 35); -ALTER TABLE upsme ADD TABLE subtable2 AS PARTITION IN (45, 55, 65); -SELECT "value" FROM value_partitions; -''' - -script5 = ''' -INSERT INTO upsme VALUES (10, 'two'), (40, 'three'), (NULL, 'four'); -INSERT INTO subtable3 VALUES (NULL, 'five'); -SELECT a,b FROM upsme; -SELECT a,b FROM subtable1; -SELECT a,b FROM subtable2; -SELECT a,b FROM subtable3; -ALTER TABLE upsme DROP TABLE subtable1; -ALTER TABLE upsme DROP TABLE subtable2; -ALTER TABLE upsme DROP TABLE subtable3; -SELECT "value" FROM value_partitions; -DROP TABLE upsme; -DROP TABLE subtable1; -DROP TABLE subtable2; -DROP TABLE subtable3; -''' - with tempfile.TemporaryDirectory() as farm_dir: os.mkdir(os.path.join(farm_dir, 'db1')) myport = freeport() @@ -110,29 +27,96 @@ with tempfile.TemporaryDirectory() as fa dbfarm=os.path.join(farm_dir, 'db1'), stdin=process.PIPE, stdout=process.PIPE, stderr=process.PIPE) as s: -client(script1) +
MonetDB: scoping2 - Merged with default
Changeset: 09a1e60d39cf for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=09a1e60d39cf Modified Files: clients/mapiclient/dump.c sql/server/rel_exp.c sql/server/rel_psm.c sql/server/rel_select.c sql/server/sql_parser.y sql/test/miscellaneous/Tests/simple_selects.stable.err tools/monetdbe/monetdbe.c Branch: scoping2 Log Message: Merged with default diffs (truncated from 129852 to 300 lines): diff --git a/NT/mkodbcwxs.py b/NT/mkodbcwxs.py --- a/NT/mkodbcwxs.py +++ b/NT/mkodbcwxs.py @@ -80,9 +80,9 @@ def main(): r'lib\MonetODBC.dll', # r'lib\MonetODBC.pdb', r'lib\MonetODBCs.dll', # r'lib\MonetODBCs.pdb', r'bin\stream.dll', # r'lib\stream.pdb', - vcpkg.format(r'bin\libiconv.dll'), + vcpkg.format(r'bin\iconv-2.dll'), vcpkg.format(r'bin\bz2.dll'), - vcpkg.format(r'bin\libcharset.dll'), # for libiconv.dll + vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll vcpkg.format(r'bin\libcrypto-1_1{}.dll'.format(libcrypto)), vcpkg.format(r'bin\zlib1.dll')]) print(r'') diff --git a/NT/mksqlwxs.py b/NT/mksqlwxs.py --- a/NT/mksqlwxs.py +++ b/NT/mksqlwxs.py @@ -145,10 +145,10 @@ def main(): r'bin\monetdb5.dll', r'bin\monetdbsql.dll', r'bin\stream.dll', - vcpkg.format(r'bin\libiconv.dll'), + vcpkg.format(r'bin\iconv-2.dll'), vcpkg.format(r'bin\bz2.dll'), + vcpkg.format(r'bin\charset-1.dll'), # for iconv-2.dll vcpkg.format(r'bin\getopt.dll'), - vcpkg.format(r'bin\libcharset.dll'), # for libiconv.dll vcpkg.format(r'bin\libcrypto-1_1{}.dll'.format(libcrypto)), vcpkg.format(r'bin\libxml2.dll'), vcpkg.format(r'bin\lz4.dll'), @@ -199,10 +199,10 @@ def main(): r'lib\monetdb5.lib', r'lib\monetdbsql.lib', r'lib\stream.lib', - vcpkg.format(r'lib\libiconv.lib'), + vcpkg.format(r'lib\iconv.lib'), vcpkg.format(r'lib\bz2.lib'), + vcpkg.format(r'lib\charset.lib'), vcpkg.format(r'lib\getopt.lib'), - vcpkg.format(r'lib\libcharset.lib'), vcpkg.format(r'lib\libcrypto.lib'), vcpkg.format(r'lib\libxml2.lib'), vcpkg.format(r'lib\lz4.lib'), diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c --- a/clients/mapiclient/dump.c +++ b/clients/mapiclient/dump.c @@ -46,76 +46,6 @@ #include "msqldump.h" -static const char * -get_with_comments_as_clause(Mapi mid) -{ - const char *query = /* check whether sys.comments exists */ - "SELECT t.id " - "FROM sys._tables t JOIN sys.schemas s ON t.schema_id = s.id " - "WHERE s.name = 'sys' AND t.name = 'comments'"; - const char *new_clause = - "WITH comments AS (SELECT * FROM sys.comments), " -"function_types AS (SELECT * FROM sys.function_types), " -"function_languages AS (SELECT * FROM sys.function_languages)"; - const char *old_clause = - "WITH comments AS (" - "SELECT 42 AS id, 'no comment' AS remark WHERE FALSE" -"), " -"function_types AS (" - "SELECT function_type_id, function_type_name, function_type_keyword " - "FROM sys.function_types, " -"(VALUES " - "(1, 'FUNCTION'), " - "(2, 'PROCEDURE'), " - "(3, 'AGGREGATE'), " - "(4, 'FILTER FUNCTION'), " - "(5, 'FUNCTION'), " - "(6, 'FUNCTION'), " - "(7, 'LOADER')) AS (id, function_type_keyword) " - "WHERE id = function_type_id" -"), " -"function_languages AS (" - "SELECT language_id, language_name, language_keyword " - "FROM sys.function_languages, (VALUES " - "(3, 'R'), " - "(4, 'C'), " - "(6, 'PYTHON'), " - "(7, 'PYTHON_MAP'), " - "(8, 'PYTHON2'), " - "(9, 'PYTHON2_MAP'), " - "(10, 'PYTHON3'), " - "(11, 'PYTHON3_MAP'), " - "(12, 'CPP')) AS (id, language_keyword) " - "WHERE id = language_id" -")"; - - bool has_sys_comments = false; - MapiHdl hdl = m
MonetDB: mtest - Another test not correctly converted
Changeset: 78303ef3a19f for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=78303ef3a19f Modified Files: sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.test.in Branch: mtest Log Message: Another test not correctly converted diffs (253 lines): diff --git a/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.test.in b/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.test.in --- a/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.test.in +++ b/sql/test/BugTracker-2017/Tests/heapextend.Bug-6134.test.in @@ -28,12 +28,9 @@ CREATE TABLE segment3 (id varchar(150), statement ok CREATE TABLE segment4 (id varchar(150), code varchar(150)) -statement error +statement ok COPY 431 RECORDS INTO category FROM STDIN DELIMITERS '|' , E'\n', '"' - - -statement error 3273|"70"|"430" 3274|"70"|"612" 3275|"70"|"565" @@ -465,17 +462,19 @@ 3269|"70"|"621" 3270|"70"|"513" 3271|"70"|"410" 3272|"70"|"618" + +statement ok COPY 5 RECORDS INTO book FROM STDIN DELIMITERS '|' , E'\n', '"' - -statement error + "G1KORP" "G2FIN" "G3PARV" "G4NEG" "MVE" + +statement ok COPY 22 RECORDS INTO fact FROM STDIN DELIMITERS '|' , E'\n', '"' - -statement error + "10"|"3480"|"7443"|"0"|"MVE"|1001|2002|2016-02-16 "10"|"3480"|"7443"|"0"|"MVE"|1001|2002|2016-03-16 "10"|"3480"|"7443"|"0"|"MVE"|1001|2002|2016-04-16 @@ -498,9 +497,10 @@ statement error "10"|"1300"|"7422"|"0"|"G2FIN"|1|3001|2016-11-16 "10"|"3480"|"7443"|"0"|"MVE"|1001|2002|2016-01-16 "10"|"1300"|"7422"|"0"|"G2FIN"|1|3001|2016-01-16 + +statement ok COPY 729 RECORDS INTO location FROM STDIN DELIMITERS '|' , E'\n', '"' - -statement error + 12026|"(n/z)" 3001|"(n/z)" 10020|"0010093" @@ -1230,13 +1230,15 @@ 1001|"(n/z)" 2001|"(n/z)" 11002|"0760258" 11003|"0421262" + +statement ok COPY 1 RECORDS INTO segment1 FROM STDIN DELIMITERS '|' , E'\n', '"' - -statement error + "10"|"10" + +statement ok COPY 44 RECORDS INTO segment2 FROM STDIN DELIMITERS '|' , E'\n', '"' - -statement error + ""|"" "1000"|"1000" "1100"|"1100" @@ -1281,9 +1283,10 @@ statement error "3613"|"3613" "3630"|"3630" "3640"|"3640" + +statement ok COPY 143 RECORDS INTO segment3 FROM STDIN DELIMITERS '|' , E'\n', '"' - -statement error + "7212"|"7212" "7213"|"7213" "7214"|"7214" @@ -1427,9 +1430,10 @@ statement error "7422"|"7422" "7441"|"7441" "7561"|"7561" + +statement ok COPY 56 RECORDS INTO segment4 FROM STDIN DELIMITERS '|' , E'\n', '"' - -statement error + "0"|"0" "57001"|"57001" "57002"|"57002" @@ -1486,10 +1490,11 @@ statement error "74405"|"74405" "74406"|"74406" "74404"|"74404" + +statement ok COPY 49998 RECORDS INTO all_dates FROM E'$QTSTSRCDIR/all_dates.csv.gz' DELIMITERS '|' , E'\n', '"' -statement error --- this works +query T nosort SELECT loc.code ,cat.subcategory_code ,cat.category_code @@ -1522,8 +1527,99 @@ SELECT loc.code AND ( cat.subcategory_code = 200 OR cat.subcategory_code = 301 OR cat.subcategory_code <= 290 ) AND d.month_code BETWEEN '2016.01' AND '2016.10' ORDER BY d.d_date + +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-01-16 +2016.01 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-02-16 +2016.02 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-03-16 +2016.03 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-04-16 +2016.04 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-05-16 +2016.05 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-06-16 +2016.06 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-07-16 +2016.07 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-08-16 +2016.08 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-09-16 +2016.09 +(n/z) +301 +30 +10 +1300 +7422 +0 +2016-10-16 +2016.10 -statement error +query T nosort SELECT loc.code ,cat.subcategory_code ,cat.category_code @@ -1557,11 +1653,35 @@ SELECT loc.code AND ( s1.code = '03' OR cat.subcategory_code = 25 ) AND d.month_code BETWEEN '2016.01' AND '2016.10' ORDER BY d.d_date + -statement error +query I nosort SELECT 1 FROM location loc,segment1 s1,fact f WHERE s1.id = f.s1_id AND loc.id = f.location_id + +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 +1 -statement error +query I nosort SELECT 1 FROM location loc,segment1 s1,fact f WHERE s1.id = f.s1_id AND loc.id = f.location_id AND ( s1.code = '03' OR loc.code = '0010094' ) statement ok ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list
MonetDB: mtest - Quantiles test not correctly converted
Changeset: fd69873afa65 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fd69873afa65 Modified Files: sql/test/quantiles/Tests/quantiles.test Branch: mtest Log Message: Quantiles test not correctly converted diffs (166 lines): diff --git a/sql/test/quantiles/Tests/quantiles.test b/sql/test/quantiles/Tests/quantiles.test --- a/sql/test/quantiles/Tests/quantiles.test +++ b/sql/test/quantiles/Tests/quantiles.test @@ -6,8 +6,7 @@ CREATE TABLE "sys"."lit" ( statement ok COPY 1 RECORDS INTO "sys"."lit" FROM stdin USING DELIMITERS E'\t',E'\n','"' - -statement error + 21168.23 "N" 45983.16 "N" 13309.60 "N" @@ -10008,104 +10007,124 @@ 48965.00"N" 26654.74 "N" 61475.78 "N" 47779.50 "A" + +query R rowsort select quantile(l_extendedprice,0.5) from lit + +36724.500 query R rowsort select median(l_extendedprice) from lit -NULL +36724.500 query R rowsort select quantile(l_extendedprice,0.0) from lit -NULL +947.020 query R rowsort select quantile(l_extendedprice,1.0) from lit -NULL +103149.000 query RRR rowsort select quantile(l_extendedprice,0.05),quantile(l_extendedprice,0.5),quantile(l_extendedprice,0.95) from lit -NULL -NULL -NULL +4200.320 +36724.500 +79584.120 -query R rowsort +statement error select quantile(l_extendedprice,-1.0) from lit - -NULL -query R rowsort +statement error select quantile(l_extendedprice,-1) from lit - -NULL query R rowsort select quantile(l_extendedprice,1) from lit -NULL +103149.000 query R rowsort select quantile(l_extendedprice,0) from lit -NULL +947.020 -query R rowsort +statement error select quantile(l_extendedprice,42) from lit - -NULL -query R rowsort +statement error select quantile(l_extendedprice,42.0) from lit - -NULL query R rowsort select quantile(l_extendedprice,0.5) from lit group by l_returnflag +35937.880 +36960.680 +37144.200 query R rowsort select median(l_extendedprice) from lit group by l_returnflag +35937.880 +36960.680 +37144.200 query R rowsort select quantile(l_extendedprice,0.0) from lit group by l_returnflag +1012.090 +1027.010 +947.020 query R rowsort select quantile(l_extendedprice,1.0) from lit group by l_returnflag +100248.500 +101896.500 +103149.000 query RRR rowsort select quantile(l_extendedprice,0.05),quantile(l_extendedprice,0.5),quantile(l_extendedprice,0.95) from lit group by l_returnflag +3889.960 +37144.200 +79010.100 +4204.470 +35937.880 +78572.760 +4424.440 +36960.680 +80045.910 -query R rowsort +statement error select quantile(l_extendedprice,-1.0) from lit group by l_returnflag - -query R rowsort +statement error select quantile(l_extendedprice,-1) from lit group by l_returnflag - query R rowsort select quantile(l_extendedprice,1) from lit group by l_returnflag +100248.500 +101896.500 +103149.000 query R rowsort select quantile(l_extendedprice,0) from lit group by l_returnflag +1012.090 +1027.010 +947.020 -query R rowsort +statement error select quantile(l_extendedprice,42) from lit group by l_returnflag - -query R rowsort +statement error select quantile(l_extendedprice,42.0) from lit group by l_returnflag - statement ok drop table lit + ___ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list