psqlodbc.git / summary / log / commit / refs

commit    f7aa96bd7cb8fdd7f63e4db892e125f02ea633f0
Author:   Hiroshi Inoue <h-inoue@dream.email.ne.jp>
Date:     Mon Mar 20 00:26:00 2017 +0000

    Fix a bug about Unicode driver for ansi apps.


connection.c | 2 +- pgtypes.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/connection.c b/connection.c index b3709ff6..a3ae4dca 100644 --- a/connection.c +++ b/connection.c @@ -1047,7 +1047,7 @@ CC_connect(ConnectionClass *self, char *salt_para) CC_clear_error(self); /* clear any initial command errors */ self->status = CONN_CONNECTED; if (CC_is_in_unicode_driver(self) - && 0 < ci->bde_environment) + && (CC_is_in_ansi_app(self) || 0 < ci->bde_environment)) self->unicode |= CONN_DISALLOW_WCHAR; mylog("conn->unicode=%d\n", self->unicode); ret = 1; diff --git a/pgtypes.c b/pgtypes.c index bb482fbe..0edac820 100644 --- a/pgtypes.c +++ b/pgtypes.c @@ -604,7 +604,7 @@ pgtype_attr_to_concise_type(const ConnectionClass *conn, OID type, int atttypmod if (sqltype = get_interval_type(atttypmod, NULL), 0 != sqltype) return sqltype; #endif /* PG_INTERVAL_AS_SQL_INTERVAL */ - return CC_is_in_unicode_driver(conn) ? SQL_WVARCHAR : SQL_VARCHAR; + return ALLOW_WCHAR(conn) ? SQL_WVARCHAR : SQL_VARCHAR; default: [parent: 7f9ec377dd11]