MonetDB: clientinfo - Fix and approve upgrades.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 069d1413870e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/069d1413870e
Modified Files:
sql/backends/monet5/sql_upgrades.c

sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out
sql/test/emptydb-previous-upgrade/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out
sql/test/emptydb-upgrade-chain/Tests/upgrade.stable.out.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.int128
sql/test/emptydb/Tests/check.stable.out.int128

sql/test/testdb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade-chain/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade-hge/Tests/upgrade.stable.out.int128
sql/test/testdb-previous-upgrade/Tests/upgrade.stable.out
sql/test/testdb-previous-upgrade/Tests/upgrade.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.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.int128
Branch: clientinfo
Log Message:

Fix and approve upgrades.


diffs (truncated from 1103 to 300 lines):

diff --git a/sql/backends/monet5/sql_upgrades.c 
b/sql/backends/monet5/sql_upgrades.c
--- a/sql/backends/monet5/sql_upgrades.c
+++ b/sql/backends/monet5/sql_upgrades.c
@@ -7141,7 +7141,7 @@ sql_update_default(Client c, mvc *sql, s
" ('ClientRemark'),\n"
" ('ClientPid');\n"
"update sys.functions set system = true where schema_id 
= 2000 and name in ('setclientinfo', 'sessions');\n"
-   "update sys._tables set system = true where schema_id = 
2000 and name = 'clientinfo_properties';\n";
+   "update sys._tables set system = true where schema_id = 
2000 and name in ('clientinfo_properties', 'sessions');\n";
;
sql_schema *sys = mvc_bind_schema(sql, "sys");
sql_table *t = mvc_bind_table(sql, sys, "sessions");
diff --git 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
--- 
a/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
+++ 
b/sql/test/emptydb-previous-upgrade-chain-hge/Tests/upgrade.stable.out.int128
@@ -1009,3 +1009,40 @@ returns table (value date)
 external name generator.series;
 update sys.functions set system = true where system <> true and name = 
'generate_series' and schema_id = 2000;
 
+Running database upgrade commands:
+drop view sys.sessions;
+drop function sys.sessions();
+create function sys.sessions()
+ returns table(
+  "sessionid" int,
+  "username" string,
+  "login" timestamp,
+  "idle" timestamp,
+  "optimizer" string,
+  "sessiontimeout" int,
+  "querytimeout" int,
+  "workerlimit" int,
+  "memorylimit" int,
+  "language" string,
+  "peer" string,
+  "hostname" string,
+  "application" string,
+  "client" string,
+  "clientpid" bigint,
+  "remark" string
+ )
+ external name sql.sessions;
+create view sys.sessions as select * from sys.sessions();
+create procedure sys.setclientinfo(property string, value string)
+ external name clients.setinfo;
+grant execute on procedure sys.setclientinfo(string, string) to public;
+create table sys.clientinfo_properties(prop string);
+insert into sys.clientinfo_properties values
+ ('ClientHostname'),
+ ('ApplicationName'),
+ ('ClientLibrary'),
+ ('ClientRemark'),
+ ('ClientPid');
+update sys.functions set system = true where schema_id = 2000 and name in 
('setclientinfo', 'sessions');
+update sys._tables set system = true where schema_id = 2000 and name in 
('clientinfo_properties', 'sessions');
+
diff --git a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out 
b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
--- a/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
+++ b/sql/test/emptydb-previous-upgrade-chain/Tests/upgrade.stable.out
@@ -997,3 +997,40 @@ returns table (value date)
 external name generator.series;
 update sys.functi

MonetDB: label - small code cleanup

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 5180aba894c4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5180aba894c4
Modified Files:
sql/server/rel_unnest.c
Branch: label
Log Message:

small code cleanup


diffs (23 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -1530,7 +1530,7 @@ push_up_set(mvc *sql, sql_rel *rel, list
if (need_distinct || need_distinct(s))
set_distinct(ns);
 
-   if (is_join(rel->op)) {
+   if (is_join(rel->op) && !is_semi(rel->op)) {
list *sexps = sa_list(sql->sa), *dexps = 
rel_projections(sql, d, NULL, 1, 1);
for (node *m = dexps->h; m; m = m->next) {
sql_exp *e = m->data;
@@ -1542,8 +1542,8 @@ push_up_set(mvc *sql, sql_rel *rel, list
/* add/remove projections to inner parts of the union 
(as we push a join or semijoin down) */
ns->l = rel_project(sql->sa, ns->l, 
rel_projections(sql, ns->l, NULL, 1, 1));
ns->r = rel_project(sql->sa, ns->r, 
rel_projections(sql, ns->r, NULL, 1, 1));
-   if (is_semi(rel->op))
-   ns->exps = rel_projections(sql, ns->r, NULL, 1, 
1);
+   if (is_semi(rel->op)) /* only push left side of 
semi/anti join */
+   ns->exps = rel_projections(sql, ns->l, NULL, 1, 
1);
if (rel->op == op_anti && s->op == op_union)
ns->op = op_inter;
if (rel->op == op_anti && s->op == op_inter)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: balanced_union - use first sub relation for projecting ...

2024-05-30 Thread Niels Nes via checkin-list
Changeset: fc45530e3aae for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fc45530e3aae
Modified Files:
sql/server/rel_unnest.c
Branch: balanced_union
Log Message:

use first sub relation for projecting the right colunns for a push down of a 
semijoin through a munion


diffs (33 lines):

diff --git a/sql/server/rel_unnest.c b/sql/server/rel_unnest.c
--- a/sql/server/rel_unnest.c
+++ b/sql/server/rel_unnest.c
@@ -1194,7 +1194,6 @@ push_up_groupby(mvc *sql, sql_rel *rel, 
assert(id);
}
 
-   //assert(rel->op != op_anti);
if (rel->op == op_semi)
rel->op = op_join;
if (rel->op == op_anti) {
@@ -1639,7 +1638,7 @@ push_up_munion(mvc *sql, sql_rel *rel, l
if (need_distinct || need_distinct(s))
set_distinct(ns);
 
-   if (is_join(rel->op)) {
+   if (is_join(rel->op) && !is_semi(rel->op)) {
list *sexps = sa_list(sql->sa), *dexps = 
rel_projections(sql, d, NULL, 1, 1);
for (node *m = dexps->h; m; m = m->next) {
sql_exp *e = m->data;
@@ -1653,9 +1652,9 @@ push_up_munion(mvc *sql, sql_rel *rel, l
sql_rel *sl = n->data;
n->data = rel_project(sql->sa, sl, 
rel_projections(sql, sl, NULL, 1, 1));
}
-   if (is_semi(rel->op)) {
-   assert(0);/* looks wrong */
-   ns->exps = rel_projections(sql, ns->r, NULL, 1, 
1);
+   if (is_semi(rel->op)) { /* only project left of 
semi/anti join */
+   sql_rel *sf = rlist->h->data;
+   ns->exps = rel_projections(sql, sf, NULL, 1, 1);
}
if (rel->op == op_anti && s->op == op_munion) {
assert(0); /* needs to convert list in 
left/right again ! */
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge clientinfo branch into default.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: e2e80ee50400 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e2e80ee50400
Branch: default
Log Message:

Merge clientinfo branch into default.


diffs (truncated from 2274 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -44629,6 +44629,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -49640,7 +49645,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -33164,6 +33164,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -38060,7 +38065,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,6 +717,7 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
+void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
@@ -810,6 +811,7 @@ void MCcloseClient(Client c);
 Client MCgetClient(int id);
 Client MCinitClient(oid user, bstream *fin, stream *fout);
 int MCpushClientInput(Client c, bstream *new_input, int listing, const char 
*prompt);
+void MCsetClientInfo(Client c, const char *property, const char *value);
 void MCstopClients(Client c);
 str MCsuspendClient(int id);
 int MCvalid(Client c);
@@ -818,7 +820,7 @@ str MSinitClientPrg(Client cntxt, const 
 void MSresetInstructions(MalBlkPtr mb, int start);
 void MSresetStack(Client cntxt, MalBlkPtr mb, MalStkPtr glb);
 void MSresetVariables(MalBlkPtr mb);
-void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout, 
protocol_version protocol, size_t blocksize);
+void MSscheduleClient(str command, str peer, str challenge, bstream *fin, 
stream *fout, protocol_version protocol, size_t blocksize);
 str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces);
 str OIDXdropImplementation(Client cntxt, BAT *b);
 str QLOGcalls(BAT **r);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,6 +3682,7 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
+   mapi_set_application_name("mclient");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -237,6 +237,7 @@ main(int argc, char *

MonetDB: clientinfo - Closing branch clientinfo.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: f2066f7d8c3c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f2066f7d8c3c
Branch: clientinfo
Log Message:

Closing branch clientinfo.

___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: balanced_union - disable some more test (fixed in other...

2024-05-30 Thread Niels Nes via checkin-list
Changeset: add2306cce2c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/add2306cce2c
Modified Files:
sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test
Branch: balanced_union
Log Message:

disable some more test (fixed in other branch)


diffs (19 lines):

diff --git a/sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test 
b/sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test
--- a/sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test
+++ b/sql/test/BugTracker-2024/Tests/atom_cmp-Bug-7477.test
@@ -1,5 +1,6 @@
 -- trying first without function "abs ( x )"
-statement error TypeException:user.main[12]:'calc.==' undefined in: 
X_20:bit := calc.==(X_17:str, X_18:bte);
+skipif knownfail
+statement error conversion of string '' to type bte failed.
 SELECT - 66 x GROUP BY x HAVING ( x IN ( SELECT '' x WHERE ( x = ( x = 1 ) ) 
UNION SELECT 1 ) )
 
 -- changing '' into 1, so a string into int
@@ -14,6 +15,6 @@ SELECT - 66 x GROUP BY x HAVING ( abs ( 
 -66
 
 skipif knownfail
-statement error TypeException:user.main[12]:'calc.==' undefined in: 
X_0:bit := calc.==(X_1:str, X_2:bte)
+statement error conversion of string '' to type bte failed.
 SELECT - 66 x GROUP BY x HAVING ( abs ( x ) IN ( SELECT '' x WHERE ( x = ( x = 
1 ) ) UNION SELECT 1 ) )
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: label - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 3c34f826c698 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/3c34f826c698
Modified Files:
sql/backends/monet5/sql.c
Branch: label
Log Message:

merged with default


diffs (truncated from 2274 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -44629,6 +44629,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -49640,7 +49645,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -33164,6 +33164,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -38060,7 +38065,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,6 +717,7 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
+void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
@@ -810,6 +811,7 @@ void MCcloseClient(Client c);
 Client MCgetClient(int id);
 Client MCinitClient(oid user, bstream *fin, stream *fout);
 int MCpushClientInput(Client c, bstream *new_input, int listing, const char 
*prompt);
+void MCsetClientInfo(Client c, const char *property, const char *value);
 void MCstopClients(Client c);
 str MCsuspendClient(int id);
 int MCvalid(Client c);
@@ -818,7 +820,7 @@ str MSinitClientPrg(Client cntxt, const 
 void MSresetInstructions(MalBlkPtr mb, int start);
 void MSresetStack(Client cntxt, MalBlkPtr mb, MalStkPtr glb);
 void MSresetVariables(MalBlkPtr mb);
-void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout, 
protocol_version protocol, size_t blocksize);
+void MSscheduleClient(str command, str peer, str challenge, bstream *fin, 
stream *fout, protocol_version protocol, size_t blocksize);
 str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces);
 str OIDXdropImplementation(Client cntxt, BAT *b);
 str QLOGcalls(BAT **r);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,6 +3682,7 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
+   mapi_set_application_name("mclient");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -237,6 +

MonetDB: balanced_union - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 4b03a2093cd9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4b03a2093cd9
Modified Files:
sql/test/emptydb/Tests/check.stable.out.int128
Branch: balanced_union
Log Message:

merged with default


diffs (truncated from 2903 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -44629,6 +44629,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -49640,7 +49645,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -33164,6 +33164,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -38060,7 +38065,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,6 +717,7 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
+void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
@@ -810,6 +811,7 @@ void MCcloseClient(Client c);
 Client MCgetClient(int id);
 Client MCinitClient(oid user, bstream *fin, stream *fout);
 int MCpushClientInput(Client c, bstream *new_input, int listing, const char 
*prompt);
+void MCsetClientInfo(Client c, const char *property, const char *value);
 void MCstopClients(Client c);
 str MCsuspendClient(int id);
 int MCvalid(Client c);
@@ -818,7 +820,7 @@ str MSinitClientPrg(Client cntxt, const 
 void MSresetInstructions(MalBlkPtr mb, int start);
 void MSresetStack(Client cntxt, MalBlkPtr mb, MalStkPtr glb);
 void MSresetVariables(MalBlkPtr mb);
-void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout, 
protocol_version protocol, size_t blocksize);
+void MSscheduleClient(str command, str peer, str challenge, bstream *fin, 
stream *fout, protocol_version protocol, size_t blocksize);
 str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces);
 str OIDXdropImplementation(Client cntxt, BAT *b);
 str QLOGcalls(BAT **r);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,6 +3682,7 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
+   mapi_set_application_name("mclient");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/map

MonetDB: nilmask - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 1705be86c402 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1705be86c402
Modified Files:
clients/Tests/MAL-signatures-hge.test
clients/Tests/MAL-signatures.test
clients/Tests/exports.stable.out
sql/backends/monet5/sql.c
Branch: nilmask
Log Message:

merged with default


diffs (truncated from 2274 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -44634,6 +44634,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -49650,7 +49655,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -33169,6 +33169,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -38070,7 +38075,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,6 +717,7 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
+void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
@@ -810,6 +811,7 @@ void MCcloseClient(Client c);
 Client MCgetClient(int id);
 Client MCinitClient(oid user, bstream *fin, stream *fout);
 int MCpushClientInput(Client c, bstream *new_input, int listing, const char 
*prompt);
+void MCsetClientInfo(Client c, const char *property, const char *value);
 void MCstopClients(Client c);
 str MCsuspendClient(int id);
 int MCvalid(Client c);
@@ -818,7 +820,7 @@ str MSinitClientPrg(Client cntxt, const 
 void MSresetInstructions(MalBlkPtr mb, int start);
 void MSresetStack(Client cntxt, MalBlkPtr mb, MalStkPtr glb);
 void MSresetVariables(MalBlkPtr mb);
-void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout, 
protocol_version protocol, size_t blocksize);
+void MSscheduleClient(str command, str peer, str challenge, bstream *fin, 
stream *fout, protocol_version protocol, size_t blocksize);
 str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces);
 str OIDXdropImplementation(Client cntxt, BAT *b);
 str QLOGcalls(BAT **r);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,6 +3682,7 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
+   mapi_set_application_name("mclient");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapicl

MonetDB: check - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 1344a9aa61fc for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1344a9aa61fc
Modified Files:
sql/backends/monet5/sql_upgrades.c
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/sys-schema/Tests/check_ForeignKey_referential_integrity.test
Branch: check
Log Message:

merged with default


diffs (truncated from 2274 to 300 lines):

diff --git a/clients/Tests/MAL-signatures-hge.test 
b/clients/Tests/MAL-signatures-hge.test
--- a/clients/Tests/MAL-signatures-hge.test
+++ b/clients/Tests/MAL-signatures-hge.test
@@ -44629,6 +44629,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -49640,7 +49645,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/MAL-signatures.test 
b/clients/Tests/MAL-signatures.test
--- a/clients/Tests/MAL-signatures.test
+++ b/clients/Tests/MAL-signatures.test
@@ -33164,6 +33164,11 @@ unsafe pattern clients.setScenario(X_0:s
 CLTsetScenario;
 Switch to other scenario handler, return previous one.
 clients
+setinfo
+unsafe pattern clients.setinfo(X_0:str, X_1:str):str
+CLTsetClientInfo;
+set a clientinfo property
+clients
 setmemorylimit
 unsafe pattern clients.setmemorylimit(X_0:int):void
 CLTsetmemorylimit;
@@ -38060,7 +38065,7 @@ SQLrow_number;
 return the row_numer-ed groups
 sql
 sessions
-pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int])
+pattern sql.sessions() (X_0:bat[:int], X_1:bat[:str], X_2:bat[:timestamp], 
X_3:bat[:timestamp], X_4:bat[:str], X_5:bat[:int], X_6:bat[:int], 
X_7:bat[:int], X_8:bat[:int], X_9:bat[:str], X_10:bat[:str], X_11:bat[:str], 
X_12:bat[:str], X_13:bat[:str], X_14:bat[:lng], X_15:bat[:str])
 sql_sessions_wrap;
 SQL export table of active sessions, their timeouts and idle status
 sql
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,6 +717,7 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
+void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
@@ -810,6 +811,7 @@ void MCcloseClient(Client c);
 Client MCgetClient(int id);
 Client MCinitClient(oid user, bstream *fin, stream *fout);
 int MCpushClientInput(Client c, bstream *new_input, int listing, const char 
*prompt);
+void MCsetClientInfo(Client c, const char *property, const char *value);
 void MCstopClients(Client c);
 str MCsuspendClient(int id);
 int MCvalid(Client c);
@@ -818,7 +820,7 @@ str MSinitClientPrg(Client cntxt, const 
 void MSresetInstructions(MalBlkPtr mb, int start);
 void MSresetStack(Client cntxt, MalBlkPtr mb, MalStkPtr glb);
 void MSresetVariables(MalBlkPtr mb);
-void MSscheduleClient(str command, str challenge, bstream *fin, stream *fout, 
protocol_version protocol, size_t blocksize);
+void MSscheduleClient(str command, str peer, str challenge, bstream *fin, 
stream *fout, protocol_version protocol, size_t blocksize);
 str OIDXcreateImplementation(Client cntxt, int tpe, BAT *b, int pieces);
 str OIDXdropImplementation(Client cntxt, BAT *b);
 str QLOGcalls(BAT **r);
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,6 +3682,7 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
+   mapi_set_application_name("mclient");
   

MonetDB: check - implement '!=' COMPARISON token

2024-05-30 Thread Yunus Koning via checkin-list
Changeset: 34974cde3236 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/34974cde3236
Modified Files:
sql/server/sql_scan.c
sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.test
Branch: check
Log Message:

implement '!=' COMPARISON token


diffs (39 lines):

diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -1247,6 +1247,20 @@ int scanner_symbol(mvc * c, int cur)
case ';':
lc->started = 0;
return scanner_token(lc, SCOLON);
+   case '!':
+   lc->started = 1;
+   cur = scanner_getc(lc);
+   if (cur < 0)
+   return EOF;
+   else if (cur == '=') {
+   lc->rs->buf[lc->rs->pos + lc->yycur - 2] = '<';
+   lc->rs->buf[lc->rs->pos + lc->yycur - 1] = '>';
+   return scanner_token( lc, COMPARISON);
+   }
+   else
+   lc->yycur--;
+   cur = '!';
+   break;
case '<':
lc->started = 1;
cur = scanner_getc(lc);
diff --git 
a/sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.test 
b/sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.test
--- a/sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.test
+++ b/sql/test/sys-schema/Tests/webExamplesComparisonFunctionsOperators.test
@@ -56,8 +56,10 @@ select 2 = 5 as f1, 2 <> 5 as t1
 0
 1
 
-statement error
+query I rowsort
 select 2 != 5 as t1
+
+1
 
 query I rowsort
 select "<"('aa', 'ab') as tru
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - merge with check

2024-05-30 Thread Yunus Koning via checkin-list
Changeset: 9db08f0c28ec for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9db08f0c28ec
Branch: default
Log Message:

merge with check


diffs (truncated from 1717 to 300 lines):

diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -16,6 +16,7 @@
 #include "rel_rel.h"
 #include "rel_basetable.h"
 #include "rel_exp.h"
+#include "rel_dump.h"
 #include "rel_psm.h"
 #include "rel_prop.h"
 #include "rel_select.h"
@@ -4988,6 +4989,35 @@ sql_insert_triggers(backend *be, sql_tab
return res;
 }
 
+static void
+sql_insert_check(backend *be, sql_key *key, sql_rel *inserts, list *refs)
+{
+   mvc *sql = be->mvc;
+   node *m, *n;
+
+   inserts = rel_copy(sql, inserts, 1);
+   list* exps = inserts->exps;
+
+   for (n = ol_first_node(key->t->columns), m = exps->h; n && m;
+   n = n->next, m = m->next) {
+   sql_exp *i = m->data;
+   sql_column *c = n->data;
+   i->alias.rname= sa_strdup(sql->sa, c->t->base.name);
+   i->alias.name= sa_strdup(sql->sa, c->base.name);
+   }
+
+   int pos = 0;
+   sql_rel* rel = rel_read(sql, sa_strdup(sql->sa, key->check), &pos, 
sa_list(sql->sa));
+   rel->l = inserts;
+   stmt* s = subrel_bin(be, rel, refs);
+   sql_subtype *bt = sql_bind_localtype("bit");
+   s = stmt_uselect(be, column(be, s), stmt_atom(be, 
atom_zero_value(sql->sa, bt)), cmp_equal, NULL, 0, 1);
+   sql_subfunc *cnt = sql_bind_func(sql, "sys", "count", 
sql_bind_localtype("void"), NULL, F_AGGR, true, true);
+   s = stmt_aggr(be, s, NULL, NULL, cnt, 1, 0, 1);
+   char *msg = sa_message(sql->sa, SQLSTATE(40002) "INSERT INTO: CHECK 
constraint violated: %s", key->base.name);
+   (void)stmt_exception(be, s, msg, 1);
+}
+
 static sql_table *
 sql_insert_check_null(backend *be, sql_table *t, list *inserts)
 {
@@ -5066,6 +5096,12 @@ rel2bin_insert(backend *be, sql_rel *rel
if (idx_ins)
pin = refs_find_rel(refs, prel);
 
+   for (n = ol_first_node(t->keys); n; n = n->next) {
+   sql_key * key = n->data;
+   if (key->type == ckey)
+   sql_insert_check(be, key, rel->r, refs);
+   }
+
if (!sql_insert_check_null(be, t, inserts->op4.lval))
return NULL;
 
@@ -5948,6 +5984,61 @@ sql_update_triggers(backend *be, sql_tab
 }
 
 static void
+sql_update_check(backend *be, sql_key * key, sql_rel *updates, list *refs)
+{
+   mvc *sql = be->mvc;
+   int pos = 0;
+
+
+   stack_push_frame(be->mvc, "ALTER TABLE ADD CONSTRAINT CHECK");
+   sql_schema* ss = key->t->s;
+   frame_push_table(sql, key->t);
+   key->t->s = ss; // recover the schema because frame_push_table removes 
it
+
+   sql_rel* rel = rel_read(sql, sa_strdup(sql->sa, key->check), &pos, 
sa_list(sql->sa));
+   stack_pop_frame(sql);
+
+   if (!key->base.new) {
+   sql_rel* base = rel->l;
+   assert(strcmp(((sql_exp*) updates->exps->h->data)->alias.name, 
TID) == 0);
+   list_append(base->exps, exp_copy(sql, updates->exps->h->data));
+
+   bool need_join = 0;
+   list* pexps = sa_list(sql->sa);
+   sql_exp* tid_exp = exp_copy(sql, updates->exps->h->data);
+   unsigned label = ++sql->label;
+   exp_setrelname(sql->sa, tid_exp, label);
+   list_append(pexps, tid_exp);
+   for (node* m = base->exps->h; m; m = m->next) {
+   if (exps_find_exp( updates->exps, m->data) == NULL) {
+   pexps = list_append(pexps, exp_copy(sql, 
m->data));
+   need_join = 1;
+   }
+   }
+
+   if (need_join) {
+   base = rel_project(sql->sa, base, pexps);
+   sql_rel* join = rel_crossproduct(sql->sa, base, 
updates, op_join);
+   sql_exp* join_cond = exp_compare(sql->sa, exp_ref(sql, 
base->exps->h->data), exp_ref(sql, updates->exps->h->data), cmp_equal);
+   join->exps = sa_list(sql->sa);
+   join->exps = list_append(join->exps, join_cond);
+   rel->l = join;
+   }
+   else {
+   rel->l = updates;
+   }
+   }
+
+   sql_subfunc *cnt = sql_bind_func(sql, "sys", "count", 
sql_bind_localtype("void"), NULL, F_AGGR, true, true);
+   sql_subtype *bt = sql_bind_localtype("bit");
+   stmt* s = subrel_bin(be, rel, refs);
+   s = stmt_uselect(be, column(be, s), stmt_atom(be, 
atom_zero_value(sql->sa, bt)), cmp_equal, NULL, 0, 1);
+   s = stmt_aggr(be, s, NULL, NULL, cnt, 1, 0, 1);
+   char *msg = sa_message(sql->sa, SQLSTATE(40002) "UPDATE: CHECK 
constraint violated: %s", key->base.name);
+   (void)stmt_exception(

MonetDB: default - remove white space

2024-05-30 Thread Yunus Koning via checkin-list
Changeset: 5c1fa247355f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5c1fa247355f
Modified Files:
sql/server/rel_schema.c
sql/storage/store.c
Branch: default
Log Message:

remove white space


diffs (24 lines):

diff --git a/sql/server/rel_schema.c b/sql/server/rel_schema.c
--- a/sql/server/rel_schema.c
+++ b/sql/server/rel_schema.c
@@ -390,7 +390,7 @@ sql_rel* create_check_plan(sql_query *qu
exp_kind ek = {type_value, card_value, FALSE};
sql_rel* rel = rel_basetable(sql, t, t->base.name);
sql_exp *e = rel_logical_value_exp(query, &rel, s->data.sym, sql_sel | 
sql_no_subquery, ek);
-   rel->exps = rel_base_projection(sql, rel, 0);   
+   rel->exps = rel_base_projection(sql, rel, 0);
list *pexps = sa_list(sql->sa);
pexps = append(pexps, e);
rel = rel_project(sql->sa, rel, pexps);
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -3037,7 +3037,7 @@ key_dup(sql_trans *tr, sql_key *k, sql_t
 
if (nk->type == pkey)
t->pkey = tk;
-   
+
if (nk->type == ckey)
nk->check = _STRDUP(k->check);
} else {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Move SQL change information to the sql/Chenag...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: d7ae717f3a43 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d7ae717f3a43
Modified Files:
ChangeLog
sql/ChangeLog
Branch: default
Log Message:

Move SQL change information to the sql/ChenageLog


diffs (41 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,10 +12,3 @@
   References to the old MonetDB5 name have been removed.  All packages
   are now just MonetDB.
 
-* Wed May  8 2024 Niels Nes 
-- Add support for select exp, count(*) group by 1 order by 1; ie. using
-  numeric references Added support for group by all and order by all. The
-  later is ordering on all columns of the selection.  The group by all
-  finds all expressions from the selections which aren't aggregations
-  and groups on those.  All can also be replaced by '*'.
-
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -1,10 +1,20 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
-* Mon May 13 2024 Niels Nes 
+* Mon May 13 2024 Niels Nes 
 - Extended sys.generate_series() to generate dates. Added 2 new functions:
-  sys.generate_series(first date, "limit" date, stepsize interval month)
-  sys.generate_series(first date, "limit" date, stepsize interval day)
+  sys.generate_series(first date, "limit" date, stepsize interval month) and
+  sys.generate_series(first date, "limit" date, stepsize interval day).
+
+* Wed May  8 2024 Niels Nes 
+- Added support for select exp, count(*) group by 1 order by 1;
+  ie. using numeric references in group by clause.
+- Added support for GROUP BY ALL. This finds all expressions from the
+  selections which aren't aggregations and groups on those.
+  At least one aggregation must be specified.
+  The ALL keyword can also be replaced by '*', so: GROUP BY *.
+- Added support for ORDER BY ALL. This orders on all columns of the selection.
+  The ALL keyword can also be replaced by '*', so: ORDER BY *.
 
 * Thu May  2 2024 Martin van Dinther 
 - Removed the obsolete ANALYZE statement syntax options: SAMPLE nn and
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Move autocommit property, as it is not part o...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: 0c3c7750dbe6 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0c3c7750dbe6
Modified Files:
clients/odbc/ChangeLog
Branch: default
Log Message:

Move autocommit property, as it is not part of the TLS properties.


diffs (23 lines):

diff --git a/clients/odbc/ChangeLog b/clients/odbc/ChangeLog
--- a/clients/odbc/ChangeLog
+++ b/clients/odbc/ChangeLog
@@ -9,7 +9,6 @@
 CERTHASH / Server Certificate Hash = sha256:HEXDIGITS
 CLIENTKEY / Client Key = PATH
 CLIENTCERT / Client Certificate = PATH
-AUTOCOMMIT / Autocommit = ON/OFF
 - Several more connection properties have been made configurable:
 SCHEMA / Schema = NAME
 TIMEZONE / Time Zone = Minutes East Of UTC
@@ -17,8 +16,10 @@
 LOGFILE / Log File = PATH
 LOGINTIMEOUT / Login Timeout = MILLISECONDS
 CONNECTIONTIMEOUT / Connection Timeout = MILLISECONDS
+AUTOCOMMIT / Autocommit = ON/OFF
 SOCK / Unix Socket = PATH (unix only)
-- SQLBrowseConnect adds On/Off suggestions to boolean settings
+- SQLBrowseConnect() adds On/Off suggestions to boolean settings
   and prioritizes the DATABASE attribute if it notices monetdbd
   requires one. Apart from that only UID/User and PWD/Password
   are required, all others have sensible defaults.
+
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


monetdb-java: default - Adapt output of Test 'getIndexInfo(null,...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: 281b56c61693 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java/rev/281b56c61693
Modified Files:
tests/JDBC_API_Tester.java
Branch: default
Log Message:

Adapt output of Test 'getIndexInfo(null, sys, key_types, false, false)' for 
servers 11.50 or higher.
The sys.key_types table will be extended with 2 new key_types, hence the 
cardinality changes from 3 to 5.


diffs (25 lines):

diff --git a/tests/JDBC_API_Tester.java b/tests/JDBC_API_Tester.java
--- a/tests/JDBC_API_Tester.java
+++ b/tests/JDBC_API_Tester.java
@@ -836,8 +836,8 @@ final public class JDBC_API_Tester {
"Resultset with 13 columns\n" +
"TABLE_CAT  TABLE_SCHEM TABLE_NAME  
NON_UNIQUE  INDEX_QUALIFIER INDEX_NAME  TYPEORDINAL_POSITION
COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES   FILTER_CONDITION\n" +
"char(1)varchar(1024)   varchar(1024)   boolean 
char(1) varchar(1024)   tinyint smallintvarchar(1024)   char(1) int 
int char(1)\n" +
-   "null   sys key_types   false   null
key_types_key_type_id_pkey  2   1   key_type_id null3   
0   null\n" +
-   "null   sys key_types   false   null
key_types_key_type_name_unique  2   1   key_type_name   null3   
0   null\n");
+   "null   sys key_types   false   null
key_types_key_type_id_pkey  2   1   key_type_id null" + 
(isPostDec2023 ? "5" : "3") + " 0   null\n" +
+   "null   sys key_types   false   null
key_types_key_type_name_unique  2   1   key_type_name   null" + 
(isPostDec2023 ? "5" : "3") + " 0   null\n");
 
compareResultSet(dbmd.getIndexInfo(null, "tmp", 
"tmp_pk_uc", false, false), "getIndexInfo(null, tmp, tmp_pk_uc, false, false)",
"Resultset with 13 columns\n" +
@@ -1300,8 +1300,8 @@ final public class JDBC_API_Tester {
"Resultset with 13 columns\n" +
"TABLE_CAT  TABLE_SCHEM TABLE_NAME  
NON_UNIQUE  INDEX_QUALIFIER INDEX_NAME  TYPEORDINAL_POSITION
COLUMN_NAME ASC_OR_DESC CARDINALITY PAGES   FILTER_CONDITION\n" +
"char(1)varchar(1024)   varchar(1024)   boolean 
char(1) varchar(1024)   tinyint smallintvarchar(1024)   char(1) int 
int char(1)\n" +
-   "null   sys key_types   false   null
key_types_key_type_id_pkey  2   1   key_type_id null3   
0   null\n" +
-   "null   sys key_types   false   null
key_types_key_type_name_unique  2   1   key_type_name   null3   
0   null\n");
+   "null   sys key_types   false   null
key_types_key_type_id_pkey  2   1   key_type_id null" + 
(isPostDec2023 ? "5" : "3") + " 0   null\n" +
+   "null   sys key_types   false   null
key_types_key_type_name_unique  2   1   key_type_name   null" + 
(isPostDec2023 ? "5" : "3") + " 0   null\n");
 
if (testCreateDropIndexOnTmpTables) {
compareResultSet(dbmd.getIndexInfo(null, "tmp", 
"tmp_pk_uc", false, false), "getIndexInfo(null, tmp, tmp_pk_uc, false, false)",
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


monetdb-java: default - Extend Makefile with target: jre21jars

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: cccaeb65a5d6 for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java/rev/cccaeb65a5d6
Added Files:
build_jre21.xml
Modified Files:
Makefile
Branch: default
Log Message:

Extend Makefile with target: jre21jars
Note this requires that your OS has jdk21 installed and be the default jvm.


diffs (truncated from 385 to 300 lines):

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -7,6 +7,11 @@ jre17jars: src/main/java/org/monetdb/jdb
ant -f build_jre17.xml distjdbc
rm -rf build
 
+jre21jars: src/main/java/org/monetdb/jdbc/MonetVersion.java
+   rm -rf build
+   ant -f build_jre21.xml distjdbc
+   rm -rf build
+
 test: all
echo banana
cd tests; ant  -f build.xml test
diff --git a/build_jre21.xml b/build_jre21.xml
new file mode 100644
--- /dev/null
+++ b/build_jre21.xml
@@ -0,0 +1,365 @@
+
+
+
+
+
+
+
+
+
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+  
+
+  
+  
+
+  
+
+  
+  
+  
+  
+  
+  
+
+  
+  
+  
+  
+
+  
+  
+
+
+
+  
+
+  
+
+
+  
+
+  
+
+
+  
+
+  
+
+
+  
+
+  
+
+  
+
+  
+  
+org.monetdb.jdbc.MonetDriver
+
+  
+
+
+
+
+  
+
+  
+
+  
+
+  
+
+
+  
+
+  
+
+  
+  
+
+
+  
+
+
+
+
+
+  
+  
+
+
+  
+
+  
+
+  
+  
+
+
+  
+
+
+
+
+  
+  
+
+
+  
+
+  
+
+  
+
+  
+
+  
+  
+
+  
+
+  
+
+  
+  
+
+
+  
+  
+  
+  
+
+  
+
+  
+
+
+  
+  
+
+  
+
+  
+
+
+  
+  
+
+  
+
+  
+
+
+  
+  
+
+  
+
+  
+
+
+  
+  
+
+  
+
+  
+  
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+   
+
+
+  
+
+  
+  
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Correcting typo in comment

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: d54fccc521d7 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d54fccc521d7
Modified Files:
sql/server/rel_select.c
Branch: default
Log Message:

Correcting typo in comment


diffs (16 lines):

diff --git a/sql/server/rel_select.c b/sql/server/rel_select.c
--- a/sql/server/rel_select.c
+++ b/sql/server/rel_select.c
@@ -2327,10 +2327,10 @@ negate_symbol_tree(mvc *sql, symbol *sc)
case 1: /* negating ANY/ALL */
cmp_n->next->next->next->data.i_val = 0;
break;
-   case 2: /* negating IS [NOY] DINSTINCT FROM */
+   case 2: /* negating IS [NOT] DINSTINCT FROM */
cmp_n->next->next->next->data.i_val = 3;
break;
-   case 3: /* negating IS [NOY] DINSTINCT FROM */
+   case 3: /* negating IS [NOT] DINSTINCT FROM */
cmp_n->next->next->next->data.i_val = 2;
break;
}
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - fixed parser, ie removed useless nonterminal

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 0efd1c3c463d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0efd1c3c463d
Modified Files:
sql/server/sql_parser.y
Branch: default
Log Message:

fixed parser, ie removed useless nonterminal


diffs (27 lines):

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
@@ -2153,8 +2153,7 @@ column_constraint_type:
  append_int(l, $4 );
  append_int(l, $5 );
  $$ = _symbol_create_list( SQL_FOREIGN_KEY, l); }
- /*TODO: Implement domain_constraint_type*/
- | CHECK '(' search_condition ')' { $$ = _symbol_create_symbol(SQL_CHECK, 
$3); }
+ |  CHECK '(' search_condition ')' { $$ = _symbol_create_symbol(SQL_CHECK, 
$3); }
  ;
 
 table_constraint_type:
@@ -2175,11 +2174,8 @@ table_constraint_type:
  append_int(l, $7 );
  append_int(l, $8 );
  $$ = _symbol_create_list( SQL_FOREIGN_KEY, l); }
- /*TODO: Implement domain_constraint_type*/
- | CHECK '(' search_condition ')' { $$ = _symbol_create_symbol(SQL_CHECK, 
$3); }
- ;
-
-domain_constraint_type:
+ |  CHECK '(' search_condition ')' 
+   { $$ = _symbol_create_symbol(SQL_CHECK, $3); }
  ;
 
 ident_commalist:
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: label - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 1801b604141e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1801b604141e
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_basetable.c
sql/server/rel_dump.c
sql/server/rel_rel.h
sql/server/rel_schema.c
sql/server/rel_select.c
sql/server/sql_mvc.c
sql/server/sql_mvc.h
Branch: label
Log Message:

merged with default


diffs (truncated from 1797 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,10 +12,3 @@
   References to the old MonetDB5 name have been removed.  All packages
   are now just MonetDB.
 
-* Wed May  8 2024 Niels Nes 
-- Add support for select exp, count(*) group by 1 order by 1; ie. using
-  numeric references Added support for group by all and order by all. The
-  later is ordering on all columns of the selection.  The group by all
-  finds all expressions from the selections which aren't aggregations
-  and groups on those.  All can also be replaced by '*'.
-
diff --git a/clients/odbc/ChangeLog b/clients/odbc/ChangeLog
--- a/clients/odbc/ChangeLog
+++ b/clients/odbc/ChangeLog
@@ -9,7 +9,6 @@
 CERTHASH / Server Certificate Hash = sha256:HEXDIGITS
 CLIENTKEY / Client Key = PATH
 CLIENTCERT / Client Certificate = PATH
-AUTOCOMMIT / Autocommit = ON/OFF
 - Several more connection properties have been made configurable:
 SCHEMA / Schema = NAME
 TIMEZONE / Time Zone = Minutes East Of UTC
@@ -17,8 +16,10 @@
 LOGFILE / Log File = PATH
 LOGINTIMEOUT / Login Timeout = MILLISECONDS
 CONNECTIONTIMEOUT / Connection Timeout = MILLISECONDS
+AUTOCOMMIT / Autocommit = ON/OFF
 SOCK / Unix Socket = PATH (unix only)
-- SQLBrowseConnect adds On/Off suggestions to boolean settings
+- SQLBrowseConnect() adds On/Off suggestions to boolean settings
   and prioritizes the DATABASE attribute if it notices monetdbd
   requires one. Apart from that only UID/User and PWD/Password
   are required, all others have sensible defaults.
+
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -1,10 +1,20 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
-* Mon May 13 2024 Niels Nes 
+* Mon May 13 2024 Niels Nes 
 - Extended sys.generate_series() to generate dates. Added 2 new functions:
-  sys.generate_series(first date, "limit" date, stepsize interval month)
-  sys.generate_series(first date, "limit" date, stepsize interval day)
+  sys.generate_series(first date, "limit" date, stepsize interval month) and
+  sys.generate_series(first date, "limit" date, stepsize interval day).
+
+* Wed May  8 2024 Niels Nes 
+- Added support for select exp, count(*) group by 1 order by 1;
+  ie. using numeric references in group by clause.
+- Added support for GROUP BY ALL. This finds all expressions from the
+  selections which aren't aggregations and groups on those.
+  At least one aggregation must be specified.
+  The ALL keyword can also be replaced by '*', so: GROUP BY *.
+- Added support for ORDER BY ALL. This orders on all columns of the selection.
+  The ALL keyword can also be replaced by '*', so: ORDER BY *.
 
 * Thu May  2 2024 Martin van Dinther 
 - Removed the obsolete ANALYZE statement syntax options: SAMPLE nn and
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -16,6 +16,7 @@
 #include "rel_rel.h"
 #include "rel_basetable.h"
 #include "rel_exp.h"
+#include "rel_dump.h"
 #include "rel_psm.h"
 #include "rel_prop.h"
 #include "rel_select.h"
@@ -5070,6 +5071,35 @@ sql_insert_triggers(backend *be, sql_tab
return res;
 }
 
+static void
+sql_insert_check(backend *be, sql_key *key, sql_rel *inserts, list *refs)
+{
+   mvc *sql = be->mvc;
+   node *m, *n;
+
+   inserts = rel_copy(sql, inserts, 1);
+   list* exps = inserts->exps;
+
+   for (n = ol_first_node(key->t->columns), m = exps->h; n && m;
+   n = n->next, m = m->next) {
+   sql_exp *i = m->data;
+   sql_column *c = n->data;
+   i->alias.rname= sa_strdup(sql->sa, c->t->base.name);
+   i->alias.name= sa_strdup(sql->sa, c->base.name);
+   }
+
+   int pos = 0;
+   sql_rel* rel = rel_read(sql, sa_strdup(sql->sa, key->check), &pos, 
sa_list(sql->sa));
+   rel->l = inserts;
+   stmt* s = subrel_bin(be, rel, refs);
+   sql_subtype *bt = sql_bind_localtype("bit");
+   s = stmt_uselect(be, column(be, s), stmt_atom(be, 
atom_zero_value(sql->sa, bt)), cmp_equal, NULL, 0, 1);
+   sql_subfunc *cnt = sql_bind_func(sql, "sys", "count", 
sql_bind_localtype("void"), NULL, F_AGGR, true, true);
+   s = stmt_aggr(be, s, NULL, NULL, cnt, 1, 0, 1);
+   char *msg = sa_message(sql->sa, SQLSTATE(40002) "INSERT INTO: CHECK 
constraint violated: %s", key->base.name);
+   (void)stmt_exception(be, s, msg, 1);
+}
+
 static sql_table *
 sql_insert_check_

MonetDB: balanced_union - dup instead of steal, fixes crash in n...

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 23cb60d4aa9e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/23cb60d4aa9e
Modified Files:
sql/server/rel_optimize_proj.c
sql/server/rel_optimize_sel.c
Branch: balanced_union
Log Message:

dup instead of steal, fixes crash in name_find_column in tpcds tests


diffs (34 lines):

diff --git a/sql/server/rel_optimize_proj.c b/sql/server/rel_optimize_proj.c
--- a/sql/server/rel_optimize_proj.c
+++ b/sql/server/rel_optimize_proj.c
@@ -2020,8 +2020,8 @@ rel_push_aggr_down_n_arry(visitor *v, sq
 
list *nl = sa_list(v->sql->sa);
for (node *n = ((list*)u->l)->h; n; n = n->next) {
-   r = n->data;
-   n->data = NULL; /* clean list as we steal the relation r, 
stealing is needed else (with multiple references) double project cleanup fails 
*/
+   r = rel_dup(n->data);
+   //n->data = NULL; /* clean list as we steal the relation r, 
stealing is needed else (with multiple references) double project cleanup fails 
*/
if (!is_project(r->op))
r = rel_project(v->sql->sa, r,
rel_projections(v->sql, r, NULL, 1, 
1));
@@ -2047,6 +2047,7 @@ rel_push_aggr_down_n_arry(visitor *v, sq
r->nrcols = list_length(r->exps);
set_processed(r);
 
+   assert(r);
append(nl, r);
}
 
diff --git a/sql/server/rel_optimize_sel.c b/sql/server/rel_optimize_sel.c
--- a/sql/server/rel_optimize_sel.c
+++ b/sql/server/rel_optimize_sel.c
@@ -3339,7 +3339,7 @@ rel_push_select_down(visitor *v, sql_rel
node *n;
 
if (rel_is_ref(rel)) {
-   if (is_select(rel->op) && rel->exps) {
+   if (is_select(rel->op) && !list_empty(rel->exps)) {
/* add inplace empty select */
sql_rel *l = rel_select(v->sql->sa, rel->l, NULL);
 
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: balanced_union - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 7d0c1a66f48b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7d0c1a66f48b
Modified Files:
sql/backends/monet5/rel_bin.c
sql/server/rel_dump.c
sql/server/rel_rel.h
sql/server/rel_select.c
sql/server/sql_partition.c
sql/test/emptydb/Tests/check.stable.out.int128
Branch: balanced_union
Log Message:

merged with default


diffs (truncated from 1797 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,10 +12,3 @@
   References to the old MonetDB5 name have been removed.  All packages
   are now just MonetDB.
 
-* Wed May  8 2024 Niels Nes 
-- Add support for select exp, count(*) group by 1 order by 1; ie. using
-  numeric references Added support for group by all and order by all. The
-  later is ordering on all columns of the selection.  The group by all
-  finds all expressions from the selections which aren't aggregations
-  and groups on those.  All can also be replaced by '*'.
-
diff --git a/clients/odbc/ChangeLog b/clients/odbc/ChangeLog
--- a/clients/odbc/ChangeLog
+++ b/clients/odbc/ChangeLog
@@ -9,7 +9,6 @@
 CERTHASH / Server Certificate Hash = sha256:HEXDIGITS
 CLIENTKEY / Client Key = PATH
 CLIENTCERT / Client Certificate = PATH
-AUTOCOMMIT / Autocommit = ON/OFF
 - Several more connection properties have been made configurable:
 SCHEMA / Schema = NAME
 TIMEZONE / Time Zone = Minutes East Of UTC
@@ -17,8 +16,10 @@
 LOGFILE / Log File = PATH
 LOGINTIMEOUT / Login Timeout = MILLISECONDS
 CONNECTIONTIMEOUT / Connection Timeout = MILLISECONDS
+AUTOCOMMIT / Autocommit = ON/OFF
 SOCK / Unix Socket = PATH (unix only)
-- SQLBrowseConnect adds On/Off suggestions to boolean settings
+- SQLBrowseConnect() adds On/Off suggestions to boolean settings
   and prioritizes the DATABASE attribute if it notices monetdbd
   requires one. Apart from that only UID/User and PWD/Password
   are required, all others have sensible defaults.
+
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -1,10 +1,20 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
-* Mon May 13 2024 Niels Nes 
+* Mon May 13 2024 Niels Nes 
 - Extended sys.generate_series() to generate dates. Added 2 new functions:
-  sys.generate_series(first date, "limit" date, stepsize interval month)
-  sys.generate_series(first date, "limit" date, stepsize interval day)
+  sys.generate_series(first date, "limit" date, stepsize interval month) and
+  sys.generate_series(first date, "limit" date, stepsize interval day).
+
+* Wed May  8 2024 Niels Nes 
+- Added support for select exp, count(*) group by 1 order by 1;
+  ie. using numeric references in group by clause.
+- Added support for GROUP BY ALL. This finds all expressions from the
+  selections which aren't aggregations and groups on those.
+  At least one aggregation must be specified.
+  The ALL keyword can also be replaced by '*', so: GROUP BY *.
+- Added support for ORDER BY ALL. This orders on all columns of the selection.
+  The ALL keyword can also be replaced by '*', so: ORDER BY *.
 
 * Thu May  2 2024 Martin van Dinther 
 - Removed the obsolete ANALYZE statement syntax options: SAMPLE nn and
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -16,6 +16,7 @@
 #include "rel_rel.h"
 #include "rel_basetable.h"
 #include "rel_exp.h"
+#include "rel_dump.h"
 #include "rel_psm.h"
 #include "rel_prop.h"
 #include "rel_select.h"
@@ -5054,6 +5055,35 @@ sql_insert_triggers(backend *be, sql_tab
return res;
 }
 
+static void
+sql_insert_check(backend *be, sql_key *key, sql_rel *inserts, list *refs)
+{
+   mvc *sql = be->mvc;
+   node *m, *n;
+
+   inserts = rel_copy(sql, inserts, 1);
+   list* exps = inserts->exps;
+
+   for (n = ol_first_node(key->t->columns), m = exps->h; n && m;
+   n = n->next, m = m->next) {
+   sql_exp *i = m->data;
+   sql_column *c = n->data;
+   i->alias.rname= sa_strdup(sql->sa, c->t->base.name);
+   i->alias.name= sa_strdup(sql->sa, c->base.name);
+   }
+
+   int pos = 0;
+   sql_rel* rel = rel_read(sql, sa_strdup(sql->sa, key->check), &pos, 
sa_list(sql->sa));
+   rel->l = inserts;
+   stmt* s = subrel_bin(be, rel, refs);
+   sql_subtype *bt = sql_bind_localtype("bit");
+   s = stmt_uselect(be, column(be, s), stmt_atom(be, 
atom_zero_value(sql->sa, bt)), cmp_equal, NULL, 0, 1);
+   sql_subfunc *cnt = sql_bind_func(sql, "sys", "count", 
sql_bind_localtype("void"), NULL, F_AGGR, true, true);
+   s = stmt_aggr(be, s, NULL, NULL, cnt, 1, 0, 1);
+   char *msg = sa_message(sql->sa, SQLSTATE(40002) "INSERT INTO: CHECK 
constraint violated: %s", key->base.name);
+   (void)stmt_exception(be, s, msg, 1);
+}
+
 static sql_table *
 sql_insert_check_null(backend *be, sql_tabl

MonetDB: default - cleanup != handling

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 0d32195c0b18 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0d32195c0b18
Modified Files:
sql/server/sql_scan.c
Branch: default
Log Message:

cleanup != handling


diffs (18 lines):

diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -1256,11 +1256,10 @@ int scanner_symbol(mvc * c, int cur)
lc->rs->buf[lc->rs->pos + lc->yycur - 2] = '<';
lc->rs->buf[lc->rs->pos + lc->yycur - 1] = '>';
return scanner_token( lc, COMPARISON);
+   } else {
+   utf8_putchar(lc, cur); //put the char back
}
-   else
-   lc->yycur--;
-   cur = '!';
-   break;
+   return scanner_token(lc, '!');
case '<':
lc->started = 1;
cur = scanner_getc(lc);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: label - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 6e9997ee7216 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/6e9997ee7216
Branch: label
Log Message:

merged with default


diffs (18 lines):

diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -1256,11 +1256,10 @@ int scanner_symbol(mvc * c, int cur)
lc->rs->buf[lc->rs->pos + lc->yycur - 2] = '<';
lc->rs->buf[lc->rs->pos + lc->yycur - 1] = '>';
return scanner_token( lc, COMPARISON);
+   } else {
+   utf8_putchar(lc, cur); //put the char back
}
-   else
-   lc->yycur--;
-   cur = '!';
-   break;
+   return scanner_token(lc, '!');
case '<':
lc->started = 1;
cur = scanner_getc(lc);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: nilmask - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 61da04a045a5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/61da04a045a5
Modified Files:
sql/backends/monet5/rel_bin.c
sql/include/sql_catalog.h
sql/storage/sql_storage.h
sql/storage/store.c
Branch: nilmask
Log Message:

merged with default


diffs (truncated from 1797 to 300 lines):

diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,10 +12,3 @@
   References to the old MonetDB5 name have been removed.  All packages
   are now just MonetDB.
 
-* Wed May  8 2024 Niels Nes 
-- Add support for select exp, count(*) group by 1 order by 1; ie. using
-  numeric references Added support for group by all and order by all. The
-  later is ordering on all columns of the selection.  The group by all
-  finds all expressions from the selections which aren't aggregations
-  and groups on those.  All can also be replaced by '*'.
-
diff --git a/clients/odbc/ChangeLog b/clients/odbc/ChangeLog
--- a/clients/odbc/ChangeLog
+++ b/clients/odbc/ChangeLog
@@ -9,7 +9,6 @@
 CERTHASH / Server Certificate Hash = sha256:HEXDIGITS
 CLIENTKEY / Client Key = PATH
 CLIENTCERT / Client Certificate = PATH
-AUTOCOMMIT / Autocommit = ON/OFF
 - Several more connection properties have been made configurable:
 SCHEMA / Schema = NAME
 TIMEZONE / Time Zone = Minutes East Of UTC
@@ -17,8 +16,10 @@
 LOGFILE / Log File = PATH
 LOGINTIMEOUT / Login Timeout = MILLISECONDS
 CONNECTIONTIMEOUT / Connection Timeout = MILLISECONDS
+AUTOCOMMIT / Autocommit = ON/OFF
 SOCK / Unix Socket = PATH (unix only)
-- SQLBrowseConnect adds On/Off suggestions to boolean settings
+- SQLBrowseConnect() adds On/Off suggestions to boolean settings
   and prioritizes the DATABASE attribute if it notices monetdbd
   requires one. Apart from that only UID/User and PWD/Password
   are required, all others have sensible defaults.
+
diff --git a/sql/ChangeLog b/sql/ChangeLog
--- a/sql/ChangeLog
+++ b/sql/ChangeLog
@@ -1,10 +1,20 @@
 # ChangeLog file for sql
 # This file is updated with Maddlog
 
-* Mon May 13 2024 Niels Nes 
+* Mon May 13 2024 Niels Nes 
 - Extended sys.generate_series() to generate dates. Added 2 new functions:
-  sys.generate_series(first date, "limit" date, stepsize interval month)
-  sys.generate_series(first date, "limit" date, stepsize interval day)
+  sys.generate_series(first date, "limit" date, stepsize interval month) and
+  sys.generate_series(first date, "limit" date, stepsize interval day).
+
+* Wed May  8 2024 Niels Nes 
+- Added support for select exp, count(*) group by 1 order by 1;
+  ie. using numeric references in group by clause.
+- Added support for GROUP BY ALL. This finds all expressions from the
+  selections which aren't aggregations and groups on those.
+  At least one aggregation must be specified.
+  The ALL keyword can also be replaced by '*', so: GROUP BY *.
+- Added support for ORDER BY ALL. This orders on all columns of the selection.
+  The ALL keyword can also be replaced by '*', so: ORDER BY *.
 
 * Thu May  2 2024 Martin van Dinther 
 - Removed the obsolete ANALYZE statement syntax options: SAMPLE nn and
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -16,6 +16,7 @@
 #include "rel_rel.h"
 #include "rel_basetable.h"
 #include "rel_exp.h"
+#include "rel_dump.h"
 #include "rel_psm.h"
 #include "rel_prop.h"
 #include "rel_select.h"
@@ -4993,6 +4994,35 @@ sql_insert_triggers(backend *be, sql_tab
return res;
 }
 
+static void
+sql_insert_check(backend *be, sql_key *key, sql_rel *inserts, list *refs)
+{
+   mvc *sql = be->mvc;
+   node *m, *n;
+
+   inserts = rel_copy(sql, inserts, 1);
+   list* exps = inserts->exps;
+
+   for (n = ol_first_node(key->t->columns), m = exps->h; n && m;
+   n = n->next, m = m->next) {
+   sql_exp *i = m->data;
+   sql_column *c = n->data;
+   i->alias.rname= sa_strdup(sql->sa, c->t->base.name);
+   i->alias.name= sa_strdup(sql->sa, c->base.name);
+   }
+
+   int pos = 0;
+   sql_rel* rel = rel_read(sql, sa_strdup(sql->sa, key->check), &pos, 
sa_list(sql->sa));
+   rel->l = inserts;
+   stmt* s = subrel_bin(be, rel, refs);
+   sql_subtype *bt = sql_bind_localtype("bit");
+   s = stmt_uselect(be, column(be, s), stmt_atom(be, 
atom_zero_value(sql->sa, bt)), cmp_equal, NULL, 0, 1);
+   sql_subfunc *cnt = sql_bind_func(sql, "sys", "count", 
sql_bind_localtype("void"), NULL, F_AGGR, true, true);
+   s = stmt_aggr(be, s, NULL, NULL, cnt, 1, 0, 1);
+   char *msg = sa_message(sql->sa, SQLSTATE(40002) "INSERT INTO: CHECK 
constraint violated: %s", key->base.name);
+   (void)stmt_exception(be, s, msg, 1);
+}
+
 static sql_table *
 sql_insert_check_null(backend *be, sql_table *t, list *inserts)
 {
@@ -5071,6 +5101,12 @@ rel2bin_insert(backend *be, sql_rel *rel

MonetDB: nilmask - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 26852a81589d for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/26852a81589d
Branch: nilmask
Log Message:

merged with default


diffs (18 lines):

diff --git a/sql/server/sql_scan.c b/sql/server/sql_scan.c
--- a/sql/server/sql_scan.c
+++ b/sql/server/sql_scan.c
@@ -1256,11 +1256,10 @@ int scanner_symbol(mvc * c, int cur)
lc->rs->buf[lc->rs->pos + lc->yycur - 2] = '<';
lc->rs->buf[lc->rs->pos + lc->yycur - 1] = '>';
return scanner_token( lc, COMPARISON);
+   } else {
+   utf8_putchar(lc, cur); //put the char back
}
-   else
-   lc->yycur--;
-   cur = '!';
-   break;
+   return scanner_token(lc, '!');
case '<':
lc->started = 1;
cur = scanner_getc(lc);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: Dec2023 - Check for nils.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 926f694c982c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/926f694c982c
Added Files:
sql/test/BugTracker-2024/Tests/7528-jarowinlkler-null.test
Modified Files:
monetdb5/modules/mal/txtsim.c
sql/test/BugTracker-2024/Tests/All
Branch: Dec2023
Log Message:

Check for nils.

Fixes #7528.


diffs (34 lines):

diff --git a/monetdb5/modules/mal/txtsim.c b/monetdb5/modules/mal/txtsim.c
--- a/monetdb5/modules/mal/txtsim.c
+++ b/monetdb5/modules/mal/txtsim.c
@@ -569,6 +569,10 @@ TXTSIMjarowinkler(dbl *res, const char *
str_item xi = { 0 }, yi = { 0 };
str msg = MAL_SUCCEED;
 
+   if (strNil(*x) || strNil(*y)) {
+   *res = dbl_nil;
+   return MAL_SUCCEED;
+   }
xi.val = *x;
xi.len = UTF8_strlen(*x);
if ((msg = str_2_codepointseq(&xi)) != MAL_SUCCEED)
diff --git a/sql/test/BugTracker-2024/Tests/7528-jarowinlkler-null.test 
b/sql/test/BugTracker-2024/Tests/7528-jarowinlkler-null.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7528-jarowinlkler-null.test
@@ -0,0 +1,7 @@
+statement ok
+CREATE TABLE t0(c1 VARCHAR)
+
+query T nosort
+SELECT * FROM t0 WHERE NOT NULL ORDER BY JAROWINKLER('a', NULL) DESC
+
+
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
@@ -55,3 +55,4 @@ field-arg-error-Bug-7506
 7511-password-hash-missing-error
 7512-concurrent-globaltmp-instantiate-crash
 7513-uri-authority-parse-issue
+7528-jarowinkler-null
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Merge with Dec2023 branch.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: b55743d2496c for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/b55743d2496c
Modified Files:
monetdb5/modules/mal/txtsim.c
sql/test/BugTracker-2024/Tests/All
Branch: default
Log Message:

Merge with Dec2023 branch.


diffs (34 lines):

diff --git a/monetdb5/modules/mal/txtsim.c b/monetdb5/modules/mal/txtsim.c
--- a/monetdb5/modules/mal/txtsim.c
+++ b/monetdb5/modules/mal/txtsim.c
@@ -592,6 +592,10 @@ TXTSIMjarowinkler(dbl *res, const char *
str_item xi = { 0 }, yi = { 0 };
str msg = MAL_SUCCEED;
 
+   if (strNil(*x) || strNil(*y)) {
+   *res = dbl_nil;
+   return MAL_SUCCEED;
+   }
xi.val = *x;
xi.len = UTF8_strlen(*x);
if ((msg = str_2_codepointseq(&xi)) != MAL_SUCCEED)
diff --git a/sql/test/BugTracker-2024/Tests/7528-jarowinlkler-null.test 
b/sql/test/BugTracker-2024/Tests/7528-jarowinlkler-null.test
new file mode 100644
--- /dev/null
+++ b/sql/test/BugTracker-2024/Tests/7528-jarowinlkler-null.test
@@ -0,0 +1,7 @@
+statement ok
+CREATE TABLE t0(c1 VARCHAR)
+
+query T nosort
+SELECT * FROM t0 WHERE NOT NULL ORDER BY JAROWINKLER('a', NULL) DESC
+
+
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
@@ -60,3 +60,4 @@ 7512-concurrent-globaltmp-instantiate-cr
 7513-uri-authority-parse-issue
 7514-wrong-window-function
 7524-right-outer-join
+7528-jarowinkler-null
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Small improvements to ODBC setup dialog

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: 65230d5ea41e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/65230d5ea41e
Modified Files:
clients/odbc/winsetup/setup.rc
Branch: default
Log Message:

Small improvements to ODBC setup dialog


diffs (50 lines):

diff --git a/clients/odbc/winsetup/setup.rc b/clients/odbc/winsetup/setup.rc
--- a/clients/odbc/winsetup/setup.rc
+++ b/clients/odbc/winsetup/setup.rc
@@ -120,26 +120,26 @@ BEGIN
 LTEXT   "Description:",IDC_STATIC,7,58,63,8
 LTEXT   "User Name:",IDC_STATIC,7,74,63,8
 LTEXT   "Password:",IDC_STATIC,7,90,63,8
-LTEXT   "Host:",IDC_STATIC,7,106,63,8
-LTEXT   "Port:",IDC_STATIC,7,122,63,8
+LTEXT   "Server Host:",IDC_STATIC,7,106,63,8
+LTEXT   "Port Number:",IDC_STATIC,7,122,63,8
 LTEXT   "Database:",IDC_STATIC,7,138,63,8
 GROUPBOX"Advanced Settings",IDC_STATIC,7,154,214,130
-LTEXT   "Schema:",IDC_STATIC,12,170,63,8
+LTEXT   "Schema Name:",IDC_STATIC,12,170,63,8
 LTEXT   "Login Timeout:",IDC_STATIC,12,186,63,8
-LTEXT   "milliseconds",IDC_STATIC,130,186,63,8
+LTEXT   "milliseconds",IDC_STATIC,128,186,63,8
 LTEXT   "Reply Timeout:",IDC_STATIC,12,202,63,8
-LTEXT   "milliseconds",IDC_STATIC,130,202,63,8
+LTEXT   "milliseconds",IDC_STATIC,128,202,63,8
 LTEXT   "Reply Size:",IDC_STATIC,12,218,63,8
 LTEXT   "Autocommit on/off:",IDC_STATIC,12,234,63,8
 LTEXT   "Time Zone:",IDC_STATIC,12,250,63,8
-LTEXT   "minutes East of UTC",IDC_STATIC,150,250,63,8
+LTEXT   "minutes East of UTC",IDC_STATIC,128,250,66,8
 LTEXT   "Log File:",IDC_STATIC,12,266,63,8
 EDITTEXTIDC_EDIT_SCHEMA,80,168,134,14,ES_AUTOHSCROLL
 EDITTEXTIDC_EDIT_LOGINTIMEOUT,80,184,44,14,ES_AUTOHSCROLL | 
ES_NUMBER
 EDITTEXTIDC_EDIT_REPLYTIMEOUT,80,200,44,14,ES_AUTOHSCROLL | 
ES_NUMBER
 EDITTEXTIDC_EDIT_REPLYSIZE,80,216,44,14,ES_AUTOHSCROLL | ES_NUMBER
 EDITTEXTIDC_EDIT_AUTOCOMMIT,80,232,24,14,ES_AUTOHSCROLL
-EDITTEXTIDC_EDIT_TIMEZONE,80,248,64,14,ES_AUTOHSCROLL
+EDITTEXTIDC_EDIT_TIMEZONE,80,248,44,14,ES_AUTOHSCROLL
 EDITTEXTIDC_EDIT_LOGFILE,80,264,134,14,ES_AUTOHSCROLL
 GROUPBOX"Secure Connection",IDC_STATIC,7,292,214,98
 LTEXT   "TLS Encrypt on/off:",IDC_STATIC,12,308,66,8
@@ -152,9 +152,9 @@ BEGIN
 EDITTEXTIDC_EDIT_SERVERCERTHASH,80,338,134,14,ES_AUTOHSCROLL
 EDITTEXTIDC_EDIT_CLIENTKEY,80,354,134,14,ES_AUTOHSCROLL
 EDITTEXTIDC_EDIT_CLIENTCERT,80,370,134,14,ES_AUTOHSCROLL
-DEFPUSHBUTTON   "OK",IDOK,7,397,50,14
-PUSHBUTTON  "Cancel",IDCANCEL,62,397,50,14
-PUSHBUTTON  "Test",IDC_BUTTON_TEST,117,397,50,14
+PUSHBUTTON  "Test",IDC_BUTTON_TEST,7,397,50,14
+DEFPUSHBUTTON   "OK",IDOK,62,397,50,14
+PUSHBUTTON  "Cancel",IDCANCEL,117,397,50,14
 PUSHBUTTON  "Help",IDC_BUTTON_HELP,172,397,50,14
 CONTROL 2000,IDC_STATIC,"Static",SS_BITMAP,0,0,240,37
 END
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Correcting the place where the validation nee...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: 80be9f8ed0ee for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/80be9f8ed0ee
Modified Files:
clients/odbc/winsetup/setup.c
Branch: default
Log Message:

Correcting the place where the validation needs to be done.


diffs (60 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
@@ -188,6 +188,18 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR
free(datap->dsn);
datap->dsn = strdup(buf);
}
+   /* validate entered string values */
+   GetDlgItemText(hwndDlg, IDC_EDIT_AUTOCOMMIT, buf, 
sizeof(buf));
+   if (strcmp("on", buf) != 0 && strcmp("off", buf) != 0) {
+   MessageBox(hwndDlg, "Autocommit must be set to 
on or off. Default is on.", NULL, MB_ICONERROR);
+   return TRUE;
+   }
+   GetDlgItemText(hwndDlg, IDC_EDIT_USETLS, buf, 
sizeof(buf));
+   if (strcmp("on", buf) != 0 && strcmp("off", buf) != 0) {
+   MessageBox(hwndDlg, "TLS Encrypt must be set to 
on or off. Default is off.", NULL, MB_ICONERROR);
+   return TRUE;
+   }
+
GetDlgItemText(hwndDlg, IDC_EDIT_DESC, buf, 
sizeof(buf));
if (datap->desc)
free(datap->desc);
@@ -265,9 +277,11 @@ DialogProc(HWND hwndDlg, UINT uMsg, WPAR
EndDialog(hwndDlg, LOWORD(wParam));
return TRUE;
case IDC_BUTTON_TEST:
+   // TODO call SQLDriverConnect()
MessageBox(hwndDlg, "Test Connection not yet 
implemented", NULL, MB_ICONERROR);
return TRUE;
case IDC_BUTTON_HELP:
+   // TODO invoke webbrowser with url to webpage decribing 
this dialog.
MessageBox(hwndDlg, "Help not yet implemented", NULL, 
MB_ICONERROR);
return TRUE;
}
@@ -486,25 +500,6 @@ ConfigDSN(HWND parent, WORD request, LPC
goto finish;
}
}
-   /* some data validation on entered strings */
-   if (data.autocommit) {
-   if (strcmp("on", data.autocommit) != 0
-&& strcmp("off", data.autocommit) != 0) {
-   rc = FALSE;
-   if (parent)
-   MessageBox(parent, "Autocommit may only be set 
to on or off.", NULL, MB_ICONERROR);
-   goto finish;
-   }
-   }
-   if (data.use_tls) {
-   if (strcmp("on", data.use_tls) != 0
-&& strcmp("off", data.use_tls) != 0) {
-   rc = FALSE;
-   if (parent)
-   MessageBox(parent, "TLS Encrypt may only be set 
to on or off.", NULL, MB_ICONERROR);
-   goto finish;
-   }
-   }
 
ODBCLOG("ConfigDSN writing values: DSN=%s UID=%s PWD=%s Host=%s Port=%s 
Database=%s Schema=%s LoginTimeout=%s ReplyTimeout=%s ReplySize=%s 
AutoCommit=%s TimeZone=%s LogFile=%s TLSs=%s Cert=%s CertHash=%s ClientKey=%s 
ClientCert=%s\n",
data.dsn ? data.dsn : "(null)",
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - In the ODBC test programs set the ODBC API ve...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: d08edd5b8bce for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d08edd5b8bce
Modified Files:
clients/odbc/tests/ODBCStmtAttr.c
clients/odbc/tests/ODBCgetInfo.c
clients/odbc/tests/ODBCmetadata.c
clients/odbc/tests/ODBCtester.c
Branch: default
Log Message:

In the ODBC test programs set the ODBC API version 3.52 we want to test.


diffs (61 lines):

diff --git a/clients/odbc/tests/ODBCStmtAttr.c 
b/clients/odbc/tests/ODBCStmtAttr.c
--- a/clients/odbc/tests/ODBCStmtAttr.c
+++ b/clients/odbc/tests/ODBCStmtAttr.c
@@ -17,6 +17,9 @@
 #include 
 #include 
 #include 
+
+/ Define the ODBC Version our ODBC driver complies with /
+#define ODBCVER 0x0352 /* Important: this must be defined before 
include of sql.h and sqlext.h */
 #include 
 #include 
 
diff --git a/clients/odbc/tests/ODBCgetInfo.c b/clients/odbc/tests/ODBCgetInfo.c
--- a/clients/odbc/tests/ODBCgetInfo.c
+++ b/clients/odbc/tests/ODBCgetInfo.c
@@ -19,10 +19,8 @@
 #include 
 #include 
 
-/ Define the ODBC Version this ODBC driver complies with /
-/* also see ODBCGlobal.h */
+/ Define the ODBC Version our ODBC driver complies with /
 #define ODBCVER 0x0352 /* Important: this must be defined before 
include of sqlext.h */
-
 #include 
 #include 
 
diff --git a/clients/odbc/tests/ODBCmetadata.c 
b/clients/odbc/tests/ODBCmetadata.c
--- a/clients/odbc/tests/ODBCmetadata.c
+++ b/clients/odbc/tests/ODBCmetadata.c
@@ -36,6 +36,8 @@
 #include 
 #include 
 #include 
+
+/ Define the ODBC Version our ODBC driver complies with /
 #define ODBCVER 0x0352 /* Important: this must be defined before 
include of sql.h and sqlext.h */
 #include 
 #include 
diff --git a/clients/odbc/tests/ODBCtester.c b/clients/odbc/tests/ODBCtester.c
--- a/clients/odbc/tests/ODBCtester.c
+++ b/clients/odbc/tests/ODBCtester.c
@@ -17,12 +17,15 @@
 #include 
 #include 
 #include 
-#include 
-#include 
 #include 
 #include 
 #include 
 
+/ Define the ODBC Version our ODBC driver complies with /
+#define ODBCVER 0x0352 /* Important: this must be defined before 
include of sql.h and sqlext.h */
+#include 
+#include 
+
 static void
 prerr(SQLSMALLINT tpe, SQLHANDLE hnd, const char *func, const char *pref)
 {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve 32 bit output.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 771567d3a287 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/771567d3a287
Modified Files:
sql/test/emptydb/Tests/check.stable.out.32bit
Branch: default
Log Message:

Approve 32 bit output.


diffs (178 lines):

diff --git a/sql/test/emptydb/Tests/check.stable.out.32bit 
b/sql/test/emptydb/Tests/check.stable.out.32bit
--- a/sql/test/emptydb/Tests/check.stable.out.32bit
+++ b/sql/test/emptydb/Tests/check.stable.out.32bit
@@ -1704,7 +1704,7 @@ select 'null in fkeys.delete_action', de
 % .%1, .s, .f, .,  .,  .f, .fl,.,  .f, .f, 
.f, .f, .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  . # table_name
 % %1,  name,   name,   system, query,  mod,language_name,  func_type,  
side_effect,varres, vararg, semantics,  comment,name0,  type0,  
type_digits0,   type_scale0,inout0, name1,  type1,  type_digits1,   
type_scale1,inout1, name2,  type2,  type_digits2,   type_scale2,inout2, 
name3,  type3,  type_digits3,   type_scale3,inout3, name4,  type4,  
type_digits4,   type_scale4,inout4, name5,  type5,  type_digits5,   
type_scale5,inout5, name6,  type6,  type_digits6,   type_scale6,inout6, 
name7,  type7,  type_digits7,   type_scale7,inout7, name8,  type8,  
type_digits8,   type_scale8,inout8, name9,  type9,  type_digits9,   
type_scale9,inout9, name10, type10, type_digits10,  type_scale10,   
inout10,name11, type11, type_digits11,  type_scale11,   inout11,
name12, type12, type_digits12,  type_scale12,   inout12,name13, type13, 
type_digits13,  type_scale13,   inout13,name14, type14, type_digits14,  
type_scale14,   inout14,name15, type15, type_digits15,  type_scale15,   
inout15 # name
 % varchar, varchar,varchar,varchar,varchar,
varchar,varchar,varchar,boolean,boolean,
boolean,boolean,varchar,varchar,varchar,
int,int,varchar,varchar,varchar,int,int,
varchar,varchar,varchar,int,int,varchar,
varchar,varchar,int,int,varchar,varchar,
varchar,int,int,varchar,varchar,varchar,
int,int,varchar,varchar,varchar,int,int,
varchar,varchar,varchar,int,int,varchar,
varchar,varchar,int,int,varchar,varchar,
varchar,int,int,varchar,varchar,varchar,
int,int,varchar,varchar,varchar,int,int,
varchar,varchar,varchar,int,int,varchar,
varchar,varchar,int,int,varchar,varchar,
varchar,int,int,varchar,varchar,varchar,
int,int,varchar # type
-% 13,  8,  37, 6,  3806,   9,  10, 26, 5,  5,  
5,  5,  0,  11, 14, 4,  1,  3,  16, 14, 
4,  1,  3,  16, 14, 4,  1,  3,  27, 12, 
4,  1,  3,  9,  9,  4,  1,  3,  14, 7,  
4,  1,  3,  12, 9,  2,  1,  3,  11, 7,  
2,  1,  3,  11, 7,  2,  1,  3,  10, 7,  
2,  1,  3,  9,  7,  2,  1,  3,  6,  7,  
1,  1,  3,  9,  7,  2,  1,  3,  6,  7,  
4,  1,  3,  9,  7,  4,  1,  3,  6,  7,  
4,  1,  3 # length
+% 13,  8,  37, 6,  3806,   9,  10, 26, 5,  5,  
5,  5,  0,  11, 14, 4,  1,  3,  16, 14, 
4,  1,  3,  16, 14, 4,  1,  3,  27, 14, 
4,  1,  3,  9,  9,  4,  1,  3,  14, 7,  
4,  1,  3,  12, 9,  2,  1,  3,  11, 7,  
2,  1,  3,  11, 7,  2,  1,  3,  10, 7,  
2,  1,  3,  9,  7,  2,  1,  3,  8,  7,  
1,  1,  3,  11, 7,  2,  1,  

MonetDB: default - Approve notint128 output.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 9bec0e3a6a90 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9bec0e3a6a90
Modified Files:
sql/test/emptydb/Tests/check.stable.out
Branch: default
Log Message:

Approve notint128 output.


diffs (169 lines):

diff --git a/sql/test/emptydb/Tests/check.stable.out 
b/sql/test/emptydb/Tests/check.stable.out
--- a/sql/test/emptydb/Tests/check.stable.out
+++ b/sql/test/emptydb/Tests/check.stable.out
@@ -1704,7 +1704,7 @@ select 'null in fkeys.delete_action', de
 % .%1, .s, .f, .,  .,  .f, .fl,.,  .f, .f, 
.f, .f, .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  .,  .,  .,  .,  .,  .,  .,  .,  
.,  .,  . # table_name
 % %1,  name,   name,   system, query,  mod,language_name,  func_type,  
side_effect,varres, vararg, semantics,  comment,name0,  type0,  
type_digits0,   type_scale0,inout0, name1,  type1,  type_digits1,   
type_scale1,inout1, name2,  type2,  type_digits2,   type_scale2,inout2, 
name3,  type3,  type_digits3,   type_scale3,inout3, name4,  type4,  
type_digits4,   type_scale4,inout4, name5,  type5,  type_digits5,   
type_scale5,inout5, name6,  type6,  type_digits6,   type_scale6,inout6, 
name7,  type7,  type_digits7,   type_scale7,inout7, name8,  type8,  
type_digits8,   type_scale8,inout8, name9,  type9,  type_digits9,   
type_scale9,inout9, name10, type10, type_digits10,  type_scale10,   
inout10,name11, type11, type_digits11,  type_scale11,   inout11,
name12, type12, type_digits12,  type_scale12,   inout12,name13, type13, 
type_digits13,  type_scale13,   inout13,name14, type14, type_digits14,  
type_scale14,   inout14,name15, type15, type_digits15,  type_scale15,   
inout15 # name
 % varchar, varchar,varchar,varchar,varchar,
varchar,varchar,varchar,boolean,boolean,
boolean,boolean,varchar,varchar,varchar,
int,int,varchar,varchar,varchar,int,int,
varchar,varchar,varchar,int,int,varchar,
varchar,varchar,int,int,varchar,varchar,
varchar,int,int,varchar,varchar,varchar,
int,int,varchar,varchar,varchar,int,int,
varchar,varchar,varchar,int,int,varchar,
varchar,varchar,int,int,varchar,varchar,
varchar,int,int,varchar,varchar,varchar,
int,int,varchar,varchar,varchar,int,int,
varchar,varchar,varchar,int,int,varchar,
varchar,varchar,int,int,varchar,varchar,
varchar,int,int,varchar,varchar,varchar,
int,int,varchar # type
-% 13,  8,  37, 6,  3806,   9,  10, 26, 5,  5,  
5,  5,  0,  11, 14, 4,  1,  3,  16, 14, 
4,  1,  3,  16, 14, 4,  1,  3,  27, 14, 
4,  1,  3,  9,  9,  4,  1,  3,  14, 7,  
4,  1,  3,  12, 9,  2,  1,  3,  11, 7,  
2,  1,  3,  11, 7,  2,  1,  3,  10, 7,  
2,  1,  3,  9,  7,  2,  1,  3,  6,  7,  
1,  1,  3,  9,  7,  2,  1,  3,  6,  7,  
4,  1,  3,  9,  7,  4,  1,  3,  6,  7,  
4,  1,  3 # length
+% 13,  8,  37, 6,  3806,   9,  10, 26, 5,  5,  
5,  5,  0,  11, 14, 4,  1,  3,  16, 14, 
4,  1,  3,  16, 14, 4,  1,  3,  27, 14, 
4,  1,  3,  9,  9,  4,  1,  3,  14, 7,  
4,  1,  3,  12, 9,  2,  1,  3,  11, 7,  
2,  1,  3,  11, 7,  2,  1,  3,  10, 7,  
2,  1,  3,  9,  7,  2,  1,  3,  8,  7,  
1,  1,  3,  11, 7,  2,  1,  3,  6,  7,  
4,

MonetDB: default - Replace mapi_set_application_name() with a ca...

2024-05-30 Thread Joeri van Ruth via checkin-list
Changeset: adafe325ac29 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/adafe325ac29
Modified Files:
clients/Tests/exports.stable.out
clients/mapiclient/mclient.c
clients/mapiclient/msqldump.c
clients/mapilib/connect.c
clients/mapilib/mapi.c
clients/mapilib/mapi.h
clients/mapilib/mapi_intern.h
tools/merovingian/daemon/snapshot.c
Branch: default
Log Message:

Replace mapi_set_application_name() with a call to get_bin_path()


diffs (134 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,7 +717,6 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
-void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,7 +3682,6 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
-   mapi_set_application_name("mclient");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -237,7 +237,6 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, "sql", dbname);
}
-   mapi_set_application_name("msqldump");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -385,6 +385,7 @@ static void
 send_all_clientinfo(Mapi mid)
 {
msettings *mp = mid->settings;
+   void *free_this = NULL;
if (!mid->clientinfo_supported)
return;
if (!msetting_bool(mp, MP_CLIENT_INFO))
@@ -398,8 +399,13 @@ send_all_clientinfo(Mapi mid)
hostname[sizeof(hostname) - 1] = '\0';
}
const char *application_name = msetting_string(mp, 
MP_CLIENT_APPLICATION);
-   if (!application_name[0])
-   application_name = mapi_application_name;
+   if (!application_name[0]) {
+   application_name = get_bin_path();
+   if (application_name) {
+   free_this = strdup(application_name);
+   application_name = (const char*) 
basename((char*)application_name);
+   }
+   }
const char *client_library = "libmapi " MONETDB_VERSION;
const char *client_remark = msetting_string(mp, MP_CLIENT_REMARK);
long pid = getpid();
@@ -425,7 +431,9 @@ send_all_clientinfo(Mapi mid)
 
if (pos <= cap)
mapi_Xcommand(mid, "clientinfo", buf);
+
free(buf);
+   free(free_this);
 }
 
 static MapiMsg
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -794,8 +794,6 @@ static void mapi_store_bind(struct MapiR
 
 static ATOMIC_FLAG mapi_initialized = ATOMIC_FLAG_INIT;
 
-char mapi_application_name[256] = { 0 };
-
 /*
  * Blocking
  * 
@@ -2121,15 +2119,6 @@ mapi_disconnect(Mapi mid)
return MOK;
 }
 
-void
-mapi_set_application_name(const char *name)
-{
-   if (name)
-   strncpy(mapi_application_name, name, 
sizeof(mapi_application_name)-1);
-   else
-   mapi_application_name[0] = '\0';
-}
-
 /* Set callback function to retrieve or send file content for COPY
  * INTO queries.
  *
diff --git a/clients/mapilib/mapi.h b/clients/mapilib/mapi.h
--- a/clients/mapilib/mapi.h
+++ b/clients/mapilib/mapi.h
@@ -76,9 +76,6 @@ extern "C" {
 # endif
 #endif
 
-/* global state */
-mapi_export void mapi_set_application_name(const char *name);
-
 /* connection-oriented functions */
 mapi_export Mapi mapi_mapi(const char *host, int port, const char *username, 
const char *password, const char *lang, const char *dbname);
 mapi_export Mapi mapi_mapiuri(const char *url, const char *user, const char 
*pass, const char *lang);
diff --git a/clients/mapilib/mapi_intern.h b/clients/mapilib/mapi_intern.h
--- a/clients/mapilib/mapi_intern.h
+++ b/clients/mapilib/mapi_intern.h
@@ -310,8 +310,6 @@ MapiMsg mapi_Xcommand(Mapi

MonetDB: default - Support clientinfo msettings from odbc

2024-05-30 Thread Joeri van Ruth via checkin-list
Changeset: f218fe31ac43 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f218fe31ac43
Modified Files:
clients/odbc/driver/ODBCAttrs.c
Branch: default
Log Message:

Support clientinfo msettings from odbc


diffs (13 lines):

diff --git a/clients/odbc/driver/ODBCAttrs.c b/clients/odbc/driver/ODBCAttrs.c
--- a/clients/odbc/driver/ODBCAttrs.c
+++ b/clients/odbc/driver/ODBCAttrs.c
@@ -47,6 +47,9 @@ const struct attr_setting attr_settings[
{ "LOGFILE", "Log File", MP_LOGFILE },
{ "LOGINTIMEOUT", "Login Timeout", MP_CONNECT_TIMEOUT},
{ "CONNECTIONTIMEOUT", "Connection Timeout", MP_REPLY_TIMEOUT},
+   { "CLIENTINFO", "Send Client Info", MP_CLIENT_INFO },
+   { "APPNAME", "Application Name", MP_CLIENT_APPLICATION },
+   { "CLIENTREMARK", "Client Remark", MP_CLIENT_REMARK },
 };
 
 const int attr_setting_count = sizeof(attr_settings) / 
sizeof(attr_settings[0]);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Mention 'ODBC' in ClientLibrary if connecting...

2024-05-30 Thread Joeri van Ruth via checkin-list
Changeset: 21bd5080c348 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/21bd5080c348
Modified Files:
clients/Tests/exports.stable.out
clients/mapilib/connect.c
clients/mapilib/mapi.c
clients/mapilib/mapi.h
clients/mapilib/mapi_intern.h
clients/odbc/driver/SQLConnect.c
Branch: default
Log Message:

Mention 'ODBC' in ClientLibrary if connecting through ODBC


diffs (96 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -721,6 +721,7 @@ MapiMsg mapi_set_columnar_protocol(Mapi 
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_timeout(Mapi mid, unsigned int timeout, bool (*callback)(void 
*), void *callback_data) __attribute__((__nonnull__(1)));
+void mapi_setclientprefix(Mapi mid, const char *prefix);
 void mapi_setfilecallback(Mapi mid, char *(*getfunc)(void *priv, const char 
*filename, bool binary, uint64_t offset, size_t *size), char *(*putfunc)(void 
*priv, const char *filename, const void *data, size_t size), void *priv) 
__attribute__((__nonnull__(1)));
 void mapi_setfilecallback2(Mapi mid, char *(*getfunc)(void *priv, const char 
*filename, bool binary, uint64_t offset, size_t *size), char *(*putfunc)(void 
*priv, const char *filename, bool binary, const void *data, size_t size), void 
*priv) __attribute__((__nonnull__(1)));
 Mapi mapi_settings(msettings *settings) __attribute__((__nonnull__(1)));
diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -406,7 +406,6 @@ send_all_clientinfo(Mapi mid)
application_name = (const char*) 
basename((char*)application_name);
}
}
-   const char *client_library = "libmapi " MONETDB_VERSION;
const char *client_remark = msetting_string(mp, MP_CLIENT_REMARK);
long pid = getpid();
 
@@ -417,7 +416,10 @@ send_all_clientinfo(Mapi mid)
reallocprintf(&buf, &pos, &cap, "ClientHostName=%s\n", 
hostname);
if (application_name[0])
reallocprintf(&buf, &pos, &cap, "ApplicationName=%s\n", 
application_name);
-   reallocprintf(&buf, &pos, &cap, "ClientLibrary=%s\n", client_library);
+   reallocprintf(&buf, &pos, &cap, "ClientLibrary=");
+   if (mid->clientprefix)
+   reallocprintf(&buf, &pos, &cap, "%s / ", mid->clientprefix);
+   reallocprintf(&buf, &pos, &cap, "libmapi %s\n", MONETDB_VERSION);
if (client_remark[0])
reallocprintf(&buf, &pos, &cap, "ClientRemark=%s\n", 
client_remark);
if (pid > 0)
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -2021,6 +2021,7 @@ mapi_destroy(Mapi mid)
free(mid->noexplain);
if (mid->errorstr && mid->errorstr != mapi_nomem)
free(mid->errorstr);
+   free(mid->clientprefix);
 
msettings_destroy(mid->settings);
 
@@ -2246,6 +2247,17 @@ mapi_setfilecallback(Mapi mid,
mid->filecontentprivate_old = filecontentprivate;
 }
 
+void
+mapi_setclientprefix(Mapi mid, const char *prefix)
+{
+   free(mid->clientprefix);
+   if (prefix == NULL)
+   mid->clientprefix = NULL;
+   else
+   mid->clientprefix = strdup(prefix);
+
+}
+
 #define testBinding(hdl,fnr)   \
do {\
mapi_hdl_check(hdl);\
diff --git a/clients/mapilib/mapi.h b/clients/mapilib/mapi.h
--- a/clients/mapilib/mapi.h
+++ b/clients/mapilib/mapi.h
@@ -105,6 +105,7 @@ mapi_export void mapi_setfilecallback(
 const void *data, size_t size),
void *priv)
__attribute__((__nonnull__(1)));
+mapi_export void mapi_setclientprefix(Mapi mid, const char *prefix);
 
 mapi_export MapiMsg mapi_error(Mapi mid)
__attribute__((__nonnull__(1)));
diff --git a/clients/mapilib/mapi_intern.h b/clients/mapilib/mapi_intern.h
--- a/clients/mapilib/mapi_intern.h
+++ b/clients/mapilib/mapi_intern.h
@@ -238,6 +238,7 @@ struct MapiStruct {
MapiMsg error;  /* Error occurred */
char *errorstr; /* error from server */
const char *action; /* pointer to constant string */
+   char *clientprefix; /* prefix for 'client' clientinfo; NULL or 
allocated string */
 
struct BlockCache blk;
bool connected;
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
@@ -481,6 +481,7 @@ MNDBConnectSettings(ODBCDbc *dbc, const 
Mapi mid = mapi_setting

MonetDB: check - Closing branch check.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 492adb4405a9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/492adb4405a9
Branch: check
Log Message:

Closing branch check.

___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: label - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: c2a94e952e57 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c2a94e952e57
Branch: label
Log Message:

merged with default


diffs (truncated from 770 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,11 +717,11 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
-void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_timeout(Mapi mid, unsigned int timeout, bool (*callback)(void 
*), void *callback_data) __attribute__((__nonnull__(1)));
+void mapi_setclientprefix(Mapi mid, const char *prefix);
 void mapi_setfilecallback(Mapi mid, char *(*getfunc)(void *priv, const char 
*filename, bool binary, uint64_t offset, size_t *size), char *(*putfunc)(void 
*priv, const char *filename, const void *data, size_t size), void *priv) 
__attribute__((__nonnull__(1)));
 void mapi_setfilecallback2(Mapi mid, char *(*getfunc)(void *priv, const char 
*filename, bool binary, uint64_t offset, size_t *size), char *(*putfunc)(void 
*priv, const char *filename, bool binary, const void *data, size_t size), void 
*priv) __attribute__((__nonnull__(1)));
 Mapi mapi_settings(msettings *settings) __attribute__((__nonnull__(1)));
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,7 +3682,6 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
-   mapi_set_application_name("mclient");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -237,7 +237,6 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, "sql", dbname);
}
-   mapi_set_application_name("msqldump");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -385,6 +385,7 @@ static void
 send_all_clientinfo(Mapi mid)
 {
msettings *mp = mid->settings;
+   void *free_this = NULL;
if (!mid->clientinfo_supported)
return;
if (!msetting_bool(mp, MP_CLIENT_INFO))
@@ -398,9 +399,13 @@ send_all_clientinfo(Mapi mid)
hostname[sizeof(hostname) - 1] = '\0';
}
const char *application_name = msetting_string(mp, 
MP_CLIENT_APPLICATION);
-   if (!application_name[0])
-   application_name = mapi_application_name;
-   const char *client_library = "libmapi " MONETDB_VERSION;
+   if (!application_name[0]) {
+   application_name = get_bin_path();
+   if (application_name) {
+   free_this = strdup(application_name);
+   application_name = (const char*) 
basename((char*)application_name);
+   }
+   }
const char *client_remark = msetting_string(mp, MP_CLIENT_REMARK);
long pid = getpid();
 
@@ -411,7 +416,10 @@ send_all_clientinfo(Mapi mid)
reallocprintf(&buf, &pos, &cap, "ClientHostName=%s\n", 
hostname);
if (application_name[0])
reallocprintf(&buf, &pos, &cap, "ApplicationName=%s\n", 
application_name);
-   reallocprintf(&buf, &pos, &cap, "ClientLibrary=%s\n", client_library);
+   reallocprintf(&buf, &pos, &cap, "ClientLibrary=");
+   if (mid->clientprefix)
+   reallocprintf(&buf, &pos, &cap, "%s / ", mid->clientprefix);
+   reallocprintf(&buf, &pos, &cap, "libmapi %s\n", MONETDB_VERSION);
if (client_remark[0])
reallocprintf(&buf, &pos, &cap, "ClientRemark=%s\n", 
client_remark);
if (pid > 0)
@@ -425,7 +433,9 @@ send_all_clientinfo(Mapi mid)
 
if (pos <= cap)
mapi_Xcommand(mid, "clientinfo", buf);
+
free(buf);
+   free(free_this);
 }
 
 static MapiMsg
diff --git a/clients/mapilib/mapi.c b/clients/mapilib/mapi.c
--- a/clients/mapilib/mapi.c
+++ b/clients/mapilib/mapi.c
@@ -794,8 +794,6 @@ static void mapi_store_bind(struct MapiR
 
 static ATOMIC_FLAG mapi_initialized = ATOMIC_FLAG_INIT

MonetDB: default - Adapt queries used in ODBC API functions SQLS...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: ee57119eba53 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/ee57119eba53
Modified Files:
clients/odbc/driver/SQLSpecialColumns.c
clients/odbc/driver/SQLStatistics.c
Branch: default
Log Message:

Adapt queries used in ODBC API functions SQLSpecialColumns() and 
SQLStatistics() to include new key_type: 3 = Unique Key With Nulls Not Distinct.


diffs (83 lines):

diff --git a/clients/odbc/driver/SQLSpecialColumns.c 
b/clients/odbc/driver/SQLSpecialColumns.c
--- a/clients/odbc/driver/SQLSpecialColumns.c
+++ b/clients/odbc/driver/SQLSpecialColumns.c
@@ -209,7 +209,7 @@ MNDBSpecialColumns(ODBCStmt *stmt,
}
 
/* construct the query */
-   querylen = 6100 + (sch ? strlen(sch) : 0) + (tab ? strlen(tab) 
: 0);
+   querylen = 6130 + (sch ? strlen(sch) : 0) + (tab ? strlen(tab) 
: 0);
query = malloc(querylen);
if (query == NULL)
goto nomem;
@@ -235,9 +235,9 @@ MNDBSpecialColumns(ODBCStmt *stmt,
"SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" = 0 "
"UNION ALL "
/* and first unique constraint of a table when table 
has no pkey */
-   "SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" = 1 "
+   "SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" IN (1, 3) "
"AND \"table_id\" NOT IN (select \"table_id\" from 
\"sys\".\"keys\" where \"type\" = 0) "
-   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"sys\".\"keys\" where \"type\" = 1 group by \"table_id\"))",
+   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"sys\".\"keys\" where \"type\" IN (1, 3) group by 
\"table_id\"))",
querylen - pos);
if (inclTmpKey) {
/* we must also include the primary key or unique 
constraint of local temporary tables which are stored in tmp.keys */
@@ -246,9 +246,9 @@ MNDBSpecialColumns(ODBCStmt *stmt,
", tmpkeys as ("
"SELECT \"id\", \"table_id\" FROM \"tmp\".\"keys\" 
WHERE \"type\" = 0 "
"UNION ALL "
-   "SELECT \"id\", \"table_id\" FROM \"tmp\".\"keys\" 
WHERE \"type\" = 1 "
+   "SELECT \"id\", \"table_id\" FROM \"tmp\".\"keys\" 
WHERE \"type\" IN (1, 3) "
"AND \"table_id\" NOT IN (select \"table_id\" from 
\"tmp\".\"keys\" where \"type\" = 0) "
-   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"tmp\".\"keys\" where \"type\" = 1 group by \"table_id\"))",
+   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"tmp\".\"keys\" where \"type\" IN (1, 3) group by 
\"table_id\"))",
querylen - pos);
}
/* 3rd cte: tableids */
@@ -310,7 +310,7 @@ MNDBSpecialColumns(ODBCStmt *stmt,
"SELECT c.\"name\", c.\"type\", c.\"type_digits\", 
c.\"type_scale\", c.\"number\" "
"FROM tableids t "
"JOIN \"sys\".\"_columns\" c ON t.\"id\" = 
c.\"table_id\" "
-   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"sys\".\"keys\" WHERE \"type\" in (0, 1))",
+   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"sys\".\"keys\" WHERE \"type\" IN (0, 1, 3))",
querylen - pos);
/* add an extra selection when SQL_NO_NULLS is requested */
if (Nullable == SQL_NO_NULLS) {
@@ -322,7 +322,7 @@ MNDBSpecialColumns(ODBCStmt *stmt,
"SELECT c.\"name\", c.\"type\", c.\"type_digits\", 
c.\"type_scale\", c.\"number\" "
"FROM tableids t "
"JOIN \"tmp\".\"_columns\" c ON t.\"id\" = 
c.\"table_id\" "
-   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"tmp\".\"keys\" WHERE \"type\" in (0, 1))",
+   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"tmp\".\"keys\" WHERE \"type\" IN (0, 1, 3))",
querylen - pos);
/* add an extra selection when SQL_NO_NULLS is 
requested */
if (Nullable == SQL_NO_NULLS) {
diff --git a/clients/odbc/driver/SQLStatistics.c 
b/clients/odbc/driver/SQLStatistics.c
--- a/clients/odbc/driver/SQLStatistics.c
+++ b/clients/odbc/driver/SQLStatistics.c
@@ -212,7 +212,7 @@ MNDBStatistics(ODBCStmt *stmt,
"join sys.schemas s on t.schema_id = s.id "
"join sys.objects kc on i.id = kc.id "
"join sys._columns c on (t.id = c.table_id and kc.name = 
c.name) "
-   "%sjoin sys.keys k on (k.name = i.name and i.table_id = 

monetdb-java: default - Adapt queries used in JDBC DatabaseMetaD...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: be8476c1acec for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java/rev/be8476c1acec
Modified Files:
src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java
Branch: default
Log Message:

Adapt queries used in JDBC DatabaseMetaData methods getBestRowIdentifier() and 
getIndexInfo() to include new key_type: 3 = Unique Key With Nulls Not Distinct.


diffs (62 lines):

diff --git a/src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java 
b/src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java
--- a/src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java
+++ b/src/main/java/org/monetdb/jdbc/MonetDatabaseMetaData.java
@@ -2452,18 +2452,18 @@ public final class MonetDatabaseMetaData
"SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" = 0 " +
"UNION ALL " +
// and first unique constraint of a table when table 
has no pkey
-   "SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" = 1 " +
+   "SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" IN (1, 3) " +
"AND \"table_id\" NOT IN (select \"table_id\" from 
\"sys\".\"keys\" where \"type\" = 0) " +
-   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"sys\".\"keys\" where \"type\" = 1 group by \"table_id\"))");
+   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"sys\".\"keys\" where \"type\" IN (1, 3) group by 
\"table_id\"))");
if (incltmpkey) {
// we must also include the primary key or unique 
constraint of local temporary tables which are stored in tmp.keys
// 2nd cte: tmpkeys
query.append(", tmpkeys as (" +
"SELECT \"id\", \"table_id\" FROM \"tmp\".\"keys\" 
WHERE \"type\" = 0 " +
"UNION ALL " +
-   "SELECT \"id\", \"table_id\" FROM \"tmp\".\"keys\" 
WHERE \"type\" = 1 " +
+   "SELECT \"id\", \"table_id\" FROM \"tmp\".\"keys\" 
WHERE \"type\" IN (1, 3) " +
"AND \"table_id\" NOT IN (select \"table_id\" from 
\"tmp\".\"keys\" where \"type\" = 0) " +
-   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"tmp\".\"keys\" where \"type\" = 1 group by \"table_id\"))");
+   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"tmp\".\"keys\" where \"type\" IN (1, 3) group by 
\"table_id\"))");
}
// 3rd cte: tableids
query.append(", tableids as (" +
@@ -2520,7 +2520,7 @@ public final class MonetDatabaseMetaData
"SELECT c.\"name\", c.\"type\", c.\"type_digits\", 
c.\"type_scale\", c.\"number\" " +
"FROM tableids t " +
"JOIN \"sys\".\"_columns\" c ON t.\"id\" = 
c.\"table_id\" " +
-   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"sys\".\"keys\" WHERE \"type\" in (0, 1))");
+   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"sys\".\"keys\" WHERE \"type\" in (0, 1, 3))");
if (!nullable) {
query.append(" AND c.\"null\" = false");
}
@@ -2529,7 +2529,7 @@ public final class MonetDatabaseMetaData
"SELECT c.\"name\", c.\"type\", c.\"type_digits\", 
c.\"type_scale\", c.\"number\" " +
"FROM tableids t " +
"JOIN \"tmp\".\"_columns\" c ON t.\"id\" = 
c.\"table_id\" " +
-   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"tmp\".\"keys\" WHERE \"type\" in (0, 1))");
+   "WHERE t.\"id\" NOT IN (SELECT \"table_id\" FROM 
\"tmp\".\"keys\" WHERE \"type\" in (0, 1, 3))");
if (!nullable) {
query.append(" AND c.\"null\" = false");
}
@@ -3230,7 +3230,7 @@ public final class MonetDatabaseMetaData
"JOIN \"sys\".\"schemas\" s ON t.\"schema_id\" = s.\"id\" " +
"JOIN \"sys\".\"objects\" o ON i.\"id\" = o.\"id\" " +
"JOIN \"sys\".\"_columns\" c ON (t.\"id\" = c.\"table_id\" AND 
o.\"name\" = c.\"name\") " +
-   "LEFT OUTER JOIN \"sys\".\"keys\" k ON (i.\"name\" = k.\"name\" 
AND i.\"table_id\" = k.\"table_id\" AND k.\"type\" IN (0,1)) ");// 
primary (0) and unique keys (1) only
+   "LEFT OUTER JOIN \"sys\".\"keys\" k ON (i.\"name\" = k.\"name\" 
AND i.\"table_id\" = k.\"table_id\" AND k.\"type\" IN (0, 1, 3)) ");// 
primary (0) and unique keys (1 or 3) only
 
if (catalog != null && !catalog.isEmpty()) {
// non-empty catalog selection.
@@ -3277,7 +3277,7 @@ public final class MonetDatabaseMetaData
   

monetdb-java: default - Adapt table DDL generator to deal with n...

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: 73f25cb71e4f for monetdb-java
URL: https://dev.monetdb.org/hg/monetdb-java/rev/73f25cb71e4f
Modified Files:
src/main/java/org/monetdb/util/SQLExporter.java
Branch: default
Log Message:

Adapt table DDL generator to deal with new UNIQUE NULLS NOT DISTINCT key_type.


diffs (17 lines):

diff --git a/src/main/java/org/monetdb/util/SQLExporter.java 
b/src/main/java/org/monetdb/util/SQLExporter.java
--- a/src/main/java/org/monetdb/util/SQLExporter.java
+++ b/src/main/java/org/monetdb/util/SQLExporter.java
@@ -216,7 +216,12 @@ public final class SQLExporter extends E
final String idxname = cols.getString(colIndexNm);
if (idxname != null && !idxname.endsWith("_pkey")) {
out.println(",");
-   out.print("\tCONSTRAINT " + dq(idxname) + " 
UNIQUE (" + dq(cols.getString(colNmIndex)));
+   out.print("\tCONSTRAINT " + dq(idxname));
+   if (idxname.endsWith("_nndunique"))
+   out.print(" UNIQUE NULLS NOT DISTINCT 
(");  // new since release 11.50 (Aug2024)
+   else
+   out.print(" UNIQUE (");
+   out.print(dq(cols.getString(colNmIndex)));
 
boolean next;
while ((next = cols.next()) && 
idxname.equals(cols.getString(colIndexNm))) {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Update comment on new key_types

2024-05-30 Thread Martin van Dinther via checkin-list
Changeset: 7c9782b7122e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/7c9782b7122e
Modified Files:
sql/scripts/10_sys_schema_extension.sql
Branch: default
Log Message:

Update comment on new key_types


diffs (12 lines):

diff --git a/sql/scripts/10_sys_schema_extension.sql 
b/sql/scripts/10_sys_schema_extension.sql
--- a/sql/scripts/10_sys_schema_extension.sql
+++ b/sql/scripts/10_sys_schema_extension.sql
@@ -399,7 +399,7 @@ CREATE TABLE sys.key_types (
 key_type_name VARCHAR(35) NOT NULL UNIQUE);
 
 -- Values taken from sql/include/sql_catalog.h see typedef enum
--- key_type: pkey, ukey, fkey.
+-- key_type: pkey, ukey, fkey, unndkey, ckey.
 INSERT INTO sys.key_types (key_type_id, key_type_name) VALUES
   (0, 'Primary Key'),
   (1, 'Unique Key'),
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Fix out-of-bounds write when loading database...

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 1aea69387a5a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1aea69387a5a
Modified Files:
sql/storage/store.c
Branch: default
Log Message:

Fix out-of-bounds write when loading database with UNIQUE NULLS NOT DISTINCT.


diffs (38 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -408,23 +408,30 @@ load_key(sql_trans *tr, sql_table *t, re
nk->columns = list_create((fdestroy) &kc_destroy);
nk->t = t;
 
-   if (ktype == ckey) {
+   switch (ktype) {
+   case ckey:
str ch = (char*)store->table_api.table_fetch_value(rt_keys, 
find_sql_column(keys, "check"));
if (!strNil(ch))
nk->check =_STRDUP(ch);
-   }
-   else if (ktype == ukey || ktype == pkey) {
+   break;
+   case ukey:
+   case unndkey:
+   case pkey: {
sql_ukey *uk = (sql_ukey *) nk;
 
if (ktype == pkey)
t->pkey = uk;
-   } else {
+   break;
+   }
+   case fkey: {
sql_fkey *fk = (sql_fkey *) nk;
int action = *(int*)store->table_api.table_fetch_value(rt_keys, 
find_sql_column(keys, "action"));
fk->on_delete = action & 255;
fk->on_update = (action>>8) & 255;
 
fk->rkey = *(sqlid*)store->table_api.table_fetch_value(rt_keys, 
find_sql_column(keys, "rkey"));
+   break;
+   }
}
 
for ( ; rt_keycols->cur_row < rt_keycols->nr_rows; 
rt_keycols->cur_row++) {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Dump UNIQUE NULLS NOT DISTINCT constraints.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 23c11a918e28 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/23c11a918e28
Modified Files:
clients/mapiclient/dump.c
Branch: default
Log Message:

Dump UNIQUE NULLS NOT DISTINCT constraints.


diffs (38 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1131,14 +1131,15 @@ dump_column_definition(Mapi mid, stream 
 "SELECT kc.name, " /* 0 */
"kc.nr, "   /* 1 */
"k.name, "  /* 2 */
-   "kc.id "/* 3 */
+   "kc.id, "   /* 3 */
+   "k.type "   /* 4 */
 "FROM sys.objects kc, "
  "sys.keys k, "
  "sys.schemas s, "
  "sys._tables t "
 "WHERE kc.id = k.id "
   "AND k.table_id = t.id "
-  "AND k.type = 1 "
+  "AND k.type in (1, 3) "
   "AND t.schema_id = s.id "
   "AND s.name = '%s' "
   "AND t.name = '%s' "
@@ -1150,6 +1151,7 @@ dump_column_definition(Mapi mid, stream 
const char *c_column = mapi_fetch_field(hdl, 0);
const char *kc_nr = mapi_fetch_field(hdl, 1);
const char *k_name = mapi_fetch_field(hdl, 2);
+   const char *k_type = mapi_fetch_field(hdl, 4);
 
if (mapi_error(mid))
goto bailout;
@@ -1161,7 +1163,7 @@ dump_column_definition(Mapi mid, stream 
mnstr_printf(sqlf, "CONSTRAINT ");
dquoted_print(sqlf, k_name, " ");
}
-   mnstr_printf(sqlf, "UNIQUE (");
+   mnstr_printf(sqlf, "UNIQUE%s (", strcmp(k_type, "1") == 
0 ? "" : " NULLS NOT DISTINCT");
cnt = 1;
} else
mnstr_printf(sqlf, ", ");
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Approve output.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: baf72dba3d7b for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/baf72dba3d7b
Modified Files:
sql/test/emptydb/Tests/check.stable.out.int128
Branch: default
Log Message:

Approve output.


diffs (137 lines):

diff --git a/sql/test/emptydb/Tests/check.stable.out.int128 
b/sql/test/emptydb/Tests/check.stable.out.int128
--- a/sql/test/emptydb/Tests/check.stable.out.int128
+++ b/sql/test/emptydb/Tests/check.stable.out.int128
@@ -5597,7 +5597,7 @@ select 'null in fkeys.delete_action', de
 % .%1, .key_types # table_name
 % %1,  key_type_name # name
 % varchar, varchar # type
-% 13,  11 # length
+% 13,  34 # length
 [ "sys.key_types", "Check Constraint"  ]
 [ "sys.key_types", "Foreign Key"   ]
 [ "sys.key_types", "Primary Key"   ]
@@ -6057,26 +6057,26 @@ select 'null in fkeys.delete_action', de
 % %237,id, id, name,   schema_id,  table_id,   
table_name, obj_type,   sys_table,  system # name
 % varchar, int,int,varchar,int,int,varchar,
varchar,varchar,boolean # type
 % 0,   1,  1,  0,  1,  1,  0,  0,  0,  5 # 
length
-% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys # table_name
-% %5,  id, id, table_id,   type,   name,   rkey,   action # name
-% varchar, int,int,int,int,varchar,int,int # 
type
-% 0,   1,  1,  1,  1,  0,  1,  1 # length
-% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys # table_name
-% %5,  table_id,   id, table_id,   type,   name,   rkey,   action 
# name
-% varchar, int,int,int,int,varchar,int,int # 
type
-% 0,   1,  1,  1,  1,  0,  1,  1 # length
-% .%13,sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys # table_name
-% %13, table_id,   id, table_id,   type,   name,   rkey,   action 
# name
-% varchar, int,int,int,int,varchar,int,int # 
type
-% 0,   1,  1,  1,  1,  0,  1,  1 # length
-% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys # table_name
-% %5,  type,   id, table_id,   type,   name,   rkey,   action # name
-% varchar, int,int,int,int,varchar,int,int # 
type
-% 0,   1,  1,  1,  1,  0,  1,  1 # length
-% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys # table_name
-% %5,  rkey,   id, table_id,   type,   name,   rkey,   action # name
-% varchar, int,int,int,int,varchar,int,int # 
type
-% 0,   1,  1,  1,  1,  0,  1,  1 # length
+% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys,   sys.keys # table_name
+% %5,  id, id, table_id,   type,   name,   rkey,   action, check # 
name
+% varchar, int,int,int,int,varchar,int,int,
varchar # type
+% 0,   1,  1,  1,  1,  0,  1,  1,  0 # length
+% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys,   sys.keys # table_name
+% %5,  table_id,   id, table_id,   type,   name,   rkey,   action, 
check # name
+% varchar, int,int,int,int,varchar,int,int,
varchar # type
+% 0,   1,  1,  1,  1,  0,  1,  1,  0 # length
+% .%13,sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys,   sys.keys # table_name
+% %13, table_id,   id, table_id,   type,   name,   rkey,   action, 
check # name
+% varchar, int,int,int,int,varchar,int,int,
varchar # type
+% 0,   1,  1,  1,  1,  0,  1,  1,  0 # length
+% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys,   sys.keys # table_name
+% %5,  type,   id, table_id,   type,   name,   rkey,   action, check # 
name
+% varchar, int,int,int,int,varchar,int,int,
varchar # type
+% 0,   1,  1,  1,  1,  0,  1,  1,  0 # length
+% .%5, sys.keys,   sys.keys,   sys.keys,   sys.keys,   
sys.keys,   sys.keys,   sys.keys,   sys.keys # table_name
+% %5,  rkey,   id, table_id,   type,   name,   rkey,   action, check # 
name
+% varchar, int,int,int,int,varchar,int,int,
varchar # type
+% 0,   1,  1,  1,  1,  0,  1, 

MonetDB: default - Add test for dumping new types of constraints.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: c05a8d7f1c39 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c05a8d7f1c39
Modified Files:
sql/test/testdb/Tests/dump-nogeom.stable.out
sql/test/testdb/Tests/dump.stable.out
sql/test/testdb/Tests/load.test
Branch: default
Log Message:

Add test for dumping new types of constraints.


diffs (65 lines):

diff --git a/sql/test/testdb/Tests/dump-nogeom.stable.out 
b/sql/test/testdb/Tests/dump-nogeom.stable.out
--- a/sql/test/testdb/Tests/dump-nogeom.stable.out
+++ b/sql/test/testdb/Tests/dump-nogeom.stable.out
@@ -101190,6 +101190,18 @@ 00
 0  1
 1  0
 1  1
+CREATE TABLE "testschema"."nulls_not_distinct" (
+   "id"  INTEGER   NOT NULL,
+   "unique1" INTEGER,
+   "unique2" INTEGER,
+   "check1"  INTEGER,
+   CONSTRAINT "nulls_not_distinct_id_pkey" PRIMARY KEY ("id"),
+   CONSTRAINT "nulls_not_distinct_unique1_unique" UNIQUE ("unique1"),
+   CONSTRAINT "nulls_not_distinct_unique2_nndunique" UNIQUE NULLS NOT 
DISTINCT ("unique2"),
+   CONSTRAINT "nulls_not_distinct_check1_check" CHECK("check1" > 0)
+);
+COPY 1 RECORDS INTO "testschema"."nulls_not_distinct" FROM stdin USING 
DELIMITERS E'\t',E'\n','"';
+1  1   1   1
 CREATE TABLE "testschema"."selfref" (
"id"   INTEGER   NOT NULL,
"parentid" INTEGER,
diff --git a/sql/test/testdb/Tests/dump.stable.out 
b/sql/test/testdb/Tests/dump.stable.out
--- a/sql/test/testdb/Tests/dump.stable.out
+++ b/sql/test/testdb/Tests/dump.stable.out
@@ -101190,6 +101190,18 @@ 00
 0  1
 1  0
 1  1
+CREATE TABLE "testschema"."nulls_not_distinct" (
+   "id"  INTEGER   NOT NULL,
+   "unique1" INTEGER,
+   "unique2" INTEGER,
+   "check1"  INTEGER,
+   CONSTRAINT "nulls_not_distinct_id_pkey" PRIMARY KEY ("id"),
+   CONSTRAINT "nulls_not_distinct_unique1_unique" UNIQUE ("unique1"),
+   CONSTRAINT "nulls_not_distinct_unique2_nndunique" UNIQUE NULLS NOT 
DISTINCT ("unique2"),
+   CONSTRAINT "nulls_not_distinct_check1_check" CHECK("check1" > 0)
+);
+COPY 1 RECORDS INTO "testschema"."nulls_not_distinct" FROM stdin USING 
DELIMITERS E'\t',E'\n','"';
+1  1   1   1
 CREATE TABLE "testschema"."selfref" (
"id"   INTEGER   NOT NULL,
"parentid" INTEGER,
diff --git a/sql/test/testdb/Tests/load.test b/sql/test/testdb/Tests/load.test
--- a/sql/test/testdb/Tests/load.test
+++ b/sql/test/testdb/Tests/load.test
@@ -101300,6 +101300,17 @@ statement ok
 comment on function keyjoin is 'function used for testing'
 
 statement ok
+create table testschema.nulls_not_distinct (
+   id integer primary key,
+   unique1 integer unique nulls distinct,
+   unique2 integer unique nulls not distinct,
+   check1 integer check (check1 > 0)
+)
+
+statement ok
+insert into testschema.nulls_not_distinct values (1, 1, 1, 1) 
+
+statement ok
 CREATE TABLE "testschema"."selfref" (
"id"   INTEGER   NOT NULL   DEFAULT next value for 
"testschema"."selfref_seq",
"parentid" INTEGER,
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - Not all systems support the basename() function.

2024-05-30 Thread Sjoerd Mullender via checkin-list
Changeset: 0491ab919c77 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0491ab919c77
Modified Files:
clients/mapilib/connect.c
Branch: default
Log Message:

Not all systems support the basename() function.


diffs (35 lines):

diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -381,6 +381,22 @@ connect_socket_tcp_addr(Mapi mid, struct
return s;
 }
 
+static const char *
+base_name(const char *file)
+{
+   char *p = strrchr(file, '/');
+#ifdef _MSC_VER
+   char *q = strrchr(file, '\\');
+   if (q != NULL) {
+   if (p == NULL || p < q)
+   p = q;
+   }
+#endif
+   if (p)
+   return p + 1;
+   return file;
+}
+
 static void
 send_all_clientinfo(Mapi mid)
 {
@@ -403,7 +419,7 @@ send_all_clientinfo(Mapi mid)
application_name = get_bin_path();
if (application_name) {
free_this = strdup(application_name);
-   application_name = (const char*) 
basename((char*)application_name);
+   application_name = base_name(application_name);
}
}
const char *client_remark = msetting_string(mp, MP_CLIENT_REMARK);
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: label - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 030f1c61a2a5 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/030f1c61a2a5
Branch: label
Log Message:

merged with default


diffs (truncated from 408 to 300 lines):

diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1131,14 +1131,15 @@ dump_column_definition(Mapi mid, stream 
 "SELECT kc.name, " /* 0 */
"kc.nr, "   /* 1 */
"k.name, "  /* 2 */
-   "kc.id "/* 3 */
+   "kc.id, "   /* 3 */
+   "k.type "   /* 4 */
 "FROM sys.objects kc, "
  "sys.keys k, "
  "sys.schemas s, "
  "sys._tables t "
 "WHERE kc.id = k.id "
   "AND k.table_id = t.id "
-  "AND k.type = 1 "
+  "AND k.type in (1, 3) "
   "AND t.schema_id = s.id "
   "AND s.name = '%s' "
   "AND t.name = '%s' "
@@ -1150,6 +1151,7 @@ dump_column_definition(Mapi mid, stream 
const char *c_column = mapi_fetch_field(hdl, 0);
const char *kc_nr = mapi_fetch_field(hdl, 1);
const char *k_name = mapi_fetch_field(hdl, 2);
+   const char *k_type = mapi_fetch_field(hdl, 4);
 
if (mapi_error(mid))
goto bailout;
@@ -1161,7 +1163,7 @@ dump_column_definition(Mapi mid, stream 
mnstr_printf(sqlf, "CONSTRAINT ");
dquoted_print(sqlf, k_name, " ");
}
-   mnstr_printf(sqlf, "UNIQUE (");
+   mnstr_printf(sqlf, "UNIQUE%s (", strcmp(k_type, "1") == 
0 ? "" : " NULLS NOT DISTINCT");
cnt = 1;
} else
mnstr_printf(sqlf, ", ");
diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -381,6 +381,22 @@ connect_socket_tcp_addr(Mapi mid, struct
return s;
 }
 
+static const char *
+base_name(const char *file)
+{
+   char *p = strrchr(file, '/');
+#ifdef _MSC_VER
+   char *q = strrchr(file, '\\');
+   if (q != NULL) {
+   if (p == NULL || p < q)
+   p = q;
+   }
+#endif
+   if (p)
+   return p + 1;
+   return file;
+}
+
 static void
 send_all_clientinfo(Mapi mid)
 {
@@ -403,7 +419,7 @@ send_all_clientinfo(Mapi mid)
application_name = get_bin_path();
if (application_name) {
free_this = strdup(application_name);
-   application_name = (const char*) 
basename((char*)application_name);
+   application_name = base_name(application_name);
}
}
const char *client_remark = msetting_string(mp, MP_CLIENT_REMARK);
diff --git a/clients/odbc/driver/SQLSpecialColumns.c 
b/clients/odbc/driver/SQLSpecialColumns.c
--- a/clients/odbc/driver/SQLSpecialColumns.c
+++ b/clients/odbc/driver/SQLSpecialColumns.c
@@ -209,7 +209,7 @@ MNDBSpecialColumns(ODBCStmt *stmt,
}
 
/* construct the query */
-   querylen = 6100 + (sch ? strlen(sch) : 0) + (tab ? strlen(tab) 
: 0);
+   querylen = 6130 + (sch ? strlen(sch) : 0) + (tab ? strlen(tab) 
: 0);
query = malloc(querylen);
if (query == NULL)
goto nomem;
@@ -235,9 +235,9 @@ MNDBSpecialColumns(ODBCStmt *stmt,
"SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" = 0 "
"UNION ALL "
/* and first unique constraint of a table when table 
has no pkey */
-   "SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" = 1 "
+   "SELECT \"id\", \"table_id\" FROM \"sys\".\"keys\" 
WHERE \"type\" IN (1, 3) "
"AND \"table_id\" NOT IN (select \"table_id\" from 
\"sys\".\"keys\" where \"type\" = 0) "
-   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"sys\".\"keys\" where \"type\" = 1 group by \"table_id\"))",
+   "AND (\"table_id\", \"id\") IN (select \"table_id\", 
min(\"id\") from \"sys\".\"keys\" where \"type\" IN (1, 3) group by 
\"table_id\"))",
querylen - pos);
if (inclTmpKey) {
/* we must also include the primary key or unique 
constraint of local temporary tables which are

MonetDB: balanced_union - use mat.packIncrement to create multi ...

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 27118ee8afe4 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/27118ee8afe4
Modified Files:
monetdb5/optimizer/opt_support.c
sql/backends/monet5/rel_bin.c
sql/backends/monet5/sql_statement.c
sql/backends/monet5/sql_statement.h
sql/test/remote/Tests/partition_elim.test
sql/test/remote/Tests/remote_info_missing.test
Branch: balanced_union
Log Message:

use mat.packIncrement to create multi unions


diffs (194 lines):

diff --git a/monetdb5/optimizer/opt_support.c b/monetdb5/optimizer/opt_support.c
--- a/monetdb5/optimizer/opt_support.c
+++ b/monetdb5/optimizer/opt_support.c
@@ -264,6 +264,8 @@ isUpdateInstruction(InstrPtr p)
&& (getFunctionId(p) == appendRef || getFunctionId(p) == 
replaceRef
|| getFunctionId(p) == deleteRef))
return TRUE;
+   if (getModuleId(p) == matRef)
+   return TRUE;
return FALSE;
 }
 
diff --git a/sql/backends/monet5/rel_bin.c b/sql/backends/monet5/rel_bin.c
--- a/sql/backends/monet5/rel_bin.c
+++ b/sql/backends/monet5/rel_bin.c
@@ -3877,7 +3877,7 @@ rel2bin_munion(backend *be, sql_rel *rel
list *l, *rstmts;
node *n, *m;
stmt *rel_stmt = NULL, *sub;
-   int i, len = 0;
+   int i, len = 0, nr_unions = list_length((list*)rel->l);
 
/* convert to stmt and store the munion operands in rstmts list */
rstmts = sa_list(sql->sa);
@@ -3904,13 +3904,13 @@ rel2bin_munion(backend *be, sql_rel *rel
const char *rnme = table_name(sql->sa, s);
const char *nme = column_name(sql->sa, s);
/* create a const column also from the first stmt */
-   s = create_const_column(be, s);
+   s = stmt_pack(be, column(be, s), nr_unions);
/* for every other rstmt */
for (m = rstmts->h->next; m; m = m->next) {
stmt *t = list_fetch(((stmt*)m->data)->op4.lval, i);
-   if ( t == NULL)
+   if (t == NULL)
return NULL;
-   s = stmt_append(be, s, t);
+   s = stmt_pack_add(be, s, column(be, t));
if (s == NULL)
return NULL;
}
diff --git a/sql/backends/monet5/sql_statement.c 
b/sql/backends/monet5/sql_statement.c
--- a/sql/backends/monet5/sql_statement.c
+++ b/sql/backends/monet5/sql_statement.c
@@ -3447,6 +3447,78 @@ stmt_append_bulk(backend *be, stmt *c, l
 }
 
 stmt *
+stmt_pack(backend *be, stmt *c, int n)
+{
+   MalBlkPtr mb = be->mb;
+   InstrPtr q = NULL;
+
+   if (c == NULL || c->nr < 0)
+   goto bailout;
+   q = newStmtArgs(mb, matRef, packIncrementRef, 3);
+   if (q == NULL)
+   goto bailout;
+   q = pushArgument(mb, q, c->nr);
+   q = pushInt(mb, q, n);
+   bool enabled = be->mvc->sa->eb.enabled;
+   be->mvc->sa->eb.enabled = false;
+   stmt *s = stmt_create(be->mvc->sa, st_append);
+   be->mvc->sa->eb.enabled = enabled;
+   if(!s) {
+   freeInstruction(q);
+   goto bailout;
+   }
+   s->op1 = c;
+   s->nrcols = c->nrcols;
+   s->key = c->key;
+   s->nr = getDestVar(q);
+   s->q = q;
+   pushInstruction(mb, q);
+   return s;
+
+  bailout:
+   if (be->mvc->sa->eb.enabled)
+   eb_error(&be->mvc->sa->eb, be->mvc->errstr[0] ? be->mvc->errstr 
: mb->errors ? mb->errors : *GDKerrbuf ? GDKerrbuf : "out of memory", 1000);
+   return NULL;
+
+}
+
+stmt *
+stmt_pack_add(backend *be, stmt *c, stmt *a)
+{
+   MalBlkPtr mb = be->mb;
+   InstrPtr q = NULL;
+
+   if (c == NULL || a == NULL || c->nr < 0 || a->nr < 0)
+   goto bailout;
+   q = newStmtArgs(mb, matRef, packIncrementRef, 3);
+   if (q == NULL)
+   goto bailout;
+   q = pushArgument(mb, q, c->nr);
+   q = pushArgument(mb, q, a->nr);
+   bool enabled = be->mvc->sa->eb.enabled;
+   be->mvc->sa->eb.enabled = false;
+   stmt *s = stmt_create(be->mvc->sa, st_append);
+   be->mvc->sa->eb.enabled = enabled;
+   if(!s) {
+   freeInstruction(q);
+   goto bailout;
+   }
+   s->op1 = c;
+   s->op2 = a;
+   s->nrcols = c->nrcols;
+   s->key = c->key;
+   s->nr = getDestVar(q);
+   s->q = q;
+   pushInstruction(mb, q);
+   return s;
+
+  bailout:
+   if (be->mvc->sa->eb.enabled)
+   eb_error(&be->mvc->sa->eb, be->mvc->errstr[0] ? be->mvc->errstr 
: mb->errors ? mb->errors : *GDKerrbuf ? GDKerrbuf : "out of memory", 1000);
+   return NULL;
+}
+
+stmt *
 stmt_claim(backend *be, sql_table *t, stmt *cnt)
 {
MalBlkPtr mb = be->mb;
diff --git a/sql/backends/monet5/sql_statement.h 
b/sql/backends/monet5/sql_statement.h
--- a/sql/backends/monet5/sql_statement.h
+++ b/sql/backends/monet5/sql_stat

MonetDB: balanced_union - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 9f4fbec3b181 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/9f4fbec3b181
Modified Files:
sql/test/emptydb/Tests/check.stable.out.int128
Branch: balanced_union
Log Message:

merged with default


diffs (truncated from 1181 to 300 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -717,11 +717,11 @@ int64_t mapi_rows_affected(MapiHdl hdl) 
 MapiMsg mapi_seek_row(MapiHdl hdl, int64_t rowne, int whence) 
__attribute__((__nonnull__(1)));
 MapiHdl mapi_send(Mapi mid, const char *cmd) __attribute__((__nonnull__(1)));
 MapiMsg mapi_setAutocommit(Mapi mid, bool autocommit) 
__attribute__((__nonnull__(1)));
-void mapi_set_application_name(const char *name);
 MapiMsg mapi_set_columnar_protocol(Mapi mid, bool columnar_protocol) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_size_header(Mapi mid, bool value) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_time_zone(Mapi mid, int seconds_east_of_utc) 
__attribute__((__nonnull__(1)));
 MapiMsg mapi_set_timeout(Mapi mid, unsigned int timeout, bool (*callback)(void 
*), void *callback_data) __attribute__((__nonnull__(1)));
+void mapi_setclientprefix(Mapi mid, const char *prefix);
 void mapi_setfilecallback(Mapi mid, char *(*getfunc)(void *priv, const char 
*filename, bool binary, uint64_t offset, size_t *size), char *(*putfunc)(void 
*priv, const char *filename, const void *data, size_t size), void *priv) 
__attribute__((__nonnull__(1)));
 void mapi_setfilecallback2(Mapi mid, char *(*getfunc)(void *priv, const char 
*filename, bool binary, uint64_t offset, size_t *size), char *(*putfunc)(void 
*priv, const char *filename, bool binary, const void *data, size_t size), void 
*priv) __attribute__((__nonnull__(1)));
 Mapi mapi_settings(msettings *settings) __attribute__((__nonnull__(1)));
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -1131,14 +1131,15 @@ dump_column_definition(Mapi mid, stream 
 "SELECT kc.name, " /* 0 */
"kc.nr, "   /* 1 */
"k.name, "  /* 2 */
-   "kc.id "/* 3 */
+   "kc.id, "   /* 3 */
+   "k.type "   /* 4 */
 "FROM sys.objects kc, "
  "sys.keys k, "
  "sys.schemas s, "
  "sys._tables t "
 "WHERE kc.id = k.id "
   "AND k.table_id = t.id "
-  "AND k.type = 1 "
+  "AND k.type in (1, 3) "
   "AND t.schema_id = s.id "
   "AND s.name = '%s' "
   "AND t.name = '%s' "
@@ -1150,6 +1151,7 @@ dump_column_definition(Mapi mid, stream 
const char *c_column = mapi_fetch_field(hdl, 0);
const char *kc_nr = mapi_fetch_field(hdl, 1);
const char *k_name = mapi_fetch_field(hdl, 2);
+   const char *k_type = mapi_fetch_field(hdl, 4);
 
if (mapi_error(mid))
goto bailout;
@@ -1161,7 +1163,7 @@ dump_column_definition(Mapi mid, stream 
mnstr_printf(sqlf, "CONSTRAINT ");
dquoted_print(sqlf, k_name, " ");
}
-   mnstr_printf(sqlf, "UNIQUE (");
+   mnstr_printf(sqlf, "UNIQUE%s (", strcmp(k_type, "1") == 
0 ? "" : " NULLS NOT DISTINCT");
cnt = 1;
} else
mnstr_printf(sqlf, ", ");
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -3682,7 +3682,6 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, language, dbname);
}
-   mapi_set_application_name("mclient");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -237,7 +237,6 @@ main(int argc, char **argv)
} else {
mid = mapi_mapi(host, port, user, passwd, "sql", dbname);
}
-   mapi_set_application_name("msqldump");
free(user_allocated);
user_allocated = NULL;
free(passwd_allocated);
diff --git a/clients/mapilib/connect.c b/clients/mapilib/connect.c
--- a/clients/mapilib/connect.c
+++ b/clients/mapilib/connect.c
@@ -381,10 +381,27 @@ connect_socket_tcp_addr(Ma

MonetDB: default - fix compilation, no declarations in switch/ca...

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 4f01106a2cb8 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/4f01106a2cb8
Modified Files:
sql/storage/store.c
Branch: default
Log Message:

fix compilation, no declarations in switch/case statements


diffs (17 lines):

diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -409,11 +409,11 @@ load_key(sql_trans *tr, sql_table *t, re
nk->t = t;
 
switch (ktype) {
-   case ckey:
+   case ckey: {
str ch = (char*)store->table_api.table_fetch_value(rt_keys, 
find_sql_column(keys, "check"));
if (!strNil(ch))
nk->check =_STRDUP(ch);
-   break;
+   }   break;
case ukey:
case unndkey:
case pkey: {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - add LIBMAPI to cmake compile options of mutil...

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 1578ec86496f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1578ec86496f
Modified Files:
common/utils/CMakeLists.txt
Branch: default
Log Message:

add LIBMAPI to cmake compile options of mutils. (we could remove those from the 
static libs!!)


diffs (11 lines):

diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -34,6 +34,7 @@ target_link_libraries(mutils
 target_compile_definitions(mutils PRIVATE
   LIBMUTILS
   LIBGDK
+  LIBMAPI
   LIBMEROUTIL)
 
 set_target_properties(mutils
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: label - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: e770355f40e2 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/e770355f40e2
Branch: label
Log Message:

merged with default


diffs (28 lines):

diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -34,6 +34,7 @@ target_link_libraries(mutils
 target_compile_definitions(mutils PRIVATE
   LIBMUTILS
   LIBGDK
+  LIBMAPI
   LIBMEROUTIL)
 
 set_target_properties(mutils
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -409,11 +409,11 @@ load_key(sql_trans *tr, sql_table *t, re
nk->t = t;
 
switch (ktype) {
-   case ckey:
+   case ckey: {
str ch = (char*)store->table_api.table_fetch_value(rt_keys, 
find_sql_column(keys, "check"));
if (!strNil(ch))
nk->check =_STRDUP(ch);
-   break;
+   }   break;
case ukey:
case unndkey:
case pkey: {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: balanced_union - merged with default

2024-05-30 Thread Niels Nes via checkin-list
Changeset: 1bc54d4a99ea for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/1bc54d4a99ea
Branch: balanced_union
Log Message:

merged with default


diffs (28 lines):

diff --git a/common/utils/CMakeLists.txt b/common/utils/CMakeLists.txt
--- a/common/utils/CMakeLists.txt
+++ b/common/utils/CMakeLists.txt
@@ -34,6 +34,7 @@ target_link_libraries(mutils
 target_compile_definitions(mutils PRIVATE
   LIBMUTILS
   LIBGDK
+  LIBMAPI
   LIBMEROUTIL)
 
 set_target_properties(mutils
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -409,11 +409,11 @@ load_key(sql_trans *tr, sql_table *t, re
nk->t = t;
 
switch (ktype) {
-   case ckey:
+   case ckey: {
str ch = (char*)store->table_api.table_fetch_value(rt_keys, 
find_sql_column(keys, "check"));
if (!strNil(ch))
nk->check =_STRDUP(ch);
-   break;
+   }   break;
case ukey:
case unndkey:
case pkey: {
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org


MonetDB: default - add missing exception in the mutils.h file fo...

2024-05-30 Thread Niels Nes via checkin-list
Changeset: f308ba3e2015 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/f308ba3e2015
Modified Files:
common/utils/mutils.h
Branch: default
Log Message:

add missing exception in the mutils.h file for libmapi


diffs (12 lines):

diff --git a/common/utils/mutils.h b/common/utils/mutils.h
--- a/common/utils/mutils.h
+++ b/common/utils/mutils.h
@@ -14,7 +14,7 @@
 #define _MUTILS_H_
 
 #ifdef WIN32
-#if !defined(LIBMUTILS) && !defined(LIBGDK) && !defined(LIBMEROUTIL)
+#if !defined(LIBMUTILS) && !defined(LIBGDK) && !defined(LIBMEROUTIL) && 
!defined(LIBMAPI)
 #define mutils_export extern __declspec(dllimport)
 #else
 #define mutils_export extern __declspec(dllexport)
___
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org