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
This commit is contained in:
Bruce Momjian 1999-05-03 19:10:48 +00:00
parent da5f1dd722
commit 210055ad61
27 changed files with 273 additions and 66 deletions

View File

@ -6,7 +6,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.74 1999/04/25 03:19:09 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.75 1999/05/03 19:09:38 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -1061,7 +1061,7 @@ GetIndexRelations(Oid main_relation_oid,
}
}
#define EXT_ATTLEN 5*8192
#define EXT_ATTLEN 5*BLCKSZ
/*
returns 1 is c is in s

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.28 1999/02/13 23:15:41 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/libpq/be-fsstubs.c,v 1.29 1999/05/03 19:09:39 momjian Exp $
*
* NOTES
* This should be moved to a more appropriate place. It is here
@ -44,7 +44,9 @@
/* [PA] is Pascal André <andre@via.ecp.fr> */
/*#define FSDB 1*/
#define MAX_LOBJ_FDS 256
#define MAX_LOBJ_FDS 256
#define BUFSIZE 1024
#define FNAME_BUFSIZE 8192
static LargeObjectDesc *cookies[MAX_LOBJ_FDS];
@ -257,9 +259,8 @@ lo_import(text *filename)
int nbytes,
tmp;
#define BUFSIZE 1024
char buf[BUFSIZE];
char fnamebuf[8192];
char fnamebuf[FNAME_BUFSIZE];
LargeObjectDesc *lobj;
Oid lobjOid;
@ -324,9 +325,8 @@ lo_export(Oid lobjId, text *filename)
int nbytes,
tmp;
#define BUFSIZE 1024
char buf[BUFSIZE];
char fnamebuf[8192];
char fnamebuf[FNAME_BUFSIZE];
LargeObjectDesc *lobj;
mode_t oumask;

View File

@ -4,7 +4,7 @@
# Makefile for parser
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.19 1998/07/26 04:30:30 scrappy Exp $
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.20 1999/05/03 19:09:40 momjian Exp $
#
#-------------------------------------------------------------------------
@ -37,7 +37,9 @@ gram.c parse.h: gram.y
scan.c: scan.l
$(LEX) $<
mv lex.yy.c scan.c
sed -e 's/#define YY_BUF_SIZE .*/#define YY_BUF_SIZE 65536/' \
<lex.yy.c >scan.c
rm -f lex.yy.c
# The following dependencies on parse.h are computed by
# make depend, but we state them here explicitly anyway because

View File

