File tree Expand file tree Collapse file tree 7 files changed +266
-18
lines changed Expand file tree Collapse file tree 7 files changed +266
-18
lines changed Original file line number Diff line number Diff line change 1212 * Comments: See "notice.txt" for copyright and license information.
1313 *
1414 */
15+ /* Multibyte support Eiji Tokuya 2001-03-15 */
16+
17+ #ifdef HAVE_CONFIG_H
18+ #include "config.h"
19+ #endif
1520
1621#include "environ.h"
1722#include "connection.h"
2025#include "qresult.h"
2126#include "lobj.h"
2227#include "dlg_specific.h"
28+
29+ #ifdef MULTIBYTE
30+ #include "multibyte.h"
31+ #endif
32+
2333#include <stdio.h>
2434#include <string.h>
2535
@@ -496,9 +506,18 @@ static char *func="CC_connect";
496506 globals .text_as_longvarchar ,
497507 globals .unknowns_as_longvarchar ,
498508 globals .bools_as_char );
509+
510+ #ifdef MULTIBYTE
511+ check_client_encoding (globals .conn_settings );
512+ qlog (" extra_systable_prefixes='%s', conn_settings='%s' conn_encoding='%s'\n" ,
513+ globals .extra_systable_prefixes ,
514+ globals .conn_settings ,
515+ check_client_encoding (globals .conn_settings ));
516+ #else
499517 qlog (" extra_systable_prefixes='%s', conn_settings='%s'\n" ,
500518 globals .extra_systable_prefixes ,
501519 globals .conn_settings );
520+ #endif
502521
503522 if (self -> status != CONN_NOT_CONNECTED ) {
504523 self -> errormsg = "Already connected." ;
Original file line number Diff line number Diff line change 1515 * Comments: See "notice.txt" for copyright and license information.
1616 *
1717 */
18+ /* Multibyte support Eiji Tokuya 2001-03-15 */
1819
1920#ifdef HAVE_CONFIG_H
2021#include "config.h"
2627
2728#include "psqlodbc.h"
2829
30+ #ifdef MULTIBYTE
31+ #include "multibyte.h"
32+ #endif
33+
2934#ifndef WIN32
3035#include "iodbc.h"
3136#include "isql.h"
@@ -690,6 +695,9 @@ int lobj_fd, retval;
690695 param_number = -1 ;
691696
692697 oldstmtlen = strlen (old_statement );
698+ #ifdef MULTIBYTE
699+ multibyte_init ();
700+ #endif
693701
694702 for (opos = 0 ; opos < oldstmtlen ; opos ++ ) {
695703
@@ -700,10 +708,18 @@ int lobj_fd, retval;
700708 }
701709
702710 /* Handle literals (date, time, timestamp) and ODBC scalar functions */
711+ #ifdef MULTIBYTE
712+ else if (multibyte_char_check (old_statement [opos ]) == 0 && old_statement [opos ] == '{') {
713+ #else
703714 else if (old_statement [opos ] == '{' ) {
715+ #endif
704716 char * esc ;
705717 char * begin = & old_statement [opos + 1 ];
718+ #ifdef MULTIBYTE
719+ char * end = multibyte_strchr (begin , '}' );
720+ #else
706721 char * end = strchr (begin , '}' );
722+ #endif
707723
708724 if ( ! end )
709725 continue ;
@@ -1334,11 +1350,18 @@ char *p;
13341350 max = strlen (si );
13351351 else
13361352 max = used ;
1353+ #ifdef MULTIBYTE
1354+ multibyte_init ();
1355+ #endif
13371356
13381357 for (i = 0 ; i < max ; i ++ ) {
13391358 if (si [i ] == '\r' && i + 1 < strlen (si ) && si [i + 1 ] == '\n' )
13401359 continue ;
1360+ #ifdef MULTIBYTE
1361+ else if (multibyte_char_check (si [i ]) == 0 && (si [i ] == '\'' || si [i ] == '\\' ))
1362+ #else
13411363 else if (si [i ] == '\'' || si [i ] == '\\' )
1364+ #endif
13421365 p [out ++ ] = '\\' ;
13431366
13441367 p [out ++ ] = si [i ];
Original file line number Diff line number Diff line change 1515 * Comments: See "notice.txt" for copyright and license information.
1616 *
1717 */
18+ /* Multibyte support Eiji Tokuya 2001-03-15 */
1819
1920#ifdef HAVE_CONFIG_H
2021#include "config.h"
3435#include "dlg_specific.h"
3536#include "convert.h"
3637
38+ #ifdef MULTIBYTE
39+ #include "multibyte.h"
40+ #endif
41+
3742#ifndef BOOL
3843#define BOOL int
3944#endif
@@ -507,8 +512,17 @@ char encoded_conn_settings[LARGE_REGISTRY_LEN];
507512 ci -> show_oid_column ,
508513 ci -> fake_oid_index ,
509514 ci -> show_system_tables );
515+
516+ #ifdef MULTIBYTE
517+ check_client_encoding (ci -> conn_settings );
518+ qlog (" conn_settings='%s',conn_encoding='%s'\n" ,
519+ ci -> conn_settings ,
520+ check_client_encoding (ci -> conn_settings ));
521+ #else
510522 qlog (" conn_settings='%s'\n" ,
511523 ci -> conn_settings );
524+ #endif
525+
512526 qlog (" translation_dll='%s',translation_option='%s'\n" ,
513527 ci -> translation_dll ,
514528 ci -> translation_option );
Original file line number Diff line number Diff line change 1717 * Comments: See "notice.txt" for copyright and license information.
1818 *
1919 */
20+ /* Multibyte support Eiji Tokuya 2001-03-15 */
21+
22+ #ifdef HAVE_CONFIG_H
23+ #include "config.h"
24+ #endif
2025
2126#include <stdio.h>
2227#include <string.h>
2732#include "qresult.h"
2833#include "pgtypes.h"
2934
35+ #ifdef MULTIBYTE
36+ #include "multibyte.h"
37+ #endif
38+
3039#ifndef WIN32
3140#ifndef HAVE_STRICMP
3241#define stricmp (s1 ,s2 ) strcasecmp(s1,s2)
@@ -88,7 +97,11 @@ char qc, in_escape = FALSE;
8897 if (s [i ] == qc && ! in_escape ) {
8998 break ;
9099 }
100+ #ifdef MULTIBYTE
101+ if (multibyte_char_check (s [i ]) == 0 && s [i ] == '\\' && ! in_escape ) {
102+ #else
91103 if (s [i ] == '\\' && ! in_escape ) {
104+ #endif
92105 in_escape = TRUE;
93106 }
94107 else {
Original file line number Diff line number Diff line change 66 *
77 * Comments: See "notice.txt" for copyright and license information.
88 *
9- * $Id: psqlodbc.h,v 1.38 2001/02/15 05:32:00 inoue Exp $
9+ * $Id: psqlodbc.h,v 1.39 2001/03/16 01:17:23 inoue Exp $
1010 */
1111
1212#ifndef __PSQLODBC_H__
@@ -41,7 +41,7 @@ typedef UInt4 Oid;
4141#define DRIVERNAME "PostgreSQL ODBC"
4242#define DBMS_NAME "PostgreSQL"
4343
44- #define POSTGRESDRIVERVERSION "07.01.0003 "
44+ #define POSTGRESDRIVERVERSION "07.01.0004 "
4545
4646#ifdef WIN32
4747#define DRIVER_FILE_NAME "PSQLODBC.DLL"
@@ -134,6 +134,7 @@ typedef struct GlobalValues_
134134 char conn_settings [LARGE_REGISTRY_LEN ];
135135 char protocol [SMALL_REGISTRY_LEN ];
136136
137+
137138 FILE * mylogFP ;
138139 FILE * qlogFP ;
139140} GLOBAL_VALUES ;
You can’t perform that action at this time.
0 commit comments