Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0521051

Browse files
author
Hiroshi Inoue
committed
Fix some multibyte related bugs.
Psqlodbc is 7.01.0007 now.Hiroshi Inoue
1 parent7e99cea commit0521051

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

‎src/interfaces/odbc/connection.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,13 +551,19 @@ CC_connect(ConnectionClass *self, char do_password)
551551
ci->drivers.bools_as_char);
552552

553553
#ifdefMULTIBYTE
554-
encoding=check_client_encoding(ci->drivers.conn_settings);
554+
encoding=check_client_encoding(ci->conn_settings);
555555
if (encoding&&strcmp(encoding,"OTHER"))
556556
self->client_encoding=strdup(encoding);
557+
else
558+
{
559+
encoding=check_client_encoding(ci->drivers.conn_settings);
560+
if (encoding&&strcmp(encoding,"OTHER"))
561+
self->client_encoding=strdup(encoding);
562+
}
557563
qlog(" extra_systable_prefixes='%s', conn_settings='%s' conn_encoding='%s'\n",
558564
ci->drivers.extra_systable_prefixes,
559565
ci->drivers.conn_settings,
560-
check_client_encoding(ci->drivers.conn_settings));
566+
encoding ?encoding :"");
561567
#else
562568
qlog(" extra_systable_prefixes='%s', conn_settings='%s'\n",
563569
ci->drivers.extra_systable_prefixes,

‎src/interfaces/odbc/convert.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,7 +1156,11 @@ copy_statement_with_parameters(StatementClass *stmt)
11561156
}
11571157
opos+=lit_call_len;
11581158
CVT_APPEND_STR("SELECT ");
1159+
#ifdefMULTIBYTE
1160+
if (multibyte_strchr(&old_statement[opos],'('))
1161+
#else
11591162
if (strchr(&old_statement[opos],'('))
1163+
#endif/* MULTIBYTE */
11601164
proc_no_param= FALSE;
11611165
continue;
11621166
}

‎src/interfaces/odbc/info.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,6 @@ PGAPI_GetTypeInfo(
826826

827827

828828
RETCODESQL_API
829-
/*SQLGetFunctions(*/
830829
PGAPI_GetFunctions(
831830
HDBChdbc,
832831
UWORDfFunction,
@@ -2202,6 +2201,8 @@ PGAPI_Statistics(
22022201
" and i.indexrelid = c.oid"
22032202
" and c.relam = a.oid"
22042203
,table_name);
2204+
if (PG_VERSION_GT(SC_get_conn(stmt),6.4))
2205+
strcat(index_query," order by i.indisprimary desc");
22052206

22062207
result=PGAPI_ExecDirect(hindx_stmt,index_query,strlen(index_query));
22072208
if ((result!=SQL_SUCCESS)&& (result!=SQL_SUCCESS_WITH_INFO))

‎src/interfaces/odbc/parse.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,14 @@ in_expr = TRUE;
616616

617617
/* lower case table name */
618618
for (ptr=ti[stmt->ntab]->name;*ptr;ptr++)
619+
{
620+
#ifdefMULTIBYTE
621+
if ((unsignedchar)*ptr >=0x80)
622+
ptr++;
623+
else
624+
#endif/* MULTIBYTE */
619625
*ptr=tolower((unsignedchar)*ptr);
626+
}
620627
}
621628
mylog("got table = '%s'\n",ti[stmt->ntab]->name);
622629

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp