Changeset: 7479457248d3 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/7479457248d3 Branch: geo-update Log Message:
Merges with default diffs (263 lines): diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c --- a/clients/mapiclient/mclient.c +++ b/clients/mapiclient/mclient.c @@ -2855,8 +2855,10 @@ doFile(Mapi mid, stream *fp, bool useins mnstr_printf(toConsole, "none\n"); break; } - } else + } else { setFormatter(line); + mapi_set_size_header(mid, strcmp(line, "raw") == 0); + } continue; case 't': while (my_isspace(line[length - 1])) @@ -3569,12 +3571,15 @@ main(int argc, char **argv) mapi_trace(mid, trace); if (output) { setFormatter(output); + mapi_set_size_header(mid, strcmp(output, "raw") == 0); free(output); } else { if (mode == SQL) { setFormatter("sql"); + mapi_set_size_header(mid, false); } else { setFormatter("raw"); + mapi_set_size_header(mid, true); } } /* give the user a welcome message with some general info */ 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 @@ -39,34 +39,6 @@ #endif static void -set_timezone(Mapi mid) -{ - char buf[128]; - time_t t, lt, gt; - struct tm *tmp; - long tzone; - MapiHdl hdl; - - /* figure out our current timezone */ - t = time(NULL); - tmp = gmtime(&t); - gt = mktime(tmp); - tmp = localtime(&t); - lt = mktime(tmp); - tzone = (long) (gt - lt); - if (tzone < 0) - snprintf(buf, sizeof(buf), - "SET TIME ZONE INTERVAL '+%02ld:%02ld' HOUR TO MINUTE", - -tzone / 3600, (-tzone % 3600) / 60); - else - snprintf(buf, sizeof(buf), - "SET TIME ZONE INTERVAL '-%02ld:%02ld' HOUR TO MINUTE", - tzone / 3600, (tzone % 3600) / 60); - if ((hdl = mapi_query(mid, buf)) != NULL) - mapi_close_handle(hdl); -} - -static void get_serverinfo(ODBCDbc *dbc) { MapiHdl hdl; @@ -263,7 +235,12 @@ MNDBConnect(ODBCDbc *dbc, /* connect to a server on host via port */ /* FIXME: use dbname from ODBC connect string/options here */ - mid = mapi_connect(host, port, uid, pwd, "sql", dbname); + mid = mapi_mapi(host, port, uid, pwd, "sql", dbname); + if (mid) { + mapi_setAutocommit(mid, dbc->sql_attr_autocommit == SQL_AUTOCOMMIT_ON); + mapi_set_size_header(mid, true); + mapi_reconnect(mid); + } if (mid == NULL || mapi_error(mid)) { /* Client unable to establish connection */ addDbcError(dbc, "08001", NULL, 0); @@ -294,10 +271,7 @@ MNDBConnect(ODBCDbc *dbc, if (dbc->dbname != NULL) free(dbc->dbname); dbc->dbname = (char *) dbname; /* discard const */ - mapi_setAutocommit(mid, dbc->sql_attr_autocommit == SQL_AUTOCOMMIT_ON); - set_timezone(mid); get_serverinfo(dbc); - mapi_set_size_header(mid, true); /* set timeout after we're connected */ mapi_timeout(mid, dbc->sql_attr_connection_timeout * 1000); } diff --git a/sql/backends/monet5/sql_scenario.c b/sql/backends/monet5/sql_scenario.c --- a/sql/backends/monet5/sql_scenario.c +++ b/sql/backends/monet5/sql_scenario.c @@ -287,7 +287,7 @@ SQLprepareClient(Client c, int login) } m->reply_size = value; } else if (sscanf(tok, "size_header=%d", &value) == 1) { - be->sizeheader = value != 0; + be->sizeheader = value != 0; } else if (sscanf(tok, "columnar_protocol=%d", &value) == 1) { c->protocol = (value != 0) ? PROTOCOL_COLUMNAR : PROTOCOL_9; } else if (sscanf(tok, "time_zone=%d", &value) == 1) { diff --git a/sql/server/rel_dump.c b/sql/server/rel_dump.c --- a/sql/server/rel_dump.c +++ b/sql/server/rel_dump.c @@ -1466,13 +1466,13 @@ exp_read(mvc *sql, sql_rel *lrel, sql_re unsigned int digits = (lt->digits > rt->digits) ? lt->digits : rt->digits; #ifdef HAVE_HGE - if (res->type->radix == 10 && digits > 39) - digits = 39; + if (res->type->radix == 10 && digits > 38) + digits = 38; if (res->type->radix == 2 && digits > 128) digits = 128; #else - if (res->type->radix == 10 && digits > 19) - digits = 19; + if (res->type->radix == 10 && digits > 18) + digits = 18; if (res->type->radix == 2 && digits > 64) digits = 64; #endif diff --git a/sql/server/rel_exp.c b/sql/server/rel_exp.c --- a/sql/server/rel_exp.c +++ b/sql/server/rel_exp.c @@ -1397,7 +1397,7 @@ exp_match_exp( sql_exp *e1, sql_exp *e2) case e_atom: if (e1->l && e2->l && !atom_cmp(e1->l, e2->l)) return 1; - if (e1->f && e2->f && exp_match_list(e1->f, e2->f)) + if (e1->f && e2->f && exps_equal(e1->f, e2->f)) return 1; if (e1->r && e2->r && e1->flag == e2->flag && !subtype_cmp(&e1->tpe, &e2->tpe)) { sql_var_name *v1 = (sql_var_name*) e1->r, *v2 = (sql_var_name*) e2->r; @@ -2909,13 +2909,13 @@ exp_scale_algebra(mvc *sql, sql_subfunc /* HACK alert: digits should be less than max */ #ifdef HAVE_HGE - if (res->type->radix == 10 && digits > 39) - digits = 39; + if (res->type->radix == 10 && digits > 38) + digits = 38; if (res->type->radix == 2 && digits > 128) digits = 128; #else - if (res->type->radix == 10 && digits > 19) - digits = 19; + if (res->type->radix == 10 && digits > 18) + digits = 18; if (res->type->radix == 2 && digits > 64) digits = 64; #endif @@ -2946,8 +2946,8 @@ exp_sum_scales(sql_subfunc *f, sql_exp * /* HACK alert: digits should be less than max */ #ifdef HAVE_HGE - if (ares->type.type->radix == 10 && res->digits > 39) { - res->digits = 39; + if (ares->type.type->radix == 10 && res->digits > 38) { + res->digits = 38; res->scale = MIN(res->scale, res->digits - 1); } if (ares->type.type->radix == 2 && res->digits > 128) { @@ -2955,8 +2955,8 @@ exp_sum_scales(sql_subfunc *f, sql_exp * res->scale = MIN(res->scale, res->digits - 1); } #else - if (ares->type.type->radix == 10 && res->digits > 19) { - res->digits = 19; + if (ares->type.type->radix == 10 && res->digits > 18) { + res->digits = 18; res->scale = MIN(res->scale, res->digits - 1); } if (ares->type.type->radix == 2 && res->digits > 64) { @@ -3369,4 +3369,3 @@ list_find_exp( list *exps, sql_exp *e) return ne; return NULL; } - diff --git a/sql/server/sql_semantic.c b/sql/server/sql_semantic.c --- a/sql/server/sql_semantic.c +++ b/sql/server/sql_semantic.c @@ -1071,11 +1071,11 @@ result_datatype(sql_subtype *super, sql_ if (l->type->radix == 10 && r->type->radix == 10) { digits = scale + (sql_max(l->digits - l->scale, r->digits - r->scale)); #ifdef HAVE_HGE - if (digits > 39) { - digits = 39; + if (digits > 38) { + digits = 38; #else - if (digits > 19) { - digits = 19; + if (digits > 18) { + digits = 18; #endif scale = MIN(scale, digits - 1); } diff --git a/sql/test/BugTracker-2022/Tests/All b/sql/test/BugTracker-2022/Tests/All --- a/sql/test/BugTracker-2022/Tests/All +++ b/sql/test/BugTracker-2022/Tests/All @@ -17,3 +17,4 @@ temp-table-create-index-drop-issue dependencies.Bug-7328 multi-column-filters-k2-unique.Bug-7303 multi-column-filters-k2-is-1.Bug-7303 +values.Bug-7336 diff --git a/sql/test/BugTracker-2022/Tests/values.Bug-7336.test b/sql/test/BugTracker-2022/Tests/values.Bug-7336.test new file mode 100644 --- /dev/null +++ b/sql/test/BugTracker-2022/Tests/values.Bug-7336.test @@ -0,0 +1,12 @@ +query IIR nosort +select a,b,c +from (values (10, 20, 0.5), + (20, 10, 0.5) +) as (a,b,c) +---- +10 +20 +0.500 +20 +10 +0.500 diff --git a/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py b/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py --- a/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py +++ b/sql/test/concurrent/Tests/many-concurrent-client-connections.SQL.py @@ -1,7 +1,7 @@ import os, pymonetdb from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor -if os.uname().sysname == 'Linux': +if os.name == 'posix' and os.uname().sysname == 'Linux': executor = ProcessPoolExecutor else: executor = ThreadPoolExecutor diff --git a/sql/test/concurrent/Tests/read-segment-after-free.SQL.py b/sql/test/concurrent/Tests/read-segment-after-free.SQL.py --- a/sql/test/concurrent/Tests/read-segment-after-free.SQL.py +++ b/sql/test/concurrent/Tests/read-segment-after-free.SQL.py @@ -3,7 +3,7 @@ from concurrent.futures import ProcessPo import time from pymonetdb.exceptions import OperationalError -if os.uname().sysname == 'Linux': +if os.name == 'posix' and os.uname().sysname == 'Linux': executor = ProcessPoolExecutor else: executor = ThreadPoolExecutor diff --git a/sql/test/mapi/Tests/utf8test.SQL.py b/sql/test/mapi/Tests/utf8test.SQL.py --- a/sql/test/mapi/Tests/utf8test.SQL.py +++ b/sql/test/mapi/Tests/utf8test.SQL.py @@ -26,6 +26,7 @@ expectraw = f'''% sys.utf8test # table_n % s # name % varchar # type % 32 # length +% 50 0 # typesizes [ "{text1}"\t] [ "{text2}"\t] ''' _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org