MonetDB: Dec2023 - Add test for bug 7566.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: e6c68e7e212b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e6c68e7e212b
Added Files:
sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
Modified Files:
sql/test/BugTracker-2024/Tests/All
sql/test/BugTracker-2024/Tests/SingleServer
Branch: Dec2023
Log Message:

Add test for bug 7566.


diffs (33 lines):

diff --git a/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py 
b/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
@@ -0,0 +1,15 @@
+import sys,os, pymonetdb
+
+db = os.getenv("TSTDB")
+port = int(os.getenv("MAPIPORT"))
+
+connections = []
+for i in range(130):
+conn = pymonetdb.connect(database=db, port=port, autocommit=True, 
username='monetdb', password='monetdb')
+connections.append(conn)
+
+for conn in connections:
+conn.close()
+
+conn = pymonetdb.connect(database=db, port=port, autocommit=True, 
username='monetdb', password='monetdb')
+conn.close()
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -61,3 +61,4 @@ 7536-mclient-forgets-to-flush
 7541-levenshtein
 7542-column-name-resolution
 7547-drop-login-trigger-crash
+7566-connections-refused
diff --git a/sql/test/BugTracker-2024/Tests/SingleServer 
b/sql/test/BugTracker-2024/Tests/SingleServer
--- a/sql/test/BugTracker-2024/Tests/SingleServer
+++ b/sql/test/BugTracker-2024/Tests/SingleServer
@@ -0,0 +1,1 @@
+--set max_clients=2048
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Produce a more accurate error message (in add...

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 72b1dbfceb0b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/72b1dbfceb0b
Modified Files:
sql/storage/store.c
Branch: Aug2024
Log Message:

Produce a more accurate error message (in addition to the bogus ones).


diffs (15 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -7244,8 +7244,10 @@ sql_session_create(sqlstore *store, allo
 {
sql_session *s;
 
-   if (store->singleuser > 1)
+   if (store->singleuser > 1) {
+   TRC_ERROR(SQL_STORE, "No second connection allowed in 
singleuser mode\n");
return NULL;
+   }
 
s = ZNEW(sql_session);
if (!s)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Merge with Dec2023 branch.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: ec4b34b89138 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ec4b34b89138
Modified Files:
sql/test/BugTracker-2024/Tests/All
sql/test/BugTracker-2024/Tests/SingleServer
Branch: Aug2024
Log Message:

Merge with Dec2023 branch.


diffs (35 lines):

diff --git a/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py 
b/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
@@ -0,0 +1,15 @@
+import sys,os, pymonetdb
+
+db = os.getenv("TSTDB")
+port = int(os.getenv("MAPIPORT"))
+
+connections = []
+for i in range(130):
+conn = pymonetdb.connect(database=db, port=port, autocommit=True, 
username='monetdb', password='monetdb')
+connections.append(conn)
+
+for conn in connections:
+conn.close()
+
+conn = pymonetdb.connect(database=db, port=port, autocommit=True, 
username='monetdb', password='monetdb')
+conn.close()
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -82,3 +82,4 @@ 7554-incorrect-result-between
 7555-incorrect-semijoin-rewrite
 7556-missing-ignore-case
 7465-fwf-block-boundary-error
+7566-connections-refused
diff --git a/sql/test/BugTracker-2024/Tests/SingleServer 
b/sql/test/BugTracker-2024/Tests/SingleServer
--- a/sql/test/BugTracker-2024/Tests/SingleServer
+++ b/sql/test/BugTracker-2024/Tests/SingleServer
@@ -1,2 +1,3 @@
 --set embedded_c=true
 --set capi_cc='cc -std=c99'
+--set max_clients=2048
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Be explicit about the singleuser values.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 077a8a12a18b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/077a8a12a18b
Modified Files:
sql/storage/store.c
Branch: Aug2024
Log Message:

Be explicit about the singleuser values.


diffs (21 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -7266,7 +7266,7 @@ sql_session_create(sqlstore *store, allo
return NULL;
}
if (store->singleuser)
-   store->singleuser++;
+   store->singleuser = 2;
return s;
 }
 
@@ -7276,7 +7276,7 @@ sql_session_destroy(sql_session *s)
if (s->tr) {
sqlstore *store = s->tr->store;
if (store->singleuser)
-   store->singleuser--;
+   store->singleuser = 1;
}
// TODO check if s->tr is not always there
assert(!s->tr || s->tr->active == 0);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Aug2024 branch.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 042e00173dcc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/042e00173dcc
Modified Files:
sql/storage/store.c
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (68 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -7244,8 +7244,10 @@ sql_session_create(sqlstore *store, allo
 {
sql_session *s;
 
-   if (store->singleuser > 1)
+   if (store->singleuser > 1) {
+   TRC_ERROR(SQL_STORE, "No second connection allowed in 
singleuser mode\n");
return NULL;
+   }
 
s = ZNEW(sql_session);
if (!s)
@@ -7264,7 +7266,7 @@ sql_session_create(sqlstore *store, allo
return NULL;
}
if (store->singleuser)
-   store->singleuser++;
+   store->singleuser = 2;
return s;
 }
 
@@ -7274,7 +7276,7 @@ sql_session_destroy(sql_session *s)
if (s->tr) {
sqlstore *store = s->tr->store;
if (store->singleuser)
-   store->singleuser--;
+   store->singleuser = 1;
}
// TODO check if s->tr is not always there
assert(!s->tr || s->tr->active == 0);
diff --git a/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py 
b/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7566-connections-refused.SQL.py
@@ -0,0 +1,15 @@
+import sys,os, pymonetdb
+
+db = os.getenv("TSTDB")
+port = int(os.getenv("MAPIPORT"))
+
+connections = []
+for i in range(130):
+conn = pymonetdb.connect(database=db, port=port, autocommit=True, 
username='monetdb', password='monetdb')
+connections.append(conn)
+
+for conn in connections:
+conn.close()
+
+conn = pymonetdb.connect(database=db, port=port, autocommit=True, 
username='monetdb', password='monetdb')
+conn.close()
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -82,3 +82,4 @@ 7554-incorrect-result-between
 7555-incorrect-semijoin-rewrite
 7556-missing-ignore-case
 7465-fwf-block-boundary-error
+7566-connections-refused
diff --git a/sql/test/BugTracker-2024/Tests/SingleServer 
b/sql/test/BugTracker-2024/Tests/SingleServer
--- a/sql/test/BugTracker-2024/Tests/SingleServer
+++ b/sql/test/BugTracker-2024/Tests/SingleServer
@@ -1,2 +1,3 @@
 --set embedded_c=true
 --set capi_cc='cc -std=c99'
+--set max_clients=2048
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Correct the ProductName

2024-08-15 Thread Martin van Dinther via checkin-list
Changeset: fa5982f75689 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fa5982f75689
Modified Files:
clients/odbc/driver/driver.rc
Branch: Aug2024
Log Message:

Correct the ProductName


diffs (12 lines):

diff --git a/clients/odbc/driver/driver.rc b/clients/odbc/driver/driver.rc
--- a/clients/odbc/driver/driver.rc
+++ b/clients/odbc/driver/driver.rc
@@ -27,7 +27,7 @@ BEGIN
   VALUE "LegalTrademarks", "\0"
   VALUE "OriginalFilename", "MonetODBC.dll\0"
   VALUE "PrivateBuild", "\0"
-  VALUE "ProductName", "MonetDB SQL Server\0"
+  VALUE "ProductName", "MonetDB ODBC Driver\0"
   VALUE "ProductVersion", sversion(11,51,2)
   VALUE "SpecialBuild", "\0"
 END
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Do range check properly, i.e. not with assert.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 897f9ce1e21f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/897f9ce1e21f
Modified Files:
sql/backends/monet5/sql_time.c
Branch: Dec2023
Log Message:

Do range check properly, i.e. not with assert.
Fixes #7562.


diffs (13 lines):

diff --git a/sql/backends/monet5/sql_time.c b/sql/backends/monet5/sql_time.c
--- a/sql/backends/monet5/sql_time.c
+++ b/sql/backends/monet5/sql_time.c
@@ -951,7 +951,8 @@ month_interval_str_imp(int *ret, const c
lng upcast;
if (interval_from_str(next, d, sk, &upcast) < 0)
return createException(SQL, "batcalc.month_interval_str", 
SQLSTATE(42000) "Wrong format (%s)", next);
-   assert((lng) GDK_int_min <= upcast && upcast <= (lng) GDK_int_max);
+   if (upcast < (lng) GDK_int_min || upcast > (lng) GDK_int_max)
+   throw(SQL, "batcalc.month_interval_str", SQLSTATE(22003) "value 
out of range");
*ret = (int) upcast;
return MAL_SUCCEED;
 }
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Test for bug 7562.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: cffe80243a95 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/cffe80243a95
Added Files:
sql/test/BugTracker-2024/Tests/7562-interval-overflow.test
Modified Files:
sql/test/BugTracker-2024/Tests/All
Branch: Dec2023
Log Message:

Test for bug 7562.


diffs (22 lines):

diff --git a/sql/test/BugTracker-2024/Tests/7562-interval-overflow.test 
b/sql/test/BugTracker-2024/Tests/7562-interval-overflow.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7562-interval-overflow.test
@@ -0,0 +1,9 @@
+statement ok
+CREATE  TABLE  t0(c0 INTERVAL YEAR TO MONTH)
+
+statement ok
+INSERT INTO t0( c0) VALUES ('2-5')
+
+statement error
+SELECT * FROM t0 WHERE (NOT ((t0.c0)>=('--18945599805')))
+
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -62,3 +62,4 @@ 7541-levenshtein
 7542-column-name-resolution
 7547-drop-login-trigger-crash
 7566-connections-refused
+7562-interval-overflow
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Use f-strings instead of .format method; comp...

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 531646b2df15 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/531646b2df15
Modified Files:
testing/sqllogictest.py
Branch: Dec2023
Log Message:

Use f-strings instead of .format method; complain on unrecognized commands.


diffs (153 lines):

diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -122,6 +122,9 @@ def prepare_copyfrom_stmt(stmt:[str]=[])
 tail='\n'.join(tail)
 return head + '\n' + tail, head, stmt
 
+def dq(s):
+return s.replace('"', '""')
+
 class SQLLogic:
 def __init__(self, report=None, out=sys.stdout):
 self.dbh = None
@@ -224,40 +227,40 @@ class SQLLogic:
 self.crs.execute('select s.name, t.name, case when t.type in (select 
table_type_id from sys.table_types where table_type_name like \'%VIEW%\') then 
\'VIEW\' else \'TABLE\' end from sys.tables t, sys.schemas s where not t.system 
and t.schema_id = s.id')
 for row in self.crs.fetchall():
 try:
-self.crs.execute('drop {} "{}"."{}" cascade'.format(row[2], 
row[0].replace('"', '""'), row[1].replace('"', '""')))
+self.crs.execute(f'drop {row[2]} "{dq(row[0])}"."{dq(row[1])}" 
cascade')
 except pymonetdb.Error:
 # perhaps already dropped because of the cascade
 pass
 self.crs.execute('select s.name, f.name, ft.function_type_keyword from 
functions f, schemas s, function_types ft where not f.system and f.schema_id = 
s.id and f.type = ft.function_type_id')
 for row in self.crs.fetchall():
 try:
-self.crs.execute('drop all {} "{}"."{}"'.format(row[2], 
row[0].replace('"', '""'), row[1].replace('"', '""')))
+self.crs.execute(f'drop all {row[2]} 
"{dq(row[0])}"."{dq(row[1])}"')
 except pymonetdb.Error:
 # perhaps already dropped
 pass
 self.crs.execute('select s.name, q.name from sys.sequences q, schemas 
s where q.schema_id = s.id')
 for row in self.crs.fetchall():
 try:
-self.crs.execute('drop sequence 
"{}"."{}"'.format(row[0].replace('"', '""'), row[1].replace('"', '""')))
+self.crs.execute(f'drop sequence 
"{dq(row[0])}"."{dq(row[1])}"')
 except pymonetdb.Error:
 # perhaps already dropped
 pass
 self.crs.execute("select name from sys.users where name not in 
('monetdb', '.snapshot')")
 for row in self.crs.fetchall():
 try:
-self.crs.execute('alter user "{}" SET SCHEMA 
"sys"'.format(row[0].replace('"', '""')))
+self.crs.execute(f'alter user "{dq(row[0])}" SET SCHEMA "sys"')
 except pymonetdb.Error:
 pass
 self.crs.execute('select name from sys.schemas where not system')
 for row in self.crs.fetchall():
 try:
-self.crs.execute('drop schema "{}" 
cascade'.format(row[0].replace('"', '""')))
+self.crs.execute(f'drop schema "{dq(row[0])}" cascade')
 except pymonetdb.Error:
 pass
 self.crs.execute("select name from sys.users where name not in 
('monetdb', '.snapshot')")
 for row in self.crs.fetchall():
 try:
-self.crs.execute('drop user "{}"'.format(row[0].replace('"', 
'""')))
+self.crs.execute(f'drop user "{dq(row[0])}"')
 except pymonetdb.Error:
 pass
 
@@ -303,8 +306,8 @@ class SQLLogic:
 if expected_err_msg.lower() == 
err_msg_received.lower():
 return result
 msg = "statement was expected to fail with" \
-+ (" error code {}".format(expected_err_code) if 
expected_err_code else '')\
-+ (", error message 
{}".format(str(expected_err_msg)) if expected_err_msg else '')
++ (f" error code {expected_err_code}" if 
expected_err_code else '')\
++ (f", error message {str(expected_err_msg)}" if 
expected_err_msg else '')
 self.query_error(err_stmt or statement, str(msg), str(e))
 return result
 except ConnectionError as e:
@@ -321,9 +324,9 @@ class SQLLogic:
 if expectok:
 if expected_rowcount is not None:
 result.append('rowcount')
-result.append('{}'.format(affected_rowcount))
+result.append(f'{affected_rowcount}')
 if expected_rowcount != affected_rowcount:
-self.query_error(err_stmt or statement, "statement was 
expecting to succeed with {} rows but received {} 
rows!".format(expected_rowcount, affected_rowcount))
+self.query_error(err_stmt or statement, f"statement 
was expe

MonetDB: Dec2023 - Fix typos.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 81bdbab98788 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/81bdbab98788
Modified Files:
sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
Branch: Dec2023
Log Message:

Fix typos.


diffs (41 lines):

diff --git a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test 
b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
--- a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
+++ b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
@@ -1,25 +1,32 @@
-query T nosort
+query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS
 
 1
 1
 
-query T nosort
+query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT x FROM x AS )
 
 1
 1
 
-statment error syntax error, unexpected ')' in: "with x as ( select 1 x union 
select - '199419' ) select 1 from x as where x in ("
+query IRI rowsort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT min ( x ) OVER ( PARTITION BY x ) AS )
 
+1
+-199419.000
+1
+1
+1.000
+1
 
-query T nosort
+query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS )
 
 1
 1
 
-statment error GDK reported error: BATsubcross: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT ( WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS 
WHERE x IN ( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS 
) )
 
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Merge with Dec2023 branch.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: e519799dabb9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e519799dabb9
Modified Files:
sql/backends/monet5/sql_time.c
sql/test/BugTracker-2024/Tests/All
testing/sqllogictest.py
Branch: Aug2024
Log Message:

Merge with Dec2023 branch.


diffs (218 lines):

diff --git a/sql/backends/monet5/sql_time.c b/sql/backends/monet5/sql_time.c
--- a/sql/backends/monet5/sql_time.c
+++ b/sql/backends/monet5/sql_time.c
@@ -951,7 +951,8 @@ month_interval_str_imp(int *ret, const c
lng upcast;
if (interval_from_str(next, d, sk, &upcast) < 0)
return createException(SQL, "batcalc.month_interval_str", 
SQLSTATE(42000) "Wrong format (%s)", next);
-   assert((lng) GDK_int_min <= upcast && upcast <= (lng) GDK_int_max);
+   if (upcast < (lng) GDK_int_min || upcast > (lng) GDK_int_max)
+   throw(SQL, "batcalc.month_interval_str", SQLSTATE(22003) "value 
out of range");
*ret = (int) upcast;
return MAL_SUCCEED;
 }
diff --git a/sql/test/BugTracker-2024/Tests/7562-interval-overflow.test 
b/sql/test/BugTracker-2024/Tests/7562-interval-overflow.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7562-interval-overflow.test
@@ -0,0 +1,9 @@
+statement ok
+CREATE  TABLE  t0(c0 INTERVAL YEAR TO MONTH)
+
+statement ok
+INSERT INTO t0( c0) VALUES ('2-5')
+
+statement error
+SELECT * FROM t0 WHERE (NOT ((t0.c0)>=('--18945599805')))
+
diff --git a/sql/test/BugTracker-2024/Tests/All 
b/sql/test/BugTracker-2024/Tests/All
--- a/sql/test/BugTracker-2024/Tests/All
+++ b/sql/test/BugTracker-2024/Tests/All
@@ -83,3 +83,4 @@ 7555-incorrect-semijoin-rewrite
 7556-missing-ignore-case
 7465-fwf-block-boundary-error
 7566-connections-refused
+7562-interval-overflow
diff --git a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test 
b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
--- a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
+++ b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
@@ -1,25 +1,32 @@
-query T nosort
+query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS
 
 1
 1
 
-query T nosort
+query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT x FROM x AS )
 
 1
 1
 
-statment error syntax error, unexpected ')' in: "with x as ( select 1 x union 
select - '199419' ) select 1 from x as where x in ("
+query IRI rowsort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT min ( x ) OVER ( PARTITION BY x ) AS )
 
+1
+-199419.000
+1
+1
+1.000
+1
 
-query T nosort
+query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS )
 
 1
 1
 
-statment error GDK reported error: BATsubcross: more than one match
+statement error GDK reported error: BATsubcross: more than one match
 SELECT ( WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS 
WHERE x IN ( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS 
) )
 
+
diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -122,6 +122,9 @@ def prepare_copyfrom_stmt(stmt:[str]=[])
 tail='\n'.join(tail)
 return head + '\n' + tail, head, stmt
 
+def dq(s):
+return s.replace('"', '""')
+
 class SQLLogic:
 def __init__(self, report=None, out=sys.stdout):
 self.dbh = None
@@ -224,40 +227,40 @@ class SQLLogic:
 self.crs.execute('select s.name, t.name, case when t.type in (select 
table_type_id from sys.table_types where table_type_name like \'%VIEW%\') then 
\'VIEW\' else \'TABLE\' end from sys.tables t, sys.schemas s where not t.system 
and t.schema_id = s.id')
 for row in self.crs.fetchall():
 try:
-self.crs.execute('drop {} "{}"."{}" cascade'.format(row[2], 
row[0].replace('"', '""'), row[1].replace('"', '""')))
+self.crs.execute(f'drop {row[2]} "{dq(row[0])}"."{dq(row[1])}" 
cascade')
 except pymonetdb.Error:
 # perhaps already dropped because of the cascade
 pass
 self.crs.execute('select s.name, f.name, ft.function_type_keyword from 
functions f, schemas s, function_types ft where not f.system and f.schema_id = 
s.id and f.type = ft.function_type_id')
 for row in self.crs.fetchall():
 try:
-self.crs.execute('drop all {} "{}"."{}"'.format(row[2], 
row[0].replace('"', '""'), row[1].replace('"', '""')))
+self.crs.execute(f'drop all {row[2]} 
"{dq(row[0])}"."{dq(row[1])}"')
 except pymonetdb.Error:
 # perhaps already dropped
 pass
 self.crs.execute('select s.name, q.name from sys.sequences q, schemas 
s where q.schema_id = s.id')
 for row in self.crs.fetchall():
 try:
-

MonetDB: Dec2023 - Seems like query is supposed to fail, but it ...

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 2ab46b5a9c75 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2ab46b5a9c75
Modified Files:
sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
Branch: Dec2023
Log Message:

Seems like query is supposed to fail, but it doesn't.
In Aug2024, the query fails with the reported syntax error.


diffs (21 lines):

diff --git a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test 
b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
--- a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
+++ b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
@@ -10,15 +10,9 @@ WITH x AS ( SELECT 1 x UNION SELECT - '1
 1
 1
 
-query IRI rowsort
+skipif knownfail
+statement error syntax error, unexpected ')' in: "with x as ( select 1 x union 
select - '199419' ) select 1 from x as where x in ("
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT min ( x ) OVER ( PARTITION BY x ) AS )
-
-1
--199419.000
-1
-1
-1.000
-1
 
 query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS )
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Merge with Dec2023 branch.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 769cc21b3d32 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/769cc21b3d32
Modified Files:
sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
Branch: Aug2024
Log Message:

Merge with Dec2023 branch.


diffs (20 lines):

diff --git a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test 
b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
--- a/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
+++ b/sql/test/BugTracker-2024/Tests/exp_ref-Bug-7479.test
@@ -10,15 +10,8 @@ WITH x AS ( SELECT 1 x UNION SELECT - '1
 1
 1
 
-query IRI rowsort
+statement error syntax error, unexpected ')' in: "with x as ( select 1 x union 
select - '199419' ) select 1 from x as where x in ("
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT min ( x ) OVER ( PARTITION BY x ) AS )
-
-1
--199419.000
-1
-1
-1.000
-1
 
 query I nosort
 WITH x AS ( SELECT 1 x UNION SELECT - '199419' ) SELECT 1 FROM x AS WHERE x IN 
( SELECT x FROM x , ( SELECT min ( x ) OVER ( PARTITION BY x ) ) AS )
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Typo.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: d2f3d119b740 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d2f3d119b740
Modified Files:
sql/test/miscellaneous/Tests/groupby_expressions.test
Branch: Aug2024
Log Message:

Typo.


diffs (12 lines):

diff --git a/sql/test/miscellaneous/Tests/groupby_expressions.test 
b/sql/test/miscellaneous/Tests/groupby_expressions.test
--- a/sql/test/miscellaneous/Tests/groupby_expressions.test
+++ b/sql/test/miscellaneous/Tests/groupby_expressions.test
@@ -334,7 +334,7 @@ rollback
 statement error 42000!SELECT: GROUP BY position 2 is not in select list
 select 1 group by 2
 
-42000!SELECT: non-integer constant in GROUP BY
+statement error 42000!SELECT: non-integer constant in GROUP BY
 select -90 from "groupings" group by -90
 
 statement error
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Cleanup tests.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 5bde60a2042e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5bde60a2042e
Modified Files:

sql/backends/monet5/generator/Tests/execute-privilege-for-public-hge.test
sql/backends/monet5/generator/Tests/execute-privilege-for-public.test
sql/test/2023/Tests/unique_nulls_distinct.test
sql/test/2024/Tests/check.test
sql/test/2024/Tests/distinct_from.test
sql/test/BugConstraints/Tests/check_constraints.test
sql/test/BugDay_2005-10-06_2.9.3/Tests/simple_union.SF-1005596.test
sql/test/BugTracker-2010/Tests/alter-table-restart-crash.SF-2975018.test

sql/test/BugTracker-2017/Tests/crash_after_oidx_on_sys_statistics.Bug-6251.test
sql/test/BugTracker-2018/Tests/truncate_sys_tables.Bug-6543.test
sql/test/BugTracker-2019/Tests/cte-union.Bug-6755.test
sql/test/BugTracker-2023/Tests/aggregate-vararg.Bug-7422.test
sql/test/BugTracker-2023/Tests/interval-day-and-second.Bug-7353.test
sql/test/BugTracker-2024/Tests/7045-do-not-push-down-converts.test
sql/test/BugTracker-2024/Tests/7465-fwf-block-boundary-error.test.in
sql/test/BugTracker-2024/Tests/7511-password-hash-missing-error.test

sql/test/BugTracker-2024/Tests/7512-concurrent-globaltmp-instantiate-crash.test
sql/test/BugTracker-2024/Tests/7513-uri-authority-parse-issue.test
sql/test/BugTracker-2024/Tests/7514-wrong-window-function.test
sql/test/BugTracker-2024/Tests/7524-right-outer-join.test
sql/test/BugTracker-2024/Tests/7525-cudf-aggr-var-input.test
sql/test/BugTracker-2024/Tests/7534-is-distinct-from.test
sql/test/BugTracker-2024/Tests/7535-create-view-groupby-func.test
sql/test/BugTracker-2024/Tests/7537-prepare_stmt_with_dropped_table.test
sql/test/BugTracker-2024/Tests/7538-reduce-cast.test
sql/test/BugTracker-2024/Tests/7539-is-distinct-from.test
sql/test/BugTracker-2024/Tests/7542-column-name-resolution.test
sql/test/BugTracker-2024/Tests/7544-startswith-bug.test
sql/test/BugTracker-2024/Tests/7545-groupby_on_index_col.test
sql/test/BugTracker-2024/Tests/7547-drop-login-trigger-crash.test
sql/test/BugTracker-2024/Tests/7550-select-statistics-auth.test
sql/test/BugTracker-2024/Tests/7552-nested-expression-with-null.test
sql/test/BugTracker-2024/Tests/7553-join-on-startswith-crash.test
sql/test/BugTracker-2024/Tests/7554-incorrect-result-between.test
sql/test/BugTracker-2024/Tests/7555-incorrect-semijoin-rewrite.test
sql/test/BugTracker-2024/Tests/7556-missing-ignore-case.test
sql/test/BugTracker-2024/Tests/SQLunionfunc-Bug-7473.test

sql/test/BugTracker-2024/Tests/analyze-in-proc-func-trig-body-Bug-7500.test
sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test
sql/test/BugTracker-2024/Tests/between-true-and-null-Bug-7465.test
sql/test/BugTracker-2024/Tests/bin_find_smallest_column-Bug-7482.test
sql/test/BugTracker-2024/Tests/contains-or-7469.test
sql/test/BugTracker-2024/Tests/conversion-string-to-bte-failed-7470.test
sql/test/BugTracker-2024/Tests/exp_equal-Bug-7475.test
sql/test/BugTracker-2024/Tests/exp_equal-Bug-7478.test
sql/test/BugTracker-2024/Tests/field-arg-error-Bug-7506.test
sql/test/BugTracker-2024/Tests/get_rel_count-Bug-7480.test
sql/test/BugTracker-2024/Tests/groupby-select1-Bug-7472.test
sql/test/BugTracker-2024/Tests/inner-join-contains-7466.test
sql/test/BugTracker-2024/Tests/multicolumn_IN_value_list-Bug-7497.test
sql/test/BugTracker-2024/Tests/mvc_row_result_wrap-Bug-7481.test
sql/test/BugTracker-2024/Tests/orderby-max-over-rows-Bug-7488.test
sql/test/BugTracker-2024/Tests/rel2bin_join-Bug-7476.test
sql/test/BugTracker-2024/Tests/rel2bin_select-Bug-7496.test
sql/test/BugTracker-2024/Tests/rel_groupby_cse-Bug-7484.test
sql/test/BugTracker-2024/Tests/sql_init_subtype-Bug-7487.test
sql/test/SQLancer/Tests/sqlancer03.test
sql/test/SQLancer/Tests/sqlancer04.test
sql/test/Tests/regexp.test
sql/test/Tests/union-corresponding.test
sql/test/Users/Tests/copyinto.test.in
sql/test/Users/Tests/create_user_options.test
sql/test/bugs/Tests/default-error.test
sql/test/copy/Tests/decimal_separators.test
sql/test/copy/Tests/select-from-file.test.in
sql/test/file_loader/Tests/file_loader_field_separator.test.in
sql/test/mapi/Tests/clientinfo-nonadmin.test
sql/test/miscellaneous/Tests/group_by_all.test
sql/test/miscellaneous/Tests/simple_selects.test
sql/test/rel-optimizers/Tests/merge-unions.test
sql/test/remote/Tests/create-remote-flavors.test
sql/test/rename/Tests/rename01.test
sql/test/sets/Tests/union.test
sql/test/strimps/Tests/strimps_stable_counts_conta

MonetDB: default - Merge with Aug2024 branch.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 82c3aa76f31f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/82c3aa76f31f
Modified Files:
clients/odbc/driver/driver.rc
sql/test/rel-optimizers/Tests/merge-unions.test
Branch: default
Log Message:

Merge with Aug2024 branch.


diffs (truncated from 2778 to 300 lines):

diff --git a/clients/odbc/driver/driver.rc b/clients/odbc/driver/driver.rc
--- a/clients/odbc/driver/driver.rc
+++ b/clients/odbc/driver/driver.rc
@@ -27,7 +27,7 @@ BEGIN
   VALUE "LegalTrademarks", "\0"
   VALUE "OriginalFilename", "MonetODBC.dll\0"
   VALUE "PrivateBuild", "\0"
-  VALUE "ProductName", "MonetDB SQL Server\0"
+  VALUE "ProductName", "MonetDB ODBC Driver\0"
   VALUE "ProductVersion", sversion(11,52,0)
   VALUE "SpecialBuild", "\0"
 END
diff --git 
a/sql/backends/monet5/generator/Tests/execute-privilege-for-public-hge.test 
b/sql/backends/monet5/generator/Tests/execute-privilege-for-public-hge.test
--- a/sql/backends/monet5/generator/Tests/execute-privilege-for-public-hge.test
+++ b/sql/backends/monet5/generator/Tests/execute-privilege-for-public-hge.test
@@ -3,21 +3,21 @@ statement ok
 create user test with password 'test' name 'test'
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(cast(1 as hugeint),3)
 
 1
 2
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(1,cast(4 as hugeint),2)
 
 1
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(5,1,cast(-2 as hugeint))
 
 5
@@ -35,3 +35,4 @@ drop schema test
 @connection(id=c1, username=monetdb, password=monetdb)
 statement ok
 drop user test
+
diff --git 
a/sql/backends/monet5/generator/Tests/execute-privilege-for-public.test 
b/sql/backends/monet5/generator/Tests/execute-privilege-for-public.test
--- a/sql/backends/monet5/generator/Tests/execute-privilege-for-public.test
+++ b/sql/backends/monet5/generator/Tests/execute-privilege-for-public.test
@@ -3,182 +3,182 @@ statement ok
 create user test with password 'test' name 'test'
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(1,3)
 
 1
 2
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(1,4,2)
 
 1
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(5,1,-2)
 
 5
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(cast(1 as tinyint),3)
 
 1
 2
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(1,cast(4 as tinyint),2)
 
 1
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(5,1,cast(-2 as tinyint))
 
 5
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(cast(1 as smallint),3)
 
 1
 2
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(1,cast(4 as smallint),2)
 
 1
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(5,1,cast(-2 as smallint))
 
 5
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(cast(1 as int),3)
 
 1
 2
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(1,cast(4 as int),2)
 
 1
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(5,1,cast(-2 as int))
 
 5
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(cast(1 as bigint),3)
 
 1
 2
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(1,cast(4 as bigint),2)
 
 1
 3
 
 @connection(id=c2, username=test, password=test)
-query I
+query I nosort
 SELECT * from generate_series(5,1,cast(-2 as bigint))
 
 5
 3
 
 @connection(id=c2, username=test, password=test)
-query R
+query R nosort
 SELECT * from generate_series(cast(1 as real),3,1)
 
 1.000
 2.000
 
 @connection(id=c2, username=test, password=test)
-query R
+query R nosort
 SELECT * from generate_series(1,cast(4 as real),2)
 
 1.000
 3.000
 
 @connection(id=c2, username=test, password=test)
-query R
+query R nosort
 SELECT * from generate_series(5,1,cast(-2 as real))
 
 5.000
 3.000
 
 @connection(id=c2, username=test, password=test)
-query R
+query R nosort
 SELECT * from generate_series(cast(1 as double),3,1)
 
 1.000
 2.000
 
 @connection(id=c2, username=test, password=test)
-query R
+query R nosort
 SELECT * from generate_series(1,cast(4 as double),2)
 
 1.000
 3.000
 
 @connectio

MonetDB: Aug2024 - Improve TestConnection(). Use DRIVER= instead...

2024-08-15 Thread Martin van Dinther via checkin-list
Changeset: 6f76f82a7ecf for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6f76f82a7ecf
Modified Files:
clients/odbc/winsetup/setup.c
Branch: Aug2024
Log Message:

Improve TestConnection(). Use DRIVER= instead of DSN= in ConnectString, such 
that it works when adding a new DSN.
Also corrected CONNECTIONTIMEOUT and APPNAME keywords in ConnectString.


diffs (155 lines):

diff --git a/clients/odbc/winsetup/setup.c b/clients/odbc/winsetup/setup.c
--- a/clients/odbc/winsetup/setup.c
+++ b/clients/odbc/winsetup/setup.c
@@ -140,15 +140,12 @@ TestConnection(HWND hwndDlg, struct data
if (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) {
 #define strSize 16384
int pos = 0;
-   char inStr[strSize];
+   char inStr[strSize];// Connection string. Keyword names are 
defined in driver/ODBCAttrs.c
char outStr[strSize];
SQLSMALLINT outLen;
+   SQLUINTEGER timeout = 5;// for setup testing we set 
login timeout to 5 secs
 
-   // Note: we should construct the connection string WITHOUT the 
DSN=..; part,
-   // but currently the dsn is required by MonetDB 
SQLDriverConnect(), so must add it.
-   if (datap->dsn && strlen(datap->dsn) > 0) {
-   pos += snprintf(inStr + pos, strSize - pos, "DSN=%s;", 
datap->dsn);
-   }
+   pos += snprintf(inStr + pos, strSize - pos, "DRIVER=MonetDB 
ODBC Driver;");
if (datap->uid && strlen(datap->uid) > 0) {
pos += snprintf(inStr + pos, strSize - pos, "UID=%s;", 
datap->uid);
}
@@ -188,7 +185,7 @@ TestConnection(HWND hwndDlg, struct data
pos += snprintf(inStr + pos, strSize - pos, 
"LOGINTIMEOUT=%s;", datap->logintimeout);
}
if (datap->replytimeout && strlen(datap->replytimeout) > 0) {
-   pos += snprintf(inStr + pos, strSize - pos, 
"REPLYTIMEOUT=%s;", datap->replytimeout);
+   pos += snprintf(inStr + pos, strSize - pos, 
"CONNECTIONTIMEOUT=%s;", datap->replytimeout);
}
if (datap->replysize && strlen(datap->replysize) > 0) {
pos += snprintf(inStr + pos, strSize - pos, 
"REPLYSIZE=%s;", datap->replysize);
@@ -203,23 +200,34 @@ TestConnection(HWND hwndDlg, struct data
if (datap->logfile && strlen(datap->logfile) > 0) {
pos += snprintf(inStr + pos, strSize - pos, 
"LOGFILE=%s;", datap->logfile);
}
+
+   ret = SQLSetConnectAttr(dbc, SQL_ATTR_LOGIN_TIMEOUT, &timeout, 
SQL_IS_INTEGER);
+
// test the constructed connection string
ret = SQLDriverConnect(dbc, hwndDlg, (SQLCHAR *) inStr, 
SQL_NTS, (SQLCHAR *) outStr, strSize, &outLen, SQL_DRIVER_NOPROMPT);
-   if (ret == SQL_SUCCESS || ret == SQL_SUCCESS_WITH_INFO) {
-   MessageBox(hwndDlg, "Connection successful", boxtitle, 
MB_OK);
+   if (ret == SQL_SUCCESS) {
+   MessageBox(hwndDlg, "Connection successful", boxtitle, 
MB_OK | MB_ICONINFORMATION);
ret = SQLDisconnect(dbc);
} else {
SQLCHAR state[6];
SQLINTEGER errnr;
SQLCHAR msg[2560];
SQLSMALLINT msglen;
+   SQLRETURN ret2;
char buf[2600 + strSize + strSize];
 
// get Error msg
-   ret = SQLGetDiagRec(SQL_HANDLE_DBC, dbc, 1, state, 
&errnr, msg, sizeof(msg), &msglen);
-   sprintf(buf, "Connection failed!\n\nError message: 
%s\n\nSQLstate %s, Errnr %d\n\nConnectString used: %s\n\nReturned 
ConnectString: %s",
+   ret2 = SQLGetDiagRec(SQL_HANDLE_DBC, dbc, 1, state, 
&errnr, msg, sizeof(msg), &msglen);
+   if (ret == SQL_SUCCESS_WITH_INFO) {
+   sprintf(buf, "Connection successful\n\nWarning 
message: %s\n\nSQLState %s\n\nConnectString used: %s\n\nReturned ConnectString: 
%s",
+   (char *) msg, (char *) state, inStr, 
outStr);
+   MessageBox(hwndDlg, buf, boxtitle, MB_OK | 
MB_ICONWARNING);
+   ret = SQLDisconnect(dbc);
+   } else {
+   sprintf(buf, "Connection failed!\n\nError 
message: %s\n\nSQLState %s, Errnr %d\n\nConnectString used: %s\n\nReturned 
ConnectString: %s",
(char *) msg, (char *) state, (int) 
errnr, inStr, outStr);
-   MessageBox(hwndDlg, buf, boxtitle, MB_ICONERROR);
+   MessageBox(hwndDlg, buf, boxtitle, 
MB_ICONERROR);
+   }
}
ret = SQLFreeH

MonetDB: Aug2024 - small improvement

2024-08-15 Thread Martin van Dinther via checkin-list
Changeset: 6a086d6b4252 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6a086d6b4252
Modified Files:
clients/odbc/winsetup/setup.c
Branch: Aug2024
Log Message:

small improvement


diffs (12 lines):

diff --git a/clients/odbc/winsetup/setup.c b/clients/odbc/winsetup/setup.c
--- a/clients/odbc/winsetup/setup.c
+++ b/clients/odbc/winsetup/setup.c
@@ -209,7 +209,7 @@ TestConnection(HWND hwndDlg, struct data
MessageBox(hwndDlg, "Connection successful", boxtitle, 
MB_OK | MB_ICONINFORMATION);
ret = SQLDisconnect(dbc);
} else {
-   SQLCHAR state[6];
+   SQLCHAR state[SQL_SQLSTATE_SIZE + 1];
SQLINTEGER errnr;
SQLCHAR msg[2560];
SQLSMALLINT msglen;
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - return SQLState HYT00 when login timeout peri...

2024-08-15 Thread Martin van Dinther via checkin-list
Changeset: 51f4a26c833c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/51f4a26c833c
Modified Files:
clients/odbc/driver/SQLConnect.c
Branch: Aug2024
Log Message:

return SQLState HYT00 when login timeout period expired during connecting.


diffs (20 lines):

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
@@ -461,9 +461,13 @@ MNDBConnectSettings(ODBCDbc *dbc, const 
if (mid == NULL || mapi_error(mid)) {
const char *error_state;
const char *error_explanation = mid ? mapi_error_str(mid) : 
NULL;
-   if (error_explanation && strncmp(error_explanation, 
"InvalidCredentialsException:", 28) == 0)
-   error_state = "28000";
-   else
+   if (error_explanation) {
+   if (strncmp(error_explanation, 
"InvalidCredentialsException:", 28) == 0)
+   error_state = "28000";
+   else
+   if (strncmp(error_explanation, "could not connect: 
Connection timed out", 39) == 0)
+   error_state = "HYT00";
+   } else
error_state = "08001";
addDbcError(dbc, error_state, error_explanation, 0);
if (mid)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Return proper SQLState HYT01 when we get a ti...

2024-08-15 Thread Martin van Dinther via checkin-list
Changeset: 622e62254a3d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/622e62254a3d
Modified Files:
clients/odbc/driver/SQLExecDirect.c
clients/odbc/driver/SQLExecute.c
clients/odbc/driver/SQLFetch.c
clients/odbc/driver/SQLMoreResults.c
Branch: Aug2024
Log Message:

Return proper SQLState HYT01 when we get a timeout during execution of a 
command.


diffs (61 lines):

diff --git a/clients/odbc/driver/SQLExecDirect.c 
b/clients/odbc/driver/SQLExecDirect.c
--- a/clients/odbc/driver/SQLExecDirect.c
+++ b/clients/odbc/driver/SQLExecDirect.c
@@ -93,9 +93,9 @@ ODBCExecDirect(ODBCStmt *stmt, const SQL
case MOK:
break;
case MTIMEOUT:
-   /* Timeout expired / Communication link failure */
+   /* Connection timeout expired / Communication link failure */
timeout = msetting_long(stmt->Dbc->settings, MP_REPLY_TIMEOUT);
-   addStmtError(stmt, timeout > 0 ? "HYT00" : "08S01", 
mapi_error_str(stmt->Dbc->mid), 0);
+   addStmtError(stmt, timeout > 0 ? "HYT01" : "08S01", 
mapi_error_str(stmt->Dbc->mid), 0);
return SQL_ERROR;
default:
err = mapi_result_error(hdl);
diff --git a/clients/odbc/driver/SQLExecute.c b/clients/odbc/driver/SQLExecute.c
--- a/clients/odbc/driver/SQLExecute.c
+++ b/clients/odbc/driver/SQLExecute.c
@@ -529,9 +529,9 @@ MNDBExecute(ODBCStmt *stmt)
case MOK:
break;
case MTIMEOUT:
-   /* Timeout expired / Communication link failure */
+   /* Connection timeout expired / Communication link failure */
timeout = msetting_long(stmt->Dbc->settings, MP_REPLY_TIMEOUT);
-   addStmtError(stmt, timeout > 0 ? "HYT00" : "08S01", 
mapi_error_str(stmt->Dbc->mid), 0);
+   addStmtError(stmt, timeout > 0 ? "HYT01" : "08S01", 
mapi_error_str(stmt->Dbc->mid), 0);
return SQL_ERROR;
default:
errstr = mapi_result_error(hdl);
diff --git a/clients/odbc/driver/SQLFetch.c b/clients/odbc/driver/SQLFetch.c
--- a/clients/odbc/driver/SQLFetch.c
+++ b/clients/odbc/driver/SQLFetch.c
@@ -101,10 +101,9 @@ MNDBFetch(ODBCStmt *stmt, SQLUSMALLINT *
case MTIMEOUT:
if (RowStatusArray)
WriteValue(RowStatusArray, 
SQL_ROW_ERROR);
-   /* Timeout expired / Communication
-* link failure */
+   /* Connection timeout expired / Communication 
link failure */
timeout = msetting_long(stmt->Dbc->settings, 
MP_REPLY_TIMEOUT);
-   addStmtError(stmt, timeout > 0 ? "HYT00" : 
"08S01", mapi_error_str(stmt->Dbc->mid), 0);
+   addStmtError(stmt, timeout > 0 ? "HYT01" : 
"08S01", mapi_error_str(stmt->Dbc->mid), 0);
return SQL_ERROR;
default:
if (RowStatusArray)
diff --git a/clients/odbc/driver/SQLMoreResults.c 
b/clients/odbc/driver/SQLMoreResults.c
--- a/clients/odbc/driver/SQLMoreResults.c
+++ b/clients/odbc/driver/SQLMoreResults.c
@@ -60,9 +60,9 @@ SQLMoreResults(SQLHSTMT StatementHandle)
addStmtError(stmt, "HY000", mapi_error_str(stmt->Dbc->mid), 0);
return SQL_ERROR;
case MTIMEOUT:
-   /* Timeout expired / Communication link failure */
+   /* Connection timeout expired / Communication link failure */
timeout = msetting_long(stmt->Dbc->settings, MP_REPLY_TIMEOUT);
-   addStmtError(stmt, timeout > 0 ? "HYT00" : "08S01", 
mapi_error_str(stmt->Dbc->mid), 0);
+   addStmtError(stmt, timeout > 0 ? "HYT01" : "08S01", 
mapi_error_str(stmt->Dbc->mid), 0);
return SQL_ERROR;
default:
return ODBCInitResult(stmt);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Resolve compilation warning

2024-08-15 Thread Martin van Dinther via checkin-list
Changeset: 6c3e1b240371 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6c3e1b240371
Modified Files:
clients/odbc/driver/SQLConnect.c
Branch: Aug2024
Log Message:

Resolve compilation warning


diffs (22 lines):

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
@@ -459,7 +459,7 @@ MNDBConnectSettings(ODBCDbc *dbc, const 
mapi_reconnect(mid);
}
if (mid == NULL || mapi_error(mid)) {
-   const char *error_state;
+   char *error_state = "08001";
const char *error_explanation = mid ? mapi_error_str(mid) : 
NULL;
if (error_explanation) {
if (strncmp(error_explanation, 
"InvalidCredentialsException:", 28) == 0)
@@ -467,8 +467,7 @@ MNDBConnectSettings(ODBCDbc *dbc, const 
else
if (strncmp(error_explanation, "could not connect: 
Connection timed out", 39) == 0)
error_state = "HYT00";
-   } else
-   error_state = "08001";
+   }
addDbcError(dbc, error_state, error_explanation, 0);
if (mid)
mapi_destroy(mid);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Aug2024 - Add const keyword.

2024-08-15 Thread Sjoerd Mullender via checkin-list
Changeset: 2064249d8c3e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/2064249d8c3e
Modified Files:
clients/odbc/driver/SQLConnect.c
Branch: Aug2024
Log Message:

Add const keyword.


diffs (12 lines):

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
@@ -459,7 +459,7 @@ MNDBConnectSettings(ODBCDbc *dbc, const 
mapi_reconnect(mid);
}
if (mid == NULL || mapi_error(mid)) {
-   char *error_state = "08001";
+   const char *error_state = "08001";
const char *error_explanation = mid ? mapi_error_str(mid) : 
NULL;
if (error_explanation) {
if (strncmp(error_explanation, 
"InvalidCredentialsException:", 28) == 0)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org