Changeset: f4ea8769ee4e for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/f4ea8769ee4e Modified Files: sql/backends/monet5/sql_upgrades.c sql/server/rel_select.c sql/storage/store.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 testing/Mtest.py.in Branch: default Log Message:
Merge with Aug2024 branch. diffs (truncated from 3368 to 300 lines): diff --git a/clients/examples/C/streamcat.c b/clients/examples/C/streamcat.c --- a/clients/examples/C/streamcat.c +++ b/clients/examples/C/streamcat.c @@ -422,7 +422,7 @@ opener_rstream(char *filename) { stream *s = open_rstream(filename); if (!mnstr_isbinary(s)) - croak(2, "open_rastream returned binary stream"); + croak(2, "open_rstream returned text stream"); return s; } 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 @@ -50,6 +50,7 @@ const struct attr_setting attr_settings[ { "CLIENTINFO", "Send Client Info", MP_CLIENT_INFO }, { "APPNAME", "Application Name", MP_CLIENT_APPLICATION }, { "CLIENTREMARK", "Client Remark", MP_CLIENT_REMARK }, + { "MAPTOLONGVARCHAR", NULL, MP_MAPTOLONGVARCHAR }, }; const int attr_setting_count = sizeof(attr_settings) / sizeof(attr_settings[0]); diff --git a/clients/odbc/driver/ODBCDbc.c b/clients/odbc/driver/ODBCDbc.c --- a/clients/odbc/driver/ODBCDbc.c +++ b/clients/odbc/driver/ODBCDbc.c @@ -80,7 +80,6 @@ newODBCDbc(ODBCEnv *env) *dbc = (ODBCDbc) { .Env = env, .settings = settings, - .sql_attr_autocommit = SQL_AUTOCOMMIT_ON, /* default is autocommit */ .sql_attr_metadata_id = SQL_FALSE, /* add this dbc to start of the administrative linked dbc list */ .next = env->FirstDbc, diff --git a/clients/odbc/driver/ODBCDbc.h b/clients/odbc/driver/ODBCDbc.h --- a/clients/odbc/driver/ODBCDbc.h +++ b/clients/odbc/driver/ODBCDbc.h @@ -59,7 +59,6 @@ typedef struct tODBCDRIVERDBC { bool allow_hugeint; /* whether the application deals with HUGEINT */ bool raw_strings; /* server uses raw strings */ int mapToLongVarchar; /* when > 0 we map WVARCHAR to WLONGVARCHAR, default 0 */ - SQLUINTEGER sql_attr_autocommit; SQLUINTEGER sql_attr_metadata_id; /* MonetDB connection handle & status information */ @@ -142,19 +141,10 @@ ODBCError *getDbcError(ODBCDbc *dbc); void destroyODBCDbc(ODBCDbc *dbc); int ODBCGetKeyAttr(const SQLCHAR **conn, SQLSMALLINT *nconn, char **key, char **attr); -SQLRETURN ODBCConnectionString(SQLRETURN rc, ODBCDbc *dbc, - SQLCHAR *OutConnectionString, - SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength2Ptr, - const char *dsn, const char *uid, - const char *pwd, const char *host, - int port, const char *database, - int mapToLongVarchar); SQLRETURN MNDBAllocStmt(ODBCDbc *dbc, SQLHANDLE *pnOutputHandle); SQLRETURN MNDBConnect(ODBCDbc *dbc, const SQLCHAR *szDataSource, SQLSMALLINT nDataSourceLength, const SQLCHAR *szUID, SQLSMALLINT nUIDLength, - const SQLCHAR *szPWD, SQLSMALLINT nPWDLength, - const char *host, int port, const char *dbname, int mapToLongVarchar); + const SQLCHAR *szPWD, SQLSMALLINT nPWDLength); SQLRETURN MNDBGetConnectAttr(ODBCDbc *dbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER BufferLength, SQLINTEGER *StringLength); SQLRETURN MNDBSetConnectAttr(ODBCDbc *dbc, SQLINTEGER Attribute, SQLPOINTER ValuePtr, SQLINTEGER StringLength); diff --git a/clients/odbc/driver/SQLBrowseConnect.c b/clients/odbc/driver/SQLBrowseConnect.c --- a/clients/odbc/driver/SQLBrowseConnect.c +++ b/clients/odbc/driver/SQLBrowseConnect.c @@ -53,7 +53,12 @@ suggest_settings(ODBCDbc *dbc, char **bu mparm parm = entry->parm; if (dbc->setting_touched[(int)parm] == touched_as) { const char *sep = *pos > 0 ? ";" : ""; - reallocprintf(buf, pos, cap, "%s%s%s:%s=?", sep, prefix, entry->name, entry->alt_name); + reallocprintf( + buf, pos, cap, + "%s%s%s%s%s=?", + sep, prefix, entry->name, + entry->alt_name ? ":" : "", + entry->alt_name ? entry->alt_name : ""); if (entry->is_enum) { assert(entry->values != NULL); *pos -= 1; // eat the '?' @@ -116,6 +121,7 @@ MNDBBrowseConnect(ODBCDbc *dbc, size_t cap = 0; suggest_settings(dbc, &buf, &pos, &cap, 2, ""); // mandatory first suggest_settings(dbc, &buf, &pos, &cap, 0, "*"); // then optional + // note that we leave out level 1, they have already been provided if (buf && pos) { size_t n = strcpy_len((char*)OutConnectionString, buf, BufferLength); 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 @@ -121,7 +121,7 @@ makeNulTerminated(const SQLCHAR **argume SQLCHAR *value = malloc(argument_len + 1); if (value == NULL) return false; - memmove(value, argument, argument_len); + memmove(value, *argument, argument_len); value[argument_len] = '\0'; *argument = value; @@ -311,17 +311,14 @@ end: SQLRETURN + MNDBConnect(ODBCDbc *dbc, const SQLCHAR *ServerName, SQLSMALLINT NameLength1, const SQLCHAR *UserName, SQLSMALLINT NameLength2, const SQLCHAR *Authentication, - SQLSMALLINT NameLength3, - const char *host, - int port, - const char *dbname, - int mapToLongVarchar) + SQLSMALLINT NameLength3) { // These will be passed to addDbcError if you 'goto failure'. // If unset, 'goto failure' will assume an allocation error. @@ -402,30 +399,12 @@ MNDBConnect(ODBCDbc *dbc, goto failure; } - if (host != NULL) { - error_explanation = msetting_set_string(settings, MP_HOST, host); - if (error_explanation != NULL) - goto failure; - } - mapiport_env = getenv("MAPIPORT"); - if (port > 0) - error_explanation = msetting_set_long(settings, MP_PORT, port); - else if (mapiport_env != NULL) + if (mapiport_env != NULL) error_explanation = msetting_parse(settings, MP_PORT, mapiport_env); if (error_explanation != NULL) goto failure; - if (dbname != NULL) { - error_explanation = msetting_set_string(settings, MP_DATABASE, dbname); - if (error_explanation != NULL) - goto failure; - } - - error_explanation = msetting_set_long(settings, MP_MAPTOLONGVARCHAR, mapToLongVarchar); - if (error_explanation) - goto failure; - #ifdef ODBCDEBUG { free(scratch); @@ -482,7 +461,6 @@ MNDBConnectSettings(ODBCDbc *dbc, const if (mid) { settings = NULL; // will be free'd as part of 'mid' now mapi_setclientprefix(mid, "ODBC " MONETDB_VERSION); - mapi_setAutocommit(mid, dbc->sql_attr_autocommit == SQL_AUTOCOMMIT_ON); mapi_set_size_header(mid, true); mapi_reconnect(mid); } @@ -546,8 +524,7 @@ SQLConnect(SQLHDBC ConnectionHandle, return MNDBConnect((ODBCDbc *) ConnectionHandle, ServerName, NameLength1, UserName, NameLength2, - Authentication, NameLength3, - NULL, 0, NULL, 0); + Authentication, NameLength3); } SQLRETURN SQL_API @@ -597,8 +574,7 @@ SQLConnectW(SQLHDBC ConnectionHandle, rc = MNDBConnect(dbc, ds, SQL_NTS, uid, SQL_NTS, - pwd, SQL_NTS, - NULL, 0, NULL, 0); + pwd, SQL_NTS); bailout: if (ds) diff --git a/clients/odbc/driver/SQLDriverConnect.c b/clients/odbc/driver/SQLDriverConnect.c --- a/clients/odbc/driver/SQLDriverConnect.c +++ b/clients/odbc/driver/SQLDriverConnect.c @@ -105,177 +105,6 @@ ODBCGetKeyAttr(const SQLCHAR **conn, SQL return 1; } -SQLRETURN -ODBCConnectionString(SQLRETURN rc, - ODBCDbc *dbc, - SQLCHAR *OutConnectionString, - SQLSMALLINT BufferLength, - SQLSMALLINT *StringLength2Ptr, - const char *dsn, - const char *uid, - const char *pwd, - const char *host, - int port, - const char *database, - int mapToLongVarchar) -{ - int n; -#ifdef ODBCDEBUG - SQLCHAR *buf = OutConnectionString; - int buflen = BufferLength; -#endif - - if (OutConnectionString == NULL) - BufferLength = -1; - if (BufferLength > 0) { - n = snprintf((char *) OutConnectionString, BufferLength, - "DSN=%s;", dsn ? dsn : "DEFAULT"); - /* some snprintf's return -1 if buffer too small */ - if (n < 0) - n = BufferLength + 1; /* make sure it becomes < 0 */ - BufferLength -= n; - OutConnectionString += n; - } else { - BufferLength = -1; - } - if (uid) { - if (BufferLength > 0) { - n = snprintf((char *) OutConnectionString, - BufferLength, "UID=%s;", uid); - if (n < 0) - n = BufferLength + 1; - BufferLength -= n; - OutConnectionString += n; - } else { - BufferLength = -1; - } - } - if (pwd) { - if (BufferLength > 0) { - n = snprintf((char *) OutConnectionString, - BufferLength, "PWD=%s;", pwd); - if (n < 0) - n = BufferLength + 1; - BufferLength -= n; - OutConnectionString += n; - } else { - BufferLength = -1; - } - } - if (host) { - if (BufferLength > 0) { - n = snprintf((char *) OutConnectionString, - BufferLength, "HOST=%s;", host); - if (n < 0) - n = BufferLength + 1; - BufferLength -= n; - OutConnectionString += n; - } else { - BufferLength = -1; - } - } - if (port) { - char portbuf[10]; - - if (BufferLength > 0) { - n = snprintf((char *) OutConnectionString, - BufferLength, "PORT=%d;", port); - if (n < 0) - n = BufferLength + 1; - BufferLength -= n; - OutConnectionString += n; - } else { - BufferLength = -1; - } - port = snprintf(portbuf, sizeof(portbuf), "%d", port); - } - if (database) { - if (BufferLength > 0) { - n = snprintf((char *) OutConnectionString, - BufferLength, "DATABASE=%s;", database); - if (n < 0) - n = BufferLength + 1; - BufferLength -= n; - OutConnectionString += n; - } else { - BufferLength = -1; - } - } - if (mapToLongVarchar > 0) { - if (BufferLength > 0) { - n = snprintf((char *) OutConnectionString, - BufferLength, "mapToLongVarchar=%d;", mapToLongVarchar); - if (n < 0) - n = BufferLength + 1; - BufferLength -= n; - OutConnectionString += n; - } else { - BufferLength = -1; - } - } - n = 0; -#ifdef ODBCDEBUG _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org