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,
}
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;
}
RETCODE SQL_API
-/*SQLGetFunctions(*/
PGAPI_GetFunctions(
HDBC hdbc,
UWORD fFunction,
" 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))
/* 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);