diff -c psqlodbc.orig\connection.c psqlodbc.full\connection.c *** psqlodbc.orig\connection.c Sat Dec 10 08:39:31 2005 --- psqlodbc.full\connection.c Mon Dec 19 23:33:09 2005 *************** *** 112,119 **** memcpy(&ci->drivers, &globals, sizeof(globals)); getDSNinfo(ci, CONN_OVERWRITE); logs_on_off(1, ci->drivers.debug, ci->drivers.commlog); - /* initialize pg_version from connInfo.protocol */ - CC_initialize_pg_version(conn); /* * override values from DSN info with UID and authStr(pwd) This only --- 112,117 ---- *************** *** 737,772 **** qlog(" [ Large Object oid = %d ]\n", self->lobj_type); result = PGAPI_FreeStmt(hstmt, SQL_DROP); - } - - - /* - * This function initializes the version of PostgreSQL from - * connInfo.protocol that we're connected to. - * h-inoue 01-2-2001 - */ - void - CC_initialize_pg_version(ConnectionClass *self) - { - strcpy(self->pg_version, self->connInfo.protocol); - if (PROTOCOL_62(&self->connInfo)) - { - self->pg_version_number = (float) 6.2; - self->pg_version_major = 6; - self->pg_version_minor = 2; - } - else if (PROTOCOL_63(&self->connInfo)) - { - self->pg_version_number = (float) 6.3; - self->pg_version_major = 6; - self->pg_version_minor = 3; - } - else - { - self->pg_version_number = (float) 6.4; - self->pg_version_major = 6; - self->pg_version_minor = 4; - } } --- 735,740 ---- diff -c psqlodbc.orig\connection.h psqlodbc.full\connection.h *** psqlodbc.orig\connection.h Wed Nov 30 13:44:12 2005 --- psqlodbc.full\connection.h Mon Dec 19 23:33:09 2005 *************** *** 171,183 **** #define ARGV_SIZE 64 #define USRNAMEDATALEN 16 - typedef unsigned int ProtocolVersion; - - #define PG_PROTOCOL(major, minor) (((major) << 16) | (minor)) - #define PG_PROTOCOL_LATEST PG_PROTOCOL(2, 0) - #define PG_PROTOCOL_63 PG_PROTOCOL(1, 0) - #define PG_PROTOCOL_62 PG_PROTOCOL(0, 0) - typedef enum { --- 171,176 ---- *************** *** 189,199 **** * statement */ } CONN_Status; - /* Transferred from pqcomm.h: */ - - - typedef ProtocolVersion MsgType; - /* Structure to hold all the connection attributes for a specific connection (used for both registry and file, DSN and DRIVER) */ --- 182,187 ---- *************** *** 207,213 **** char username[MEDIUM_REGISTRY_LEN]; char password[MEDIUM_REGISTRY_LEN]; char conn_settings[LARGE_REGISTRY_LEN]; - char protocol[SMALL_REGISTRY_LEN]; char port[SMALL_REGISTRY_LEN]; char sslmode[MEDIUM_REGISTRY_LEN]; char onlyread[SMALL_REGISTRY_LEN]; --- 195,200 ---- *************** *** 231,242 **** } ConnInfo; - /* Macro to determine is the connection using 6.2 protocol? */ - #define PROTOCOL_62(conninfo_) (strncmp((conninfo_)->protocol, PG62, strlen(PG62)) == 0) - - /* Macro to determine is the connection using 6.3 protocol? */ - #define PROTOCOL_63(conninfo_) (strncmp((conninfo_)->protocol, PG63, strlen(PG63)) == 0) - /* * Macros to compare the server's version with a specified version * 1st parameter: pointer to a ConnectionClass object --- 218,223 ---- *************** *** 390,396 **** char CC_send_settings(ConnectionClass *self); void CC_lookup_lo(ConnectionClass *conn); void CC_lookup_pg_version(ConnectionClass *conn); - void CC_initialize_pg_version(ConnectionClass *conn); void CC_log_error(const char *func, const char *desc, const ConnectionClass *self); int CC_get_max_query_len(const ConnectionClass *self); int CC_send_cancel_request(const ConnectionClass *conn); --- 371,376 ---- diff -c psqlodbc.orig\dlg_specific.c psqlodbc.full\dlg_specific.c *** psqlodbc.orig\dlg_specific.c Wed Nov 30 13:44:16 2005 --- psqlodbc.full\dlg_specific.c Mon Dec 19 23:33:09 2005 *************** *** 65,72 **** ";%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%s;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%s;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d;%s=%d", INI_READONLY, ci->onlyread, - INI_PROTOCOL, - ci->protocol, INI_FAKEOIDINDEX, ci->fake_oid_index, INI_SHOWOIDCOLUMN, --- 65,70 ---- *************** *** 137,148 **** flag |= BIT_LFCONVERSION; if (ci->drivers.unique_index) flag |= BIT_UNIQUEINDEX; - if (strncmp(ci->protocol, PG64, strlen(PG64)) == 0) - flag |= BIT_PROTOCOL_64; - else if (strncmp(ci->protocol, PG63, strlen(PG63)) == 0) - flag |= BIT_PROTOCOL_63; - else if (strncmp(ci->protocol, "7.4", 3) == 0) - flag |= (BIT_PROTOCOL_63 | BIT_PROTOCOL_64); switch (ci->drivers.unknown_sizes) { case UNKNOWNS_AS_DONTKNOW: --- 135,140 ---- *************** *** 231,242 **** if (count < 4) return; ci->drivers.unique_index = (char)((flag & BIT_UNIQUEINDEX) != 0); - if ((flag & BIT_PROTOCOL_64) != 0) - strcpy(ci->protocol, PG64); - else if ((flag & BIT_PROTOCOL_63) != 0) - strcpy(ci->protocol, PG63); - else - strcpy(ci->protocol, PG62); if ((flag & BIT_UNKNOWN_DONTKNOW) != 0) ci->drivers.unknown_sizes = UNKNOWNS_AS_DONTKNOW; else if ((flag & BIT_UNKNOWN_ASMAX) != 0) --- 223,228 ---- *************** *** 293,301 **** else if (stricmp(attribute, INI_READONLY) == 0 || stricmp(attribute, "A0") == 0) strcpy(ci->onlyread, value); - else if (stricmp(attribute, INI_PROTOCOL) == 0 || stricmp(attribute, "A1") == 0) - strcpy(ci->protocol, value); - else if (stricmp(attribute, INI_SHOWOIDCOLUMN) == 0 || stricmp(attribute, "A3") == 0) strcpy(ci->show_oid_column, value); --- 279,284 ---- *************** *** 332,338 **** else if (stricmp(attribute, "CX") == 0) unfoldCXAttribute(ci, value); ! mylog("copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',sslmode='%s',onlyread='%s',protocol='%s',conn_settings='%s',disallow_premature=%d)\n", ci->dsn, ci->server, ci->database, ci->username, ci->password ? "xxxxx" : "", ci->port, ci->sslmode, ci->onlyread, ci->protocol, ci->conn_settings, ci->disallow_premature); } void --- 315,321 ---- else if (stricmp(attribute, "CX") == 0) unfoldCXAttribute(ci, value); ! mylog("copyAttributes: DSN='%s',server='%s',dbase='%s',user='%s',passwd='%s',port='%s',sslmode='%s',onlyread='%s',conn_settings='%s',disallow_premature=%d)\n", ci->dsn, ci->server, ci->database, ci->username, ci->password ? "xxxxx" : "", ci->port, ci->sslmode, ci->onlyread, ci->conn_settings, ci->disallow_premature); } void *************** *** 410,418 **** if (ci->onlyread[0] == '\0') sprintf(ci->onlyread, "%d", globals.onlyread); - if (ci->protocol[0] == '\0') - strcpy(ci->protocol, globals.protocol); - if (ci->fake_oid_index[0] == '\0') sprintf(ci->fake_oid_index, "%d", DEFAULT_FAKEOIDINDEX); --- 393,398 ---- *************** *** 517,525 **** if (ci->show_system_tables[0] == '\0' || overwrite) SQLGetPrivateProfileString(DSN, INI_SHOWSYSTEMTABLES, "", ci->show_system_tables, sizeof(ci->show_system_tables), ODBC_INI); - if (ci->protocol[0] == '\0' || overwrite) - SQLGetPrivateProfileString(DSN, INI_PROTOCOL, "", ci->protocol, sizeof(ci->protocol), ODBC_INI); - if (ci->conn_settings[0] == '\0' || overwrite) { SQLGetPrivateProfileString(DSN, INI_CONNSETTINGS, "", encoded_conn_settings, sizeof(encoded_conn_settings), ODBC_INI); --- 497,502 ---- *************** *** 598,606 **** ci->database, ci->username, ci->password ? "xxxxx" : ""); ! qlog(" onlyread='%s',protocol='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'\n", ci->onlyread, - ci->protocol, ci->show_oid_column, ci->fake_oid_index, ci->show_system_tables); --- 575,582 ---- ci->database, ci->username, ci->password ? "xxxxx" : ""); ! qlog(" onlyread='%s',showoid='%s',fakeoidindex='%s',showsystable='%s'\n", ci->onlyread, ci->show_oid_column, ci->fake_oid_index, ci->show_system_tables); *************** *** 776,786 **** ODBC_INI); SQLWritePrivateProfileString(DSN, - INI_PROTOCOL, - ci->protocol, - ODBC_INI); - - SQLWritePrivateProfileString(DSN, INI_CONNSETTINGS, encoded_conn_settings, ODBC_INI); --- 752,757 ---- *************** *** 1021,1036 **** else comval->onlyread = DEFAULT_READONLY; - /* - * Default state for future DSN's protocol attribute This isn't a - * real driver option YET. This is more intended for - * customization from the install. - */ - SQLGetPrivateProfileString(section, INI_PROTOCOL, "@@@", - temp, sizeof(temp), filename); - if (strcmp(temp, "@@@")) - strcpy(comval->protocol, temp); - else - strcpy(comval->protocol, DEFAULT_PROTOCOL); } } --- 992,996 ---- diff -c psqlodbc.orig\dlg_specific.h psqlodbc.full\dlg_specific.h *** psqlodbc.orig\dlg_specific.h Wed Nov 30 13:44:16 2005 --- psqlodbc.full\dlg_specific.h Mon Dec 19 23:33:09 2005 *************** *** 55,61 **** #define INI_SOCKET "Socket" /* Socket buffer size */ #define INI_READONLY "ReadOnly" /* Database is read only */ #define INI_COMMLOG "CommLog" /* Communication to backend logging */ - #define INI_PROTOCOL "Protocol" /* What protocol (6.2) */ #define INI_OPTIMIZER "Optimizer" /* Use backend genetic optimizer */ #define INI_KSQO "Ksqo" /* Keyset query optimization */ #define INI_CONNSETTINGS "ConnSettings" /* Anything to send to backend on successful connection */ --- 55,60 ---- *************** *** 96,103 **** #define BIT_UPDATABLECURSORS (1L<<1) #define BIT_DISALLOWPREMATURE (1L<<2) #define BIT_UNIQUEINDEX (1L<<3) - #define BIT_PROTOCOL_63 (1L<<4) - #define BIT_PROTOCOL_64 (1L<<5) #define BIT_UNKNOWN_DONTKNOW (1L<<6) #define BIT_UNKNOWN_ASMAX (1L<<7) #define BIT_OPTIMIZER (1L<<8) --- 95,100 ---- *************** *** 127,133 **** #define DEFAULT_PORT "5432" #define DEFAULT_SSLMODE "prefer" #define DEFAULT_READONLY 0 - #define DEFAULT_PROTOCOL "6.4" /* the latest protocol is the default */ #define DEFAULT_USEDECLAREFETCH 0 #define DEFAULT_TEXTASLONGVARCHAR 1 #define DEFAULT_UNKNOWNSASLONGVARCHAR 0 --- 124,129 ---- diff -c psqlodbc.orig\dlg_wingui.c psqlodbc.full\dlg_wingui.c *** psqlodbc.orig\dlg_wingui.c Wed Nov 30 13:44:17 2005 --- psqlodbc.full\dlg_wingui.c Mon Dec 19 23:33:09 2005 *************** *** 455,469 **** /* Readonly */ CheckDlgButton(hdlg, DS_READONLY, atoi(ci->onlyread)); - /* Protocol */ - if (strncmp(ci->protocol, PG62, strlen(PG62)) == 0) - CheckDlgButton(hdlg, DS_PG62, 1); - else if (strncmp(ci->protocol, PG63, strlen(PG63)) == 0) - CheckDlgButton(hdlg, DS_PG63, 1); - else - /* latest */ - CheckDlgButton(hdlg, DS_PG64, 1); - /* Int8 As */ switch (ci->int8_as) { --- 455,460 ---- *************** *** 523,537 **** /* Readonly */ sprintf(ci->onlyread, "%d", IsDlgButtonChecked(hdlg, DS_READONLY)); - - /* Protocol */ - if (IsDlgButtonChecked(hdlg, DS_PG62)) - strcpy(ci->protocol, PG62); - else if (IsDlgButtonChecked(hdlg, DS_PG63)) - strcpy(ci->protocol, PG63); - else - /* latest */ - strcpy(ci->protocol, PG64); /* Int8 As */ if (IsDlgButtonChecked(hdlg, DS_INT8_AS_DEFAULT)) --- 514,519 ---- diff -c psqlodbc.orig\drvconn.c psqlodbc.full\drvconn.c *** psqlodbc.orig\drvconn.c Wed Nov 30 13:44:17 2005 --- psqlodbc.full\drvconn.c Mon Dec 19 23:33:09 2005 *************** *** 141,148 **** /* Fill in any default parameters if they are not there. */ getDSNdefaults(ci); - /* initialize pg_version */ - CC_initialize_pg_version(conn); salt[0] = '\0'; #ifdef WIN32 --- 141,146 ---- diff -c psqlodbc.orig\psqlodbc.h psqlodbc.full\psqlodbc.h *** psqlodbc.orig\psqlodbc.h Wed Nov 30 13:44:32 2005 --- psqlodbc.full\psqlodbc.h Mon Dec 19 23:33:09 2005 *************** *** 202,213 **** /* Now that's 0, lets use this instead. DJP 24-1-2001 */ #define STD_STATEMENT_LEN MAX_MESSAGE_LEN - #define PG62 "6.2" /* "Protocol" key setting - * to force Postgres 6.2 */ - #define PG63 "6.3" /* "Protocol" key setting - * to force postgres 6.3 */ - #define PG64 "6.4" - typedef struct ConnectionClass_ ConnectionClass; typedef struct StatementClass_ StatementClass; typedef struct QResultClass_ QResultClass; --- 202,207 ---- *************** *** 252,258 **** char cancel_as_freestmt; char extra_systable_prefixes[MEDIUM_REGISTRY_LEN]; char conn_settings[LARGE_REGISTRY_LEN]; - char protocol[SMALL_REGISTRY_LEN]; } GLOBAL_VALUES; typedef struct StatementOptions_ --- 246,251 ---- diff -c psqlodbc.orig\psqlodbc.rc psqlodbc.full\psqlodbc.rc *** psqlodbc.orig\psqlodbc.rc Sat Dec 10 08:39:31 2005 --- psqlodbc.full\psqlodbc.rc Mon Dec 19 23:33:09 2005 *************** *** 163,183 **** WS_TABSTOP,184,108,40,10 CONTROL "int4",DS_INT8_AS_INT4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,227,108,29,10 ! GROUPBOX "プロトコルバ−ジョン",IDC_STATIC,5,128,296,25 ! CONTROL ">= 6.4",DS_PG64,"Button",BS_AUTORADIOBUTTON | WS_GROUP, ! 18,139,49,10 ! CONTROL "6.3",DS_PG63,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP, ! 87,139,26,10 ! CONTROL "6.2",DS_PG62,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP, ! 140,140,26,10 ! GROUPBOX "OID オプション",IDC_STATIC,5,158,296,25 CONTROL "カラム列表示(&C)",DS_SHOWOIDCOLUMN,"Button", ! BS_AUTOCHECKBOX | WS_GROUP,16,169,72,10 CONTROL "インデックスを装う(&I)",DS_FAKEOIDINDEX,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,107,169,95,10 ! LTEXT "接続時 設定:(&S)",IDC_STATIC,13,192,69,10,NOT WS_GROUP ! EDITTEXT DS_CONNSETTINGS,90,191,211,27,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_TABSTOP DEFPUSHBUTTON "OK",IDOK,5,224,50,14,WS_GROUP --- 163,176 ---- WS_TABSTOP,184,108,40,10 CONTROL "int4",DS_INT8_AS_INT4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,227,108,29,10 ! GROUPBOX "OID オプション",IDC_STATIC,5,128,296,25 CONTROL "カラム列表示(&C)",DS_SHOWOIDCOLUMN,"Button", ! BS_AUTOCHECKBOX | WS_GROUP,16,139,72,10 CONTROL "インデックスを装う(&I)",DS_FAKEOIDINDEX,"Button", ! BS_AUTOCHECKBOX | WS_TABSTOP,107,139,95,10 ! LTEXT "接続時 設定:(&S)",IDC_STATIC,13,159,69,10,NOT WS_GROUP ! EDITTEXT DS_CONNSETTINGS,90,160,211,58,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN | NOT WS_TABSTOP DEFPUSHBUTTON "OK",IDOK,5,224,50,14,WS_GROUP *************** *** 509,528 **** WS_TABSTOP,184,108,40,10 CONTROL "int4",DS_INT8_AS_INT4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,227,108,29,10 ! GROUPBOX "Protocol",IDC_STATIC,5,126,277,25 ! CONTROL ">= 6.4",DS_PG64,"Button",BS_AUTORADIOBUTTON | WS_GROUP, ! 44,137,49,10 ! CONTROL "6.3",DS_PG63,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP, ! 117,137,26,10 ! CONTROL "6.2",DS_PG62,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP, ! 191,137,26,10 ! GROUPBOX "OID Options",IDC_STATIC,5,155,277,25 CONTROL "Show &Column",DS_SHOWOIDCOLUMN,"Button",BS_AUTOCHECKBOX | ! WS_GROUP | WS_TABSTOP,53,167,59,10 CONTROL "Fake &Index",DS_FAKEOIDINDEX,"Button",BS_AUTOCHECKBOX | ! WS_GROUP | WS_TABSTOP,155,166,51,10 ! LTEXT "Connect\n&Settings",IDC_STATIC,5,188,62,17 ! EDITTEXT DS_CONNSETTINGS,47,188,235,27,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN DEFPUSHBUTTON "OK",IDOK,121,220,50,14,WS_GROUP PUSHBUTTON "Cancel",IDCANCEL,231,220,50,14 --- 502,514 ---- WS_TABSTOP,184,108,40,10 CONTROL "int4",DS_INT8_AS_INT4,"Button",BS_AUTORADIOBUTTON | WS_TABSTOP,227,108,29,10 ! GROUPBOX "OID Options",IDC_STATIC,5,127,277,25 CONTROL "Show &Column",DS_SHOWOIDCOLUMN,"Button",BS_AUTOCHECKBOX | ! WS_GROUP | WS_TABSTOP,53,138,59,10 CONTROL "Fake &Index",DS_FAKEOIDINDEX,"Button",BS_AUTOCHECKBOX | ! WS_GROUP | WS_TABSTOP,155,138,51,10 ! LTEXT "Connect\n&Settings",IDC_STATIC,5,160,62,17 ! EDITTEXT DS_CONNSETTINGS,47,160,235,55,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN DEFPUSHBUTTON "OK",IDOK,121,220,50,14,WS_GROUP PUSHBUTTON "Cancel",IDCANCEL,231,220,50,14 diff -c psqlodbc.orig\resource.h psqlodbc.full\resource.h *** psqlodbc.orig\resource.h Wed Nov 30 13:44:33 2005 --- psqlodbc.full\resource.h Mon Dec 19 23:33:09 2005 *************** *** 34,40 **** #define DS_SHOWOIDCOLUMN 1012 #define DS_FAKEOIDINDEX 1013 #define DRV_COMMLOG 1014 - #define DS_PG62 1016 #define IDC_DATASOURCE 1018 #define DRV_OPTIMIZER 1019 #define DS_CONNSETTINGS 1020 --- 34,39 ---- *************** *** 62,69 **** #define DRV_CANCELASFREESTMT 1053 #define IDC_OPTIONS 1054 #define DRV_KSQO 1055 - #define DS_PG64 1057 - #define DS_PG63 1058 #define DRV_OR_DSN 1059 #define DRV_DEBUG 1060 #define DS_DISALLOWPREMATURE 1061 --- 61,66 ----