1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

Further to the previous ODBC patches I posted today, I found a couple of

problems with char array sizes having set a couple of constants to 0 for
unlimited query length and row length. This additional patch cleans those
problems up by defining a new constant (STD_STATEMENT_LEN) to 65536 and
using that in place of MAX_STATEMENT_LEN.

Another constant (MAX_MESSAGE_LEN) was defined as 2*BLCKSZ, but is now
65536. This is used to define the length of the message buffer in a number
of places and as I understand it (probably not that well!) therefore also
places a limit on the query length. Fixing this properly is beyond my
capabilities but 65536 should hopefully be large enough for most people.

Apologies for being over-enthusiastic and posting 3 patches in one day
rather than 1 better tested one!

Regards,

Dave Page
This commit is contained in:
Bruce Momjian
2001-01-25 03:28:27 +00:00
parent 0e968ee705
commit 40203e4f3e
3 changed files with 15 additions and 12 deletions

View File

@ -54,9 +54,8 @@ typedef UInt4 Oid;
#define BLCKSZ 4096
#endif
#define MAX_ROW_SIZE 0 /* Unlimited rowsize with the Tuple Toaster */
#define MAX_QUERY_SIZE 0 /* Unlimited query length from v7.0(?) */
#define MAX_MESSAGE_LEN (2*BLCKSZ)
#define MAX_MESSAGE_LEN 65536 /* This puts a limit on query size but I don't */
/* see an easy way round this - DJP 24-1-2001 */
#define MAX_CONNECT_STRING 4096
#define ERROR_MSG_LENGTH 4096
#define FETCH_MAX 100 /* default number of rows to cache for declare/fetch */
@ -85,8 +84,12 @@ typedef UInt4 Oid;
#define MAX_INFO_STRING 128
#define MAX_KEYPARTS 20
#define MAX_KEYLEN 512 /* max key of the form "date+outlet+invoice" */
#define MAX_STATEMENT_LEN MAX_MESSAGE_LEN
#define MAX_ROW_SIZE 0 /* Unlimited rowsize with the Tuple Toaster */
#define MAX_STATEMENT_LEN 0 /* Unlimited statement size with 7.0
/* Previously, numerous query strings were defined of length MAX_STATEMENT_LEN */
/* 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 */