Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit263db2e

Browse files
author
Hiroshi Inoue
committed
Make NAMEDATALEN changeable at compile time.
1 parent87c9636 commit263db2e

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

‎src/interfaces/odbc/connection.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,11 @@ CC_connect(ConnectionClass *self, char password_req, char *salt_para)
645645
ci->drivers.ksqo,
646646
ci->drivers.unique_index,
647647
ci->drivers.use_declarefetch);
648-
qlog(" text_as_longvarchar=%d, unknowns_as_longvarchar=%d, bools_as_char=%d\n",
648+
qlog(" text_as_longvarchar=%d, unknowns_as_longvarchar=%d, bools_as_char=%d NAMEDATALEN=%d\n",
649649
ci->drivers.text_as_longvarchar,
650650
ci->drivers.unknowns_as_longvarchar,
651-
ci->drivers.bools_as_char);
651+
ci->drivers.bools_as_char,
652+
MAX_TABLE_LEN);
652653

653654
#ifdefMULTIBYTE
654655
encoding=check_client_encoding(ci->conn_settings);
@@ -728,7 +729,7 @@ CC_connect(ConnectionClass *self, char password_req, char *salt_para)
728729
SOCK_put_int(sock,htonl(4+sizeof(StartupPacket6_2)),4);
729730
sp62.authtype=htonl(NO_AUTHENTICATION);
730731
strncpy(sp62.database,ci->database,PATH_SIZE);
731-
strncpy(sp62.user,ci->username,NAMEDATALEN);
732+
strncpy(sp62.user,ci->username,USRNAMEDATALEN);
732733
SOCK_put_n_char(sock, (char*)&sp62,sizeof(StartupPacket6_2));
733734
SOCK_flush_output(sock);
734735
}

‎src/interfaces/odbc/connection.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ typedef enum
9494
#defineNO_AUTHENTICATION7
9595
#definePATH_SIZE64
9696
#defineARGV_SIZE64
97-
#defineNAMEDATALEN16
97+
#defineUSRNAMEDATALEN16
9898

9999
typedefunsignedintProtocolVersion;
100100

@@ -120,7 +120,7 @@ typedef struct _StartupPacket6_2
120120
{
121121
unsignedintauthtype;
122122
chardatabase[PATH_SIZE];
123-
charuser[NAMEDATALEN];
123+
charuser[USRNAMEDATALEN];
124124
charoptions[ARGV_SIZE];
125125
charexecfile[ARGV_SIZE];
126126
chartty[PATH_SIZE];

‎src/interfaces/odbc/psqlodbc.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*
66
* Comments:See "notice.txt" for copyright and license information.
77
*
8-
* $Id: psqlodbc.h,v 1.68 2002/06/28 02:44:15 inoue Exp $
8+
* $Id: psqlodbc.h,v 1.69 2002/07/11 01:52:46 inoue Exp $
99
*
1010
*/
1111

@@ -27,6 +27,10 @@
2727
#defineODBCVER0x0250
2828
#endif/* ODBCVER_REP */
2929

30+
#ifndefNAMEDATALEN
31+
#defineNAMEDATALEN32
32+
#endif/* NAMEDATALEN */
33+
3034

3135
#if defined(WIN32)|| defined(WITH_UNIXODBC)|| defined(WITH_IODBC)
3236
#include<sql.h>
@@ -124,9 +128,9 @@ typedef UInt4 Oid;
124128
#defineBYTELEN8
125129
#defineVARHDRSZsizeof(Int4)
126130

127-
#defineMAX_SCHEMA_LEN32
128-
#defineMAX_TABLE_LEN32
129-
#defineMAX_COLUMN_LEN32
131+
#defineMAX_SCHEMA_LENNAMEDATALEN
132+
#defineMAX_TABLE_LENNAMEDATALEN
133+
#defineMAX_COLUMN_LENNAMEDATALEN
130134
#defineMAX_CURSOR_LEN32
131135

132136
/*Registry length limits */
@@ -239,7 +243,7 @@ voidlogs_on_off(int cnopen, int, int);
239243
#defineTEXT_FIELD_SIZE8190/* size of text fields
240244
* (not including null
241245
* term) */
242-
#defineNAME_FIELD_SIZE32/* size of name fields */
246+
#defineNAME_FIELD_SIZENAMEDATALEN/* size of name fields */
243247
#defineMAX_VARCHAR_SIZE254/* maximum size of a varchar (not
244248
* including null term) */
245249

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp