File tree 4 files changed +21
-3
lines changed
4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -551,13 +551,19 @@ CC_connect(ConnectionClass *self, char do_password)
551
551
ci -> drivers .bools_as_char );
552
552
553
553
#ifdef MULTIBYTE
554
- encoding = check_client_encoding (ci -> drivers . conn_settings );
554
+ encoding = check_client_encoding (ci -> conn_settings );
555
555
if (encoding && strcmp (encoding , "OTHER" ))
556
556
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
+ }
557
563
qlog (" extra_systable_prefixes='%s', conn_settings='%s' conn_encoding='%s'\n" ,
558
564
ci -> drivers .extra_systable_prefixes ,
559
565
ci -> drivers .conn_settings ,
560
- check_client_encoding ( ci -> drivers . conn_settings ) );
566
+ encoding ? encoding : "" );
561
567
#else
562
568
qlog (" extra_systable_prefixes='%s', conn_settings='%s'\n" ,
563
569
ci -> drivers .extra_systable_prefixes ,
Original file line number Diff line number Diff line change @@ -1156,7 +1156,11 @@ copy_statement_with_parameters(StatementClass *stmt)
1156
1156
}
1157
1157
opos += lit_call_len ;
1158
1158
CVT_APPEND_STR ("SELECT " );
1159
+ #ifdef MULTIBYTE
1160
+ if (multibyte_strchr (& old_statement [opos ], '(' ))
1161
+ #else
1159
1162
if (strchr (& old_statement [opos ], '(' ))
1163
+ #endif /* MULTIBYTE */
1160
1164
proc_no_param = FALSE;
1161
1165
continue ;
1162
1166
}
Original file line number Diff line number Diff line change @@ -826,7 +826,6 @@ PGAPI_GetTypeInfo(
826
826
827
827
828
828
RETCODE SQL_API
829
- /*SQLGetFunctions(*/
830
829
PGAPI_GetFunctions (
831
830
HDBC hdbc ,
832
831
UWORD fFunction ,
@@ -2202,6 +2201,8 @@ PGAPI_Statistics(
2202
2201
" and i.indexrelid = c.oid"
2203
2202
" and c.relam = a.oid"
2204
2203
, table_name );
2204
+ if (PG_VERSION_GT (SC_get_conn (stmt ), 6.4 ))
2205
+ strcat (index_query , " order by i.indisprimary desc" );
2205
2206
2206
2207
result = PGAPI_ExecDirect (hindx_stmt , index_query , strlen (index_query ));
2207
2208
if ((result != SQL_SUCCESS ) && (result != SQL_SUCCESS_WITH_INFO ))
Original file line number Diff line number Diff line change @@ -616,7 +616,14 @@ in_expr = TRUE;
616
616
617
617
/* lower case table name */
618
618
for (ptr = ti [stmt -> ntab ]-> name ; * ptr ; ptr ++ )
619
+ {
620
+ #ifdef MULTIBYTE
621
+ if ((unsigned char ) * ptr >= 0x80 )
622
+ ptr ++ ;
623
+ else
624
+ #endif /* MULTIBYTE */
619
625
* ptr = tolower ((unsigned char ) * ptr );
626
+ }
620
627
}
621
628
mylog ("got table = '%s'\n" , ti [stmt -> ntab ]-> name );
622
629
You can’t perform that action at this time.
0 commit comments