@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.71 1999/04/27 13:33:43 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.72 1999/05/03 19:09:41 momjian Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -3290,7 +3290,6 @@ Typename: Array opt_array_bounds
else
$$->setof = FALSE;
}
| Character
| SETOF Array
{
$$ = $2;
@ -3301,6 +3300,7 @@ Typename: Array opt_array_bounds
Array: Generic
| Datetime
| Numeric
| Character
;
Generic: generic
@ -3425,10 +3425,6 @@ opt_decimal: '(' Iconst ',' Iconst ')'
/* SQL92 character data types
* The following implements CHAR() and VARCHAR().
* We do it here instead of the 'Generic' production
* because we don't want to allow arrays of VARCHAR().
* I haven't thought about whether that will work or not.
* - ay 6/95
*/
Character: character '(' Iconst ')'
{

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.47 1999/03/17 20:17:13 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/scan.l,v 1.48 1999/05/03 19:09:42 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -32,6 +32,11 @@
#include "parse.h"
#include "utils/builtins.h"
#ifdef YY_READ_BUF_SIZE
#undef YY_READ_BUF_SIZE
#endif
#define YY_READ_BUF_SIZE MAX_PARSE_BUFFER
extern char *parseString;
static char *parseCh;

View File

@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: fixade.h,v 1.5 1999/02/13 23:17:33 momjian Exp $
* $Id: fixade.h,v 1.6 1999/05/03 19:09:44 momjian Exp $
*
* NOTES
* This must be included in EVERY source file.
@ -47,11 +47,11 @@
*/
struct HP_WAY_BOGUS
{
char hpwb_bogus[8192];
char hpwb_bogus[8191+1];
};
struct HP_TOO_BOGUS
{
int hptb_bogus[8192];
int hptb_bogus[8191+1];
};
#endif /* BROKEN_STRUCT_INIT */

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.109 1999/05/01 17:16:25 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.110 1999/05/03 19:09:54 momjian Exp $
*
* NOTES
* this is the "main" module of the postgres backend and
@ -452,14 +452,14 @@ pg_parse_and_plan(char *query_string, /* string to execute */
else
{
/* Print condensed query string to fit in one log line */
char buff[8192 + 1];
char buff[MAX_QUERY_SIZE + 1];
char c,
*s,
*d;
int n,
is_space = 1;
for (s = query_string, d = buff, n = 0; (c = *s) && (n < 8192); s++)
for (s = query_string, d = buff, n = 0; (c = *s) && (n < MAX_QUERY_SIZE); s++)
{
switch (c)
{
@ -1539,7 +1539,7 @@ PostgresMain(int argc, char *argv[], int real_argc, char *real_argv[])
if (!IsUnderPostmaster)
{
puts("\nPOSTGRES backend interactive interface ");
puts("$Revision: 1.109 $ $Date: 1999/05/01 17:16:25 $\n");
puts("$Revision: 1.110 $ $Date: 1999/05/03 19:09:54 $\n");
}
/* ----------------

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.38 1999/02/13 23:19:00 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.39 1999/05/03 19:09:59 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -15,6 +15,7 @@
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "postgres.h"
@ -26,6 +27,7 @@
#include "storage/fd.h"
#include "fmgr.h"
#include "utils/array.h"
#include "utils/elog.h"
#include "libpq/libpq-fs.h"
#include "libpq/be-fsstubs.h"
@ -614,7 +616,9 @@ array_out(ArrayType *v, Oid element_type)
i,
j,
k,
#ifndef TCL_ARRAYS
l,
#endif
indx[MAXDIM];
bool dummy_bool;
int ndim,
@ -1274,6 +1278,156 @@ array_assgn(ArrayType *array,
return (char *) array;
}
/*
* array_map()
*
* Map an arbitrary function to an array and return a new array with
* same dimensions and the source elements transformed by fn().
*/
ArrayType *
array_map(ArrayType *v,
Oid type,
char *(fn)(char *p, ...),
Oid retType,
int nargs,
...)
{
ArrayType *result;
void *args[4];
char **values;
char *elt;
int *dim;
int ndim;
int nitems;
int i;
int nbytes = 0;
int inp_typlen;
bool inp_typbyval;
int typlen;
bool typbyval;
char typdelim;
Oid typelem;
Oid proc;
char typalign;
char *s;
char *p;
va_list ap;
/* Large objects not yet supported */
if (ARR_IS_LO(v) == true) {
elog(ERROR, "array_map: large objects not supported");
}
/* Check nargs */
if ((nargs < 0) || (nargs > 4)) {
elog(ERROR, "array_map: invalid nargs: %d", nargs);
}
/* Copy extra args to local variable */
va_start(ap, nargs);
for (i=0; i<nargs; i++) {
args[i] = (void *) va_arg(ap, char *);
}
va_end(ap);
/* Lookup source and result types. Unneeded variables are reused. */
system_cache_lookup(type, false, &inp_typlen, &inp_typbyval,
&typdelim, &typelem, &proc, &typalign);
system_cache_lookup(retType, false, &typlen, &typbyval,
&typdelim, &typelem, &proc, &typalign);
/* Allocate temporary array for new values */
ndim = ARR_NDIM(v);
dim = ARR_DIMS(v);
nitems = getNitems(ndim, dim);
values = (char **) palloc(nitems * sizeof(char *));
MemSet(values, 0, nitems * sizeof(char *));
/* Loop over source data */
s = (char *) ARR_DATA_PTR(v);
for (i=0; i<nitems; i++) {
/* Get source element */
if (inp_typbyval) {
switch (inp_typlen) {
case 1:
elt = (char *) ((int) (*(char *) s));
break;
case 2:
elt = (char *) ((int) (*(int16 *) s));
break;
case 3:
case 4:
default:
elt = (char *) (*(int32 *) s);
break;
}
s += inp_typlen;
} else {
elt = s;
if (inp_typlen > 0) {
s += inp_typlen;
} else {
s += INTALIGN(*(int32 *) s);
}
}
/*
* Apply the given function to source elt and extra args.
* nargs is the number of extra args taken by fn().
*/
switch (nargs) {
case 0:
p = (char *) (*fn) (elt);
break;
case 1:
p = (char *) (*fn) (elt, args[0]);
break;
case 2:
p = (char *) (*fn) (elt, args[0], args[1]);
break;
case 3:
p = (char *) (*fn) (elt, args[0], args[1], args[2]);
break;
case 4:
default:
p = (char *) (*fn) (elt, args[0], args[1], args[2], args[3]);
break;
}
/* Update values and total result size */
if (typbyval) {
values[i] = (char *) p;
nbytes += typlen;
} else {
int len;
len = ((typlen > 0) ? typlen : INTALIGN(*(int32 *) p));
/* Needed because _CopyArrayEls tries to pfree items */
if (p == elt) {
p = (char *) palloc(len);
memcpy(p, elt, len);
}
values[i] = (char *) p;
nbytes += len;
}
}
/* Allocate and initialize the result array */
nbytes += ARR_OVERHEAD(ndim);
result = (ArrayType *) palloc(nbytes);
MemSet(result, 0, nbytes);
memcpy((char *) result, (char *) &nbytes, sizeof(int));
memcpy((char *) ARR_NDIM_PTR(result), (char *) &ndim, sizeof(int));
memcpy((char *) ARR_DIMS(result), ARR_DIMS(v), 2 * ndim * sizeof(int));
/* Copy new values into the result array. values is pfreed. */
_CopyArrayEls((char **) values,
ARR_DATA_PTR(result), nitems,
typlen, typalign, typbyval);
return result;
}
/*-----------------------------------------------------------------------------
* array_eq :
* compares two arrays for equality

View File

@ -3,7 +3,7 @@
* out of it's tuple
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.9 1999/04/29 15:52:01 wieck Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.10 1999/05/03 19:10:01 momjian Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@ -57,6 +57,7 @@
#include "catalog/pg_opclass.h"
#include "fmgr.h"
#define BUFSIZE 8192
/* ----------
* Local data types
@ -331,8 +332,8 @@ pg_get_indexdef(Oid indexrelid)
int spirc;
int len;
int keyno;
char buf[8192];
char keybuf[8192];
char buf[BUFSIZE];
char keybuf[BUFSIZE];
char *sep;
/* ----------
@ -603,7 +604,7 @@ make_ruledef(HeapTuple ruletup, TupleDesc rulettc)
* Allocate space for the returned rule definition text
* ----------
*/
buf = palloc(8192);
buf = palloc(BUFSIZE);
/* ----------
* Get the attribute values from the rules tuple
@ -746,7 +747,7 @@ make_ruledef(HeapTuple ruletup, TupleDesc rulettc)
static char *
make_viewdef(HeapTuple ruletup, TupleDesc rulettc)
{
char buf[8192];
char buf[BUFSIZE];
Query *query;
char ev_type;
Oid ev_class;
@ -854,7 +855,7 @@ get_query_def(Query *query, QryHier *parentqh)
static char *
get_select_query_def(Query *query, QryHier *qh)
{
char buf[8192];
char buf[BUFSIZE];
char *sep;
TargetEntry *tle;
RangeTblEntry *rte;
@ -1024,7 +1025,7 @@ get_select_query_def(Query *query, QryHier *qh)
static char *
get_insert_query_def(Query *query, QryHier *qh)
{
char buf[8192];
char buf[BUFSIZE];
char *sep;
TargetEntry *tle;
RangeTblEntry *rte;
@ -1134,7 +1135,7 @@ get_insert_query_def(Query *query, QryHier *qh)
static char *
get_update_query_def(Query *query, QryHier *qh)
{
char buf[8192];
char buf[BUFSIZE];
char *sep;
TargetEntry *tle;
RangeTblEntry *rte;
@ -1187,7 +1188,7 @@ get_update_query_def(Query *query, QryHier *qh)
static char *
get_delete_query_def(Query *query, QryHier *qh)
{
char buf[8192];
char buf[BUFSIZE];
RangeTblEntry *rte;
/* ----------
@ -1221,7 +1222,7 @@ get_delete_query_def(Query *query, QryHier *qh)
static char *
get_rule_expr(QryHier *qh, int rt_index, Node *node, bool varprefix)
{
char buf[8192];
char buf[BUFSIZE];
if (node == NULL)
return pstrdup("");
@ -1408,7 +1409,7 @@ get_rule_expr(QryHier *qh, int rt_index, Node *node, bool varprefix)
static char *
get_func_expr(QryHier *qh, int rt_index, Expr *expr, bool varprefix)
{
char buf[8192];
char buf[BUFSIZE];
HeapTuple proctup;
Form_pg_proc procStruct;
List *l;
@ -1564,7 +1565,7 @@ get_const_expr(Const *constval)
FmgrInfo finfo_output;
char *extval;
bool isnull = FALSE;
char buf[8192];
char buf[BUFSIZE];
char namebuf[64];
if (constval->constisnull)
@ -1601,7 +1602,7 @@ get_sublink_expr(QryHier *qh, int rt_index, Node *node, bool varprefix)
Expr *expr;
List *l;
char *sep;
char buf[8192];
char buf[BUFSIZE];
buf[0] = '\0';

View File

@ -7,14 +7,16 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.43 1999/02/13 23:19:35 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/adt/varchar.c,v 1.44 1999/05/03 19:10:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
#include <stdio.h> /* for sprintf() */
#include <string.h>
#include "postgres.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "catalog/pg_type.h"
#ifdef CYR_RECODE
char *convertstr(char *, int, int);
@ -200,6 +202,16 @@ bpchar(char *s, int32 len)
return result;
} /* bpchar() */
/* _bpchar()
* Converts an array of char() type to a specific internal length.
* len is the length specified in () plus VARHDRSZ bytes.
*/
ArrayType *
_bpchar(ArrayType *v, int32 len)
{
return array_map(v, BPCHAROID, bpchar, BPCHAROID, 1, len);
}
/* bpchar_char()
* Convert bpchar(1) to char.
@ -396,6 +408,16 @@ varchar(char *s, int32 slen)
return result;
} /* varchar() */
/* _varchar()
* Converts an array of varchar() type to the specified size.
* len is the length specified in () plus VARHDRSZ bytes.
*/
ArrayType *
_varchar(ArrayType *v, int32 len)
{
return array_map(v, VARCHAROID, varchar, VARCHAROID, 1, len);
}
/*****************************************************************************
* Comparison Functions used for bpchar

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.176 1999/04/25 23:10:36 tgl Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.177 1999/05/03 19:10:08 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -115,7 +115,7 @@ static char *has_client_encoding = 0;
#define CMD_TERMINATE 2
#define CMD_NEWEDIT 3
#define MAX_QUERY_BUFFER 20000
#define MAX_QUERY_BUFFER MAX_QUERY_SIZE
#define COPYBUFSIZ 8192

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_proc.h,v 1.96 1999/04/20 03:51:13 tgl Exp $
* $Id: pg_proc.h,v 1.97 1999/05/03 19:10:18 momjian Exp $
*
* NOTES
* The script catalog/genbki.sh reads this file and generates .bki
@ -1553,6 +1553,11 @@ DESCR("convert int8 to text");
DATA(insert OID = 1289 ( text_int8 PGUID 11 f t f 1 f 20 "25" 100 0 0 100 text_int8 - ));
DESCR("convert text to int8");
DATA(insert OID = 1290 ( _bpchar PGUID 11 f t f 2 f 1014 "1014 23" 100 0 0 100 _bpchar - ));
DESCR("truncate _char()");
DATA(insert OID = 1291 ( _varchar PGUID 11 f t f 2 f 1015 "1015 23" 100 0 0 100 _varchar - ));
DESCR("truncate _varchar()");
DATA(insert OID = 1297 ( timestamp_in PGUID 11 f t f 1 f 1296 "0" 100 0 0 100 timestamp_in - ));
DESCR("(internal)");
DATA(insert OID = 1298 ( timestamp_out PGUID 11 f t f 1 f 23 "0" 100 0 0 100 timestamp_out - ));

View File

@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pg_type.h,v 1.58 1999/03/28 02:01:39 tgl Exp $
* $Id: pg_type.h,v 1.59 1999/05/03 19:10:20 momjian Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@ -327,6 +327,8 @@ DATA(insert OID = 1010 ( _tid PGUID -1 -1 f b t \054 0 27 array_in array_out
DATA(insert OID = 1011 ( _xid PGUID -1 -1 f b t \054 0 28 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1012 ( _cid PGUID -1 -1 f b t \054 0 29 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1013 ( _oid8 PGUID -1 -1 f b t \054 0 30 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1014 ( _bpchar PGUID -1 -1 f b t \054 0 1042 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1015 ( _varchar PGUID -1 -1 f b t \054 0 1043 array_in array_out array_in array_out i _null_ ));
DATA(insert OID = 1017 ( _point PGUID -1 -1 f b t \054 0 600 array_in array_out array_in array_out d _null_ ));
DATA(insert OID = 1018 ( _lseg PGUID -1 -1 f b t \054 0 601 array_in array_out array_in array_out d _null_ ));
DATA(insert OID = 1019 ( _path PGUID -1 -1 f b t \054 0 602 array_in array_out array_in array_out d _null_ ));

View File

@ -8,7 +8,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pqcomm.h,v 1.34 1999/04/25 03:19:13 tgl Exp $
* $Id: pqcomm.h,v 1.35 1999/05/03 19:10:24 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -27,6 +27,11 @@
#include <netinet/in.h>
#endif
/*
* Internal send/receive buffers in libpq.
*/
#define PQ_BUFFER_SIZE 8192
/* Define a generic socket address type. */
typedef union SockAddr

View File

@ -11,7 +11,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: miscadmin.h,v 1.36 1999/03/17 22:53:30 momjian Exp $
* $Id: miscadmin.h,v 1.37 1999/05/03 19:10:09 momjian Exp $
*
* NOTES
* some of the information in this file will be moved to
@ -100,7 +100,8 @@ extern int SortMem;
extern Oid LastOidProcessed; /* for query rewrite */
#define MAX_PARSE_BUFFER 8192
/* #define MAX_QUERY_SIZE (BLCKSZ*2) */
#define MAX_PARSE_BUFFER MAX_QUERY_SIZE
/*
* default number of buffers in buffer pool

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1995, Regents of the University of California
*
* $Id: postgres.h,v 1.21 1999/03/25 03:49:28 tgl Exp $
* $Id: postgres.h,v 1.22 1999/05/03 19:10:14 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -151,6 +151,7 @@ typedef uint32 CommandId;
* ----------------
*/
#define MAXPGPATH 128
#define MAX_QUERY_SIZE (BLCKSZ*2)
#define STATUS_OK (0)
#define STATUS_ERROR (-1)

View File

@ -10,7 +10,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: array.h,v 1.15 1999/02/13 23:22:15 momjian Exp $
* $Id: array.h,v 1.16 1999/05/03 19:10:25 momjian Exp $
*
* NOTES
* XXX the data array should be LONGALIGN'd -- notice that the array
@ -103,7 +103,7 @@ typedef struct
#define RETURN_NULL {*isNull = true; return(0); }
/* #endif *//* irix5 */
#define NAME_LEN 30
#define MAX_BUFF_SIZE (1 << 13)
#define MAX_BUFF_SIZE BLCKSZ
typedef struct
{
@ -126,6 +126,8 @@ extern char *array_set(ArrayType *array, int n, int *indx, char *dataPtr,
extern char *array_assgn(ArrayType *array, int n, int *upperIndx,
int *lowerIndx, ArrayType *newArr, int reftype,
int len, bool *isNull);
extern ArrayType *array_map(ArrayType *v, Oid type, char *(fn)(char *p, ...),
Oid retType, int nargs, ...);
extern int array_eq(ArrayType *array1, ArrayType *array2);
extern int _LOtransfer(char **destfd, int size, int nitems, char **srcfd,
int isSrcLO, int isDestLO);

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: builtins.h,v 1.77 1999/03/15 03:24:31 tgl Exp $
* $Id: builtins.h,v 1.78 1999/05/03 19:10:31 momjian Exp $
*
* NOTES
* This should normally only be included by fmgr.h.
@ -23,6 +23,7 @@
#define BUILTINS_H
#include <storage/itemptr.h>
#include <utils/array.h>
#include <utils/geo_decls.h>
#include <utils/datetime.h>
#include <utils/nabstime.h>
@ -411,6 +412,7 @@ time_t datetime_timestamp(DateTime *datetime);
extern char *bpcharin(char *s, int dummy, int32 atttypmod);
extern char *bpcharout(char *s);
extern char *bpchar(char *s, int32 slen);
extern ArrayType *_bpchar(ArrayType *v, int32 slen);
extern char *char_bpchar(int32 c);
extern int32 bpchar_char(char *s);
extern char *name_bpchar(NameData *s);
@ -429,6 +431,7 @@ extern uint32 hashbpchar(struct varlena * key);
extern char *varcharin(char *s, int dummy, int32 atttypmod);
extern char *varcharout(char *s);
extern char *varchar(char *s, int32 slen);
extern ArrayType *_varchar(ArrayType *v, int32 slen);
extern bool varchareq(char *arg1, char *arg2);
extern bool varcharne(char *arg1, char *arg2);
extern bool varcharlt(char *arg1, char *arg2);

View File

@ -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

View File

@ -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

View File

@ -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)
{

View File

@ -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 *))))

View File

@ -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

View File

@ -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 */

View 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 */

View File

@ -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 */

View File

@ -1,5 +1,5 @@
/*
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.30 1999/02/21 03:49:55 scrappy Exp $
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.31 1999/05/03 19:10:48 momjian Exp $
*/
#include <float.h> /* faked on sunos */
@ -319,7 +319,7 @@ funny_dup17()
Relation rel;
TupleDesc tupdesc;
HeapTuple tuple;
char sql[8192];
char sql[MAX_QUERY_SIZE];
char *when;
int inserted;
int selected = 0;
@ -563,7 +563,7 @@ ttdummy()
{
void *pplan;
Oid *ctypes;
char sql[8192];
char sql[MAX_QUERY_SIZE];
/* allocate ctypes for preparation */
ctypes = (Oid *) palloc(natts * sizeof(Oid));