diff options
| author | Bruce Momjian | 1999-05-03 19:10:48 +0000 |
|---|---|---|
| committer | Bruce Momjian | 1999-05-03 19:10:48 +0000 |
| commit | 210055ad614ae845686fdf9f8fc6b60301689cc8 (patch) | |
| tree | 0410cff48a92bc3c95aea12877046d4ab25aaedb /src/interfaces | |
| parent | da5f1dd7227bd507cc8d5b088fd3f5e53e932722 (diff) | |
here are some patches for 6.5.0 which I already submitted but have never
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
Diffstat (limited to 'src/interfaces')
| -rw-r--r-- | src/interfaces/ecpg/preproc/Makefile | 4 | ||||
| -rw-r--r-- | src/interfaces/ecpg/preproc/pgc.l | 5 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-connect.c | 6 | ||||
| -rw-r--r-- | src/interfaces/libpq/fe-print.c | 4 | ||||
| -rw-r--r-- | src/interfaces/libpq/libpq-int.h | 4 | ||||
| -rw-r--r-- | src/interfaces/odbc/info.c | 6 | ||||
| -rw-r--r-- | src/interfaces/odbc/psqlodbc.h | 3 | ||||
| -rw-r--r-- | src/interfaces/python/pgmodule.c | 2 |
8 files changed, 21 insertions, 13 deletions
diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index e2025adccac..6952b078f84 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -38,7 +38,9 @@ ecpg: $(OBJ) pgc.c: pgc.l $(LEX) $< - mv lex.yy.c pgc.c + sed -e 's/#define YY_BUF_SIZE .*/#define YY_BUF_SIZE 65536/' \ + <lex.yy.c >pgc.c + rm -f lex.yy.c preproc.o : preproc.h ../include/ecpgtype.h keywords.c c_keywords.c ecpg_keywords.c type.o : ../include/ecpgtype.h diff --git a/src/interfaces/ecpg/preproc/pgc.l b/src/interfaces/ecpg/preproc/pgc.l index 0ae21909785..44542cb83bf 100644 --- a/src/interfaces/ecpg/preproc/pgc.l +++ b/src/interfaces/ecpg/preproc/pgc.l @@ -28,6 +28,11 @@ #include "preproc.h" #include "utils/builtins.h" +#ifdef YY_READ_BUF_SIZE +#undef YY_READ_BUF_SIZE +#endif +#define YY_READ_BUF_SIZE MAX_PARSE_BUFFER + /* some versions of lex define this as a macro */ #if defined(yywrap) #undef yywrap diff --git a/src/interfaces/libpq/fe-connect.c b/src/interfaces/libpq/fe-connect.c index cfc3e36b7f9..fb78b1ee371 100644 --- a/src/interfaces/libpq/fe-connect.c +++ b/src/interfaces/libpq/fe-connect.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.95 1999/03/29 08:19:36 ishii Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-connect.c,v 1.96 1999/05/03 19:10:40 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -876,9 +876,9 @@ makeEmptyPGconn(void) conn->asyncStatus = PGASYNC_IDLE; conn->notifyList = DLNewList(); conn->sock = -1; - conn->inBufSize = 8192; + conn->inBufSize = PQ_BUFFER_SIZE; conn->inBuffer = (char *) malloc(conn->inBufSize); - conn->outBufSize = 8192; + conn->outBufSize = PQ_BUFFER_SIZE; conn->outBuffer = (char *) malloc(conn->outBufSize); if (conn->inBuffer == NULL || conn->outBuffer == NULL) { diff --git a/src/interfaces/libpq/fe-print.c b/src/interfaces/libpq/fe-print.c index fa358c70d4e..25e58bc9501 100644 --- a/src/interfaces/libpq/fe-print.c +++ b/src/interfaces/libpq/fe-print.c @@ -9,7 +9,7 @@ * didn't really belong there. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.21 1999/04/25 18:16:47 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-print.c,v 1.22 1999/05/03 19:10:41 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -105,7 +105,7 @@ PQprint(FILE *fout, int usePipe = 0; pqsigfunc oldsigpipehandler = NULL; char *pagerenv; - char buf[8192 * 2 + 1]; + char buf[MAX_QUERY_SIZE + 1]; nTups = PQntuples(res); if (!(fieldNames = (char **) calloc(nFields, sizeof(char *)))) diff --git a/src/interfaces/libpq/libpq-int.h b/src/interfaces/libpq/libpq-int.h index dfc4dba8500..aaeffa3459a 100644 --- a/src/interfaces/libpq/libpq-int.h +++ b/src/interfaces/libpq/libpq-int.h @@ -11,7 +11,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: libpq-int.h,v 1.6 1999/02/13 23:22:42 momjian Exp $ + * $Id: libpq-int.h,v 1.7 1999/05/03 19:10:42 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -255,7 +255,7 @@ extern int pqFlush(PGconn *conn); extern int pqWait(int forRead, int forWrite, PGconn *conn); /* max length of message to send */ -#define MAX_MESSAGE_LEN 8193 +#define MAX_MESSAGE_LEN MAX_QUERY_SIZE /* maximum number of fields in a tuple */ #define MAX_FIELDS 512 diff --git a/src/interfaces/odbc/info.c b/src/interfaces/odbc/info.c index 9e019dbba3c..d18620f69be 100644 --- a/src/interfaces/odbc/info.c +++ b/src/interfaces/odbc/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 */ diff --git a/src/interfaces/odbc/psqlodbc.h b/src/interfaces/odbc/psqlodbc.h index 8b095e335d0..6ab559d91ab 100644 --- a/src/interfaces/odbc/psqlodbc.h +++ b/src/interfaces/odbc/psqlodbc.h @@ -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 */ diff --git a/src/interfaces/python/pgmodule.c b/src/interfaces/python/pgmodule.c index 2dc8bf59364..34c534e5ce8 100644 --- a/src/interfaces/python/pgmodule.c +++ b/src/interfaces/python/pgmodule.c @@ -51,7 +51,7 @@ static char *PyPgVersion = "2.2"; #define CHECK_OPEN 1 #define CHECK_CLOSE 2 -#define MAX_BUFFER_SIZE 8192 /* maximum transaction size */ +#define MAX_BUFFER_SIZE MAX_QUERY_SIZE /* maximum transaction size */ #ifndef NO_DIRECT #define DIRECT_ACCESS 1 /* enables direct access functions */ |
