summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi Inoue2002-07-11 01:52:46 +0000
committerHiroshi Inoue2002-07-11 01:52:46 +0000
commit263db2e586d22155a341b538522e993d75fdf87c (patch)
treefe1981dad4b5f9c49b39bb9431387a3f8b95767b
parent87c963658ce8f48154209586b6a944a15a6b4b4c (diff)
Make NAMEDATALEN changeable at compile time.
-rw-r--r--src/interfaces/odbc/connection.c7
-rw-r--r--src/interfaces/odbc/connection.h4
-rw-r--r--src/interfaces/odbc/psqlodbc.h14
3 files changed, 15 insertions, 10 deletions
diff --git a/src/interfaces/odbc/connection.c b/src/interfaces/odbc/connection.c
index 04de1c8e25d..35a5e87711b 100644
--- a/src/interfaces/odbc/connection.c
+++ b/src/interfaces/odbc/connection.c
@@ -645,10 +645,11 @@ CC_connect(ConnectionClass *self, char password_req, char *salt_para)
ci->drivers.ksqo,
ci->drivers.unique_index,
ci->drivers.use_declarefetch);
- qlog(" text_as_longvarchar=%d, unknowns_as_longvarchar=%d, bools_as_char=%d\n",
+ qlog(" text_as_longvarchar=%d, unknowns_as_longvarchar=%d, bools_as_char=%d NAMEDATALEN=%d\n",
ci->drivers.text_as_longvarchar,
ci->drivers.unknowns_as_longvarchar,
- ci->drivers.bools_as_char);
+ ci->drivers.bools_as_char,
+ MAX_TABLE_LEN);
#ifdef MULTIBYTE
encoding = check_client_encoding(ci->conn_settings);
@@ -728,7 +729,7 @@ another_version_retry:
SOCK_put_int(sock, htonl(4 + sizeof(StartupPacket6_2)), 4);
sp62.authtype = htonl(NO_AUTHENTICATION);
strncpy(sp62.database, ci->database, PATH_SIZE);
- strncpy(sp62.user, ci->username, NAMEDATALEN);
+ strncpy(sp62.user, ci->username, USRNAMEDATALEN);
SOCK_put_n_char(sock, (char *) &sp62, sizeof(StartupPacket6_2));
SOCK_flush_output(sock);
}
diff --git a/src/interfaces/odbc/connection.h b/src/interfaces/odbc/connection.h
index 5a26c29d781..133b4920c00 100644
--- a/src/interfaces/odbc/connection.h
+++ b/src/interfaces/odbc/connection.h
@@ -94,7 +94,7 @@ typedef enum
#define NO_AUTHENTICATION 7
#define PATH_SIZE 64
#define ARGV_SIZE 64
-#define NAMEDATALEN 16
+#define USRNAMEDATALEN 16
typedef unsigned int ProtocolVersion;
@@ -120,7 +120,7 @@ typedef struct _StartupPacket6_2
{
unsigned int authtype;
char database[PATH_SIZE];
- char user[NAMEDATALEN];
+ char user[USRNAMEDATALEN];
char options[ARGV_SIZE];
char execfile[ARGV_SIZE];
char tty[PATH_SIZE];
diff --git a/src/interfaces/odbc/psqlodbc.h b/src/interfaces/odbc/psqlodbc.h
index 431f6a4922f..fae864bd4d1 100644
--- a/src/interfaces/odbc/psqlodbc.h
+++ b/src/interfaces/odbc/psqlodbc.h
@@ -5,7 +5,7 @@
*
* Comments: See "notice.txt" for copyright and license information.
*
- * $Id: psqlodbc.h,v 1.68 2002/06/28 02:44:15 inoue Exp $
+ * $Id: psqlodbc.h,v 1.69 2002/07/11 01:52:46 inoue Exp $
*
*/
@@ -27,6 +27,10 @@
#define ODBCVER 0x0250
#endif /* ODBCVER_REP */
+#ifndef NAMEDATALEN
+#define NAMEDATALEN 32
+#endif /* NAMEDATALEN */
+
#if defined(WIN32) || defined(WITH_UNIXODBC) || defined(WITH_IODBC)
#include <sql.h>
@@ -124,9 +128,9 @@ typedef UInt4 Oid;
#define BYTELEN 8
#define VARHDRSZ sizeof(Int4)
-#define MAX_SCHEMA_LEN 32
-#define MAX_TABLE_LEN 32
-#define MAX_COLUMN_LEN 32
+#define MAX_SCHEMA_LEN NAMEDATALEN
+#define MAX_TABLE_LEN NAMEDATALEN
+#define MAX_COLUMN_LEN NAMEDATALEN
#define MAX_CURSOR_LEN 32
/* Registry length limits */
@@ -239,7 +243,7 @@ void logs_on_off(int cnopen, int, int);
#define TEXT_FIELD_SIZE 8190 /* size of text fields
* (not including null
* term) */
-#define NAME_FIELD_SIZE 32 /* size of name fields */
+#define NAME_FIELD_SIZE NAMEDATALEN /* size of name fields */
#define MAX_VARCHAR_SIZE 254 /* maximum size of a varchar (not
* including null term) */