diff options
author | Hiroshi Inoue <inoue@tpf.co.jp> | 2001-09-11 06:39:20 +0000 |
---|---|---|
committer | Hiroshi Inoue <inoue@tpf.co.jp> | 2001-09-11 06:39:20 +0000 |
commit | 0521051b0b443dd8a498802472059bdda21ebaf3 (patch) | |
tree | d4e4e0fce39e2d97e140f7422ed12a8f5ca2282f /src | |
parent | 7e99cea816bde08ba3bda2de4e972adc624a659e (diff) | |
download | postgresql-0521051b0b443dd8a498802472059bdda21ebaf3.tar.gz postgresql-0521051b0b443dd8a498802472059bdda21ebaf3.zip |
Fix some multibyte related bugs.
Psqlodbc is 7.01.0007 now.
Hiroshi Inoue
Diffstat (limited to 'src')
-rw-r--r-- | src/interfaces/odbc/connection.c | 10 | ||||
-rw-r--r-- | src/interfaces/odbc/convert.c | 4 | ||||
-rw-r--r-- | src/interfaces/odbc/info.c | 3 | ||||
-rw-r--r-- | src/interfaces/odbc/parse.c | 7 |
4 files changed, 21 insertions, 3 deletions
diff --git a/src/interfaces/odbc/connection.c b/src/interfaces/odbc/connection.c index 9685c9358b5..b055bd01444 100644 --- a/src/interfaces/odbc/connection.c +++ b/src/interfaces/odbc/connection.c @@ -551,13 +551,19 @@ CC_connect(ConnectionClass *self, char do_password) ci->drivers.bools_as_char); #ifdef MULTIBYTE - encoding = check_client_encoding(ci->drivers.conn_settings); + encoding = check_client_encoding(ci->conn_settings); if (encoding && strcmp(encoding, "OTHER")) self->client_encoding = strdup(encoding); + else + { + encoding = check_client_encoding(ci->drivers.conn_settings); + if (encoding && strcmp(encoding, "OTHER")) + self->client_encoding = strdup(encoding); + } qlog(" extra_systable_prefixes='%s', conn_settings='%s' conn_encoding='%s'\n", ci->drivers.extra_systable_prefixes, ci->drivers.conn_settings, - check_client_encoding(ci->drivers.conn_settings)); + encoding ? encoding : ""); #else qlog(" extra_systable_prefixes='%s', conn_settings='%s'\n", ci->drivers.extra_systable_prefixes, diff --git a/src/interfaces/odbc/convert.c b/src/interfaces/odbc/convert.c index 9c1c6e3737a..8052709fdac 100644 --- a/src/interfaces/odbc/convert.c +++ b/src/interfaces/odbc/convert.c @@ -1156,7 +1156,11 @@ copy_statement_with_parameters(StatementClass *stmt) } opos += lit_call_len; CVT_APPEND_STR("SELECT "); +#ifdef MULTIBYTE + if (multibyte_strchr(&old_statement[opos], '(')) +#else if (strchr(&old_statement[opos], '(')) +#endif /* MULTIBYTE */ proc_no_param = FALSE; continue; } diff --git a/src/interfaces/odbc/info.c b/src/interfaces/odbc/info.c index 663e207abb5..1f458ba043e 100644 --- a/src/interfaces/odbc/info.c +++ b/src/interfaces/odbc/info.c @@ -826,7 +826,6 @@ PGAPI_GetTypeInfo( RETCODE SQL_API -/*SQLGetFunctions(*/ PGAPI_GetFunctions( HDBC hdbc, UWORD fFunction, @@ -2202,6 +2201,8 @@ PGAPI_Statistics( " and i.indexrelid = c.oid" " and c.relam = a.oid" , table_name); + if (PG_VERSION_GT(SC_get_conn(stmt), 6.4)) + strcat(index_query, " order by i.indisprimary desc"); result = PGAPI_ExecDirect(hindx_stmt, index_query, strlen(index_query)); if ((result != SQL_SUCCESS) && (result != SQL_SUCCESS_WITH_INFO)) diff --git a/src/interfaces/odbc/parse.c b/src/interfaces/odbc/parse.c index f6254cae947..0f0aff6e04e 100644 --- a/src/interfaces/odbc/parse.c +++ b/src/interfaces/odbc/parse.c @@ -616,7 +616,14 @@ in_expr = TRUE; /* lower case table name */ for (ptr = ti[stmt->ntab]->name; *ptr; ptr++) + { +#ifdef MULTIBYTE + if ((unsigned char) *ptr >= 0x80) + ptr++; + else +#endif /* MULTIBYTE */ *ptr = tolower((unsigned char) *ptr); + } } mylog("got table = '%s'\n", ti[stmt->ntab]->name); |