Changeset: bf735b295425 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/bf735b295425 Removed Files: sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.sql sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.sql sql/test/sys-schema/Tests/webExamplesLogicalFunctionsOperators.sql sql/test/sys-schema/Tests/webExamplesMathematicalFunctionsOperators.sql Modified Files: sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.test sql/test/sys-schema/Tests/webExamplesMathematicalFunctionsOperators.test Branch: default Log Message:
Merged with Oct2020 diffs (truncated from 830 to 300 lines): diff --git a/clients/odbc/ChangeLog b/clients/odbc/ChangeLog --- a/clients/odbc/ChangeLog +++ b/clients/odbc/ChangeLog @@ -1,13 +1,3 @@ # ChangeLog file for odbc # This file is updated with Maddlog -* Thu Mar 25 2021 Sjoerd Mullender <sjo...@acm.org> -- The ODBC driver now only passes on information about HUGEINT columns - as HUGEINT when the application has indicated interest by querying - about the SQL_HUGEINT extension type using the SQLGetTypeInfo - function or by specifying the type in a call to SQLSetDescField. - Otherwise the driver silently translates the HUGEINT type to BIGINT. - This means that most application will see BIGINT columns when the - server produced a HUGEINT column and only give an error if the value - in the HUGEINT column didn't fit into a BIGINT. - diff --git a/clients/odbc/ChangeLog.Oct2020 b/clients/odbc/ChangeLog.Oct2020 new file mode 100644 --- /dev/null +++ b/clients/odbc/ChangeLog.Oct2020 @@ -0,0 +1,20 @@ +# ChangeLog file for odbc +# This file is updated with Maddlog + +* Wed Mar 31 2021 Sjoerd Mullender <sjo...@acm.org> +- When connecting using a DSN (Data Source Name), information about the + data source is retrieved from the ODBC.INI file. Now we also get the + location of the LOGFILE from this file. The logfile can be used to + log all calls to the MonetDB ODBC driver to a file which can be used + for debugging. + +* Thu Mar 25 2021 Sjoerd Mullender <sjo...@acm.org> +- The ODBC driver now only passes on information about HUGEINT columns + as HUGEINT when the application has indicated interest by querying + about the SQL_HUGEINT extension type using the SQLGetTypeInfo + function or by specifying the type in a call to SQLSetDescField. + Otherwise the driver silently translates the HUGEINT type to BIGINT. + This means that most application will see BIGINT columns when the + server produced a HUGEINT column and only give an error if the value + in the HUGEINT column didn't fit into a BIGINT. + diff --git a/clients/odbc/driver/SQLConnect.c b/clients/odbc/driver/SQLConnect.c --- a/clients/odbc/driver/SQLConnect.c +++ b/clients/odbc/driver/SQLConnect.c @@ -141,6 +141,20 @@ MNDBConnect(ODBCDbc *dbc, } } +#ifdef ODBCDEBUG + if ((ODBCdebug == NULL || *ODBCdebug == 0) && dsn && *dsn) { + char logfile[2048]; + n = SQLGetPrivateProfileString(dsn, "logfile", "", + logfile, sizeof(logfile), + "odbc.ini"); + if (n > 0) { + if (ODBCdebug) + free((void *) ODBCdebug); /* discard const */ + ODBCdebug = strdup(logfile); + } + } +#endif + if (dsn && *dsn) n = SQLGetPrivateProfileString(dsn, "uid", "monetdb", uid, sizeof(uid), "odbc.ini"); diff --git a/sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.sql b/sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.sql deleted file mode 100644 --- a/sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.sql +++ /dev/null @@ -1,49 +0,0 @@ -select cast(123 as varchar(10)); -select convert(123, decimal(10,3)); - -select cast(true as smallint); -select cast(42 as int); -select cast(123.45 as real); -select cast('123.45' as double precision); -select cast(23.45 as decimal(5,2)); -- precision of 5 digits of which 2 decimal digits - -select cast('2020-07-29' as date); -select cast('17:44:59' as time); -select cast('17:44:59.123456' as time); -select cast('2020-07-29 17:44:59' as timestamp); -select cast('2020-07-29T17:44:59' as timestamp); -select cast('2020-07-29 17:44:59.123456' as timestamp); -select cast('17:44:59.321+01:30' as timetz); -select cast('2020-07-29 17:44:59.321+01:30' as timestamptz); -- produces wrong TZ +1:00 instead of +1:30 -select cast('1234' as interval month); -select cast('86400.123' as interval second); - -select cast('abcd' as blob); -select cast('abcde' as clob); -select cast('192.168.1.5/24' as inet); -select cast(r'{"a":[1,2,4]}' as json); -select cast('https://www.monetdb.org/Home' as url); -select cast('e31960fb-dc8b-452d-ab30-b342723e756a' as uuid); - --- or using convert instead of cast: -select convert('a4cd' , blob); -select convert('abcde' , clob); -select convert('192.168.1.5/24' , inet); -select convert(r'{"a":[1,2,4]}' , json); -select convert('https://www.monetdb.org/Home' , url); -select convert('e31960fb-dc8b-452d-ab30-b342723e756a' , uuid); - --- using prefix operators -select x'abcd'; -select blob 'abcd'; -select clob 'abcde'; -- this fails on Oct2020 -select cast('abcde' as clob); -select inet '192.168.1.5/24'; -select json '{"a":[1,2,4]}'; -select url 'https://www.monetdb.org/Home'; -select uuid 'e31960fb-dc8b-452d-ab30-b342723e756a'; -select E'EA\fB\tC\n\\Z'; -select e'eA\fB\tC\n\\Z'; -select R'RA\fB\tC\n\\Z'; -select r'rA\fB\tC\n\\Z'; - diff --git a/sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.test b/sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.test --- a/sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.test +++ b/sql/test/sys-schema/Tests/webExamplesCastFunctionsOperators.test @@ -153,10 +153,8 @@ select blob 'abcd' ---- ABCD -statement ok +statement error select clob 'abcde' ----- -abcde query T rowsort select cast('abcde' as clob) diff --git a/sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.sql b/sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.sql deleted file mode 100644 --- a/sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.sql +++ /dev/null @@ -1,351 +0,0 @@ --- ##### get comparison function and operators ##### --- https://www.monetdb.org/Documentation/SQLReference/FunctionsAndOperators/ComparisonFunctionsOperators -SELECT 5 = 5 as tru; -SELECT NULL = NULL as nul; -SELECT 5 > 5 as fals; -SELECT NULL > NULL as nul; -SELECT 5 IS NULL as fals; -SELECT NULL IS NULL as tru; -SELECT 5 IS NOT NULL as tru; -SELECT NULL IS NOT NULL as fals; - -select 2 < 5 as t1, 2 > 5 as f1; -select 2 <= 5 as t1, 2 >= 5 as f1; -select 2 = 5 as f1, 2 <> 5 as t1; -select 2 != 5 as t1; --- Error: Unexpected symbol (!) - -select "<"('aa', 'ab') as tru; -select ">"('aa', 'ab') as fals; -select "<="('aa', 'ab') as tru; -select ">="('aa', 'ab') as fals; -select "="('aa', 'ab') as fals; -select "<>"('aa', 'ab') as tru; - -select "between"('ab', 'aa', 'ac', false, false, false, false, false) as tru; -select "between"('ab', 'aa', 'ac') as tru; --- Error: SELECT: no such operator 'between' - -select "in"('aa', 'ab') as tru; --- on Oct2020: Error: SELECT: no such binary operator 'in(char,char)' --- Error: Implementation for function calc.in not found - -select ifthenelse(('a' = 'b'), 1, 2) as two; - -select ifnull('aa', 'b') as aa; --- SELECT: no such binary operator 'ifnull(char,char)' --- alternatives -select ifthenelse(('aa' IS NULL), cast('b' as varchar(2)), 'aa') as aa; -select coalesce('aa', 'b') as aa; - - -select ifnull('aa', 'b') as aa; --- SELECT: no such binary operator 'ifnull(char,char)' -select ifnull(null, 'b') as b; --- SELECT: no such binary operator 'ifnull(char,char)' -select ifnull(null, null) as nul; --- SELECT: no such binary operator 'ifnull(any,any)' -select ifnull('aa', null) as nul; --- SELECT: no such binary operator 'ifnull(char,char)' -select ifnull(true, null) as nul; --- SELECT: no such binary operator 'ifnull(boolean,boolean)' - --- See: https://www.monetdb.org/bugzilla/show_bug.cgi?id=6933 -drop table if exists t6933; -create table t6933 (i int, c varchar(8)); -insert into t6933 values (1, 'aa1'), (2, null), (null, 'bb2'), (null, null); - -select i, c, ifnull(i, 2*3) as "ifnull(i,2*3)", ifnull(c, 'has null') as "ifnull(i,'x')", ifnull(i, c) as "ifnull(i,c)" from t6933; --- Error: SELECT: no such binary operator 'ifnull(int,tinyint)' -select c, i, ifnull(c, i) as "ifnull(c,i)" from t6933; --- Error: SELECT: no such binary operator 'ifnull(varchar,int)' -select c, i, ifnull(c, cast(i as char)) as "ifnull(c,i)" from t6933; --- Error: SELECT: no such binary operator 'ifnull(varchar,char)' --- explain select i, c, ifnull(i, c) as "ifnull(i,c)" from t6933; --- Error: SELECT: no such binary operator 'ifnull(int,varchar)' - -select i, c, coalesce(i, 2*3) as "ifnull(i,2*3)", coalesce(c, 'has null') as "ifnull(i,'x')", coalesce(i, c) as "ifnull(i,c)" from t6933; -/* -i c ifnull(i,2*3) ifnull(i,'x') ifnull(i,c) -1 aa1 1 aa1 1 -2 <null> 2 has null 2 -<null> bb2 6 bb2 bb2 -<null> <null> 6 has null <null> -*/ - -select i, c, coalesce(i, 2*3) as "coalesce(i,2*3)", coalesce(c, 'has null') as "coalesce(i,'x')", coalesce(i, c) as "coalesce(i,c)" from t6933; - -select c, i, coalesce(c, i) as "ifnull(c,i)" from t6933; -/* -c i ifnull(c,i) -aa1 1 aa1 -<null> 2 2 -bb2 <null> bb2 -<null> <null> <null> -*/ -select c, i, coalesce(c, cast(i as char)) as "ifnull(c,i)" from t6933; -/* -c i ifnull(c,i) -aa1 1 aa1 -<null> 2 2 -bb2 <null> bb2 -<null> <null> <null> -*/ -select i, c, coalesce(i, c) as "ifnull(i,c)" from t6933; - -select i, c, case when i IS NULL then c else i end as "ifnull(i,c)" from t6933; -/* -i c ifnull(i,c) -1 aa1 1 -2 <null> 2 -<null> bb2 bb2 -<null> <null> <null> -*/ -select i, c, case when i IS NULL then c else i end as "ifnull(i,c)" from t6933; - -select i, c, case when i IS NULL then c else cast(i as char) end as "ifnull(i,c)" from t6933; -/* -i c ifnull(i,c) -1 aa1 1 -2 <null> 2 -<null> bb2 bb2 -<null> <null> <null> -*/ - -select i, c, case when i IS NULL then c else cast(i as char) end as "ifnull(i,c)" from t6933; - -select c, i, case when c IS NULL then i else c end as "ifnull(c,i)" from t6933; -/* -c i ifnull(c,i) -aa1 1 aa1 -<null> 2 2 -bb2 <null> bb2 -<null> <null> <null> -*/ - -select c, i, case when c IS NULL then i else c end as "ifnull(c,i)" from t6933; - -drop table if exists t6933; - - -select isnull('aa') as fals; - -select not_like('abc', '%b%') as fals; -select not_like('abc', '_b%') as fals; -select not_like('abc', '_b_') as fals; -select not_like('abc', '_c_') as tru; - -select not_like('%b%', 'abc') as tru; -select not_like('_b%', 'abc') as tru; -select not_like('_b_', 'abc') as tru; -select not_like('_c_', 'abc') as tru; - -select not_like('abc', '%b%', '%') as fals; --- on Oct2020: Error: Illegal argument: (I)LIKE pattern must not end with escape character --- #client1:!ERROR:MALException:pcre.sql2pcre:operation failed -select not_like('abc', '%b%c', '%') as tru; - -select not_like('abc', '_b%', '%') as fals; --- on Oct2020: Error: Illegal argument: (I)LIKE pattern must not end with escape character --- #client1:!ERROR:MALException:pcre.sql2pcre:operation failed -select not_like('abc', '_b%c', '%') as fals; --- false on Oct2020 --- #client1:!ERROR:MALException:pcre.sql2pcre:operation failed - -select not_like('abc', '_b_', '%') as fals; -select not_like('abc', '_c_', '%') as tru; - -select not_like('abc', '%b%', '_') as fals; -select not_like('abc', '_b%', '_') as tru; -select not_like('abc', '_b_', '_') as tru; _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list