here are some patches for 6.5.0 which I already submitted but have never
authorBruce Momjian <bruce@momjian.us>
Mon, 3 May 1999 19:10:45 +0000 (19:10 +0000)
committerBruce Momjian <bruce@momjian.us>
Mon, 3 May 1999 19:10:45 +0000 (19:10 +0000)
been applied. The patches are in the .tar.gz attachment at the end:

varchar-array.patch     this patch adds support for arrays of bpchar() and
                        varchar(), which where always missing from postgres.

                        These datatypes can be used to replace the _char4,
                        _char8, etc., which were dropped some time ago.

block-size.patch        this patch fixes many errors in the parser and other
                        program which happen with very large query statements
                        (> 8K) when using a page size larger than 8192.

                        This patch is needed if you want to submit queries
                        larger than 8K. Postgres supports tuples up to 32K
                        but you can't insert them because you can't submit
                        queries larger than 8K. My patch fixes this problem.

                        The patch also replaces all the occurrences of `8192'
                        and `1<<13' in the sources with the proper constants
                        defined in include files. You should now never find
                        8192 hardwired in C code, just to make code clearer.

--
Massimo Dal Zotto

info.c
psqlodbc.h

diff --git a/info.c b/info.c
index 9e019dbba3c4d6f1942a92da50a2e79e85062756..d18620f69be94cdc8168382fd2920374986cab78 100644 (file)
--- a/info.c
+++ b/info.c
@@ -337,7 +337,7 @@ RETCODE result;
 
     case SQL_MAX_ROW_SIZE: /* ODBC 2.0 */
        len = 4;
-        value = 8192;
+        value = BLCKSZ;
         break;
 
     case SQL_MAX_ROW_SIZE_INCLUDES_LONG: /* ODBC 2.0 */
@@ -348,9 +348,9 @@ RETCODE result;
         break;
 
     case SQL_MAX_STATEMENT_LEN: /* ODBC 2.0 */
-        /* maybe this should be 8192? */
+        /* maybe this should be 0? */
        len = 4;
-        value = 0;
+        value = MAX_QUERY_SIZE;
         break;
 
     case SQL_MAX_TABLE_NAME_LEN: /* ODBC 1.0 */
index 8b095e335d0ce60fcc628ae026219abacf4d1e12..6ab559d91ab104c0e89ee8556de75fd6f6b11147 100644 (file)
@@ -49,7 +49,8 @@ typedef UInt4 Oid;
 #endif
 
 /* Limits */
-#define MAX_MESSAGE_LEN                8192
+#define MAX_QUERY_SIZE             (BLCKSZ*2)
+#define MAX_MESSAGE_LEN                MAX_QUERY_SIZE
 #define MAX_CONNECT_STRING         4096
 #define ERROR_MSG_LENGTH           4096
 #define FETCH_MAX                  100     /* default number of rows to cache for declare/fetch */