Cleanup use of 16 that should be NAMEDATALEN.
This commit is contained in:
parent
34797d4225
commit
0da6358f37
@ -1347,7 +1347,7 @@ text_range_out(TXTRANGE *r)
|
|||||||
|
|
||||||
if (r == NULL)
|
if (r == NULL)
|
||||||
return (NULL);
|
return (NULL);
|
||||||
result = (char *) palloc(16 + VARSIZE(TRLOWER(r)) + VARSIZE(TRUPPER(r))
|
result = (char *) palloc(NAMEDATALEN + VARSIZE(TRLOWER(r)) + VARSIZE(TRUPPER(r))
|
||||||
- 2 * VARHDRSZ);
|
- 2 * VARHDRSZ);
|
||||||
|
|
||||||
lower = (char *) palloc(VARSIZE(TRLOWER(r)) + 1 - VARHDRSZ);
|
lower = (char *) palloc(VARSIZE(TRLOWER(r)) + 1 - VARHDRSZ);
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.29 1998/06/16 02:53:25 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/access/heap/heapam.c,v 1.30 1998/07/20 16:56:53 momjian Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -239,18 +239,18 @@ heapgettup(Relation relation,
|
|||||||
#ifdef HEAPDEBUGALL
|
#ifdef HEAPDEBUGALL
|
||||||
if (ItemPointerIsValid(tid))
|
if (ItemPointerIsValid(tid))
|
||||||
{
|
{
|
||||||
elog(DEBUG, "heapgettup(%.16s, tid=0x%x[%d,%d], dir=%d, ...)",
|
elog(DEBUG, "heapgettup(%s, tid=0x%x[%d,%d], dir=%d, ...)",
|
||||||
RelationGetRelationName(relation), tid, tid->ip_blkid,
|
RelationGetRelationName(relation), tid, tid->ip_blkid,
|
||||||
tid->ip_posid, dir);
|
tid->ip_posid, dir);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
elog(DEBUG, "heapgettup(%.16s, tid=0x%x, dir=%d, ...)",
|
elog(DEBUG, "heapgettup(%s, tid=0x%x, dir=%d, ...)",
|
||||||
RelationGetRelationName(relation), tid, dir);
|
RelationGetRelationName(relation), tid, dir);
|
||||||
}
|
}
|
||||||
elog(DEBUG, "heapgettup(..., b=0x%x, nkeys=%d, key=0x%x", b, nkeys, key);
|
elog(DEBUG, "heapgettup(..., b=0x%x, nkeys=%d, key=0x%x", b, nkeys, key);
|
||||||
|
|
||||||
elog(DEBUG, "heapgettup: relation(%c)=`%.16s', %s",
|
elog(DEBUG, "heapgettup: relation(%c)=`%s', %s",
|
||||||
relation->rd_rel->relkind, &relation->rd_rel->relname,
|
relation->rd_rel->relkind, &relation->rd_rel->relname,
|
||||||
(seeself == true) ? "SeeSelf" : "NoSeeSelf");
|
(seeself == true) ? "SeeSelf" : "NoSeeSelf");
|
||||||
#endif /* !defined(HEAPDEBUGALL) */
|
#endif /* !defined(HEAPDEBUGALL) */
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmqueue.c,v 1.6 1997/09/08 21:47:10 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/ipc/shmqueue.c,v 1.7 1998/07/20 16:56:54 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -99,7 +99,7 @@ SHMQueueDelete(SHM_QUEUE *queue)
|
|||||||
void
|
void
|
||||||
dumpQ(SHM_QUEUE *q, char *s)
|
dumpQ(SHM_QUEUE *q, char *s)
|
||||||
{
|
{
|
||||||
char elem[16];
|
char elem[NAMEDATALEN];
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
SHM_QUEUE *start = q;
|
SHM_QUEUE *start = q;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.32 1998/07/20 16:14:14 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/storage/smgr/md.c,v 1.33 1998/07/20 16:56:55 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -686,7 +686,7 @@ mdnblocks(Relation reln)
|
|||||||
{
|
{
|
||||||
v->mdfd_chain = _mdfd_openseg(reln, segno, O_CREAT);
|
v->mdfd_chain = _mdfd_openseg(reln, segno, O_CREAT);
|
||||||
if (v->mdfd_chain == (MdfdVec *) NULL)
|
if (v->mdfd_chain == (MdfdVec *) NULL)
|
||||||
elog(ERROR, "cannot count blocks for %.16s -- open failed",
|
elog(ERROR, "cannot count blocks for %s -- open failed",
|
||||||
RelationGetRelationName(reln));
|
RelationGetRelationName(reln));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -940,7 +940,7 @@ _mdfd_getseg(Relation reln, int blkno, int oflag)
|
|||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
if ((fd = mdopen(reln)) < 0)
|
if ((fd = mdopen(reln)) < 0)
|
||||||
elog(ERROR, "cannot open relation %.16s",
|
elog(ERROR, "cannot open relation %s",
|
||||||
RelationGetRelationName(reln));
|
RelationGetRelationName(reln));
|
||||||
reln->rd_fd = fd;
|
reln->rd_fd = fd;
|
||||||
}
|
}
|
||||||
@ -956,7 +956,7 @@ _mdfd_getseg(Relation reln, int blkno, int oflag)
|
|||||||
v->mdfd_chain = _mdfd_openseg(reln, i, oflag);
|
v->mdfd_chain = _mdfd_openseg(reln, i, oflag);
|
||||||
|
|
||||||
if (v->mdfd_chain == (MdfdVec *) NULL)
|
if (v->mdfd_chain == (MdfdVec *) NULL)
|
||||||
elog(ERROR, "cannot open segment %d of relation %.16s",
|
elog(ERROR, "cannot open segment %d of relation %s",
|
||||||
i, RelationGetRelationName(reln));
|
i, RelationGetRelationName(reln));
|
||||||
}
|
}
|
||||||
v = v->mdfd_chain;
|
v = v->mdfd_chain;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.20 1998/05/19 18:05:47 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/dest.c,v 1.21 1998/07/20 16:56:57 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -284,8 +284,7 @@ BeginCommand(char *pname,
|
|||||||
|
|
||||||
for (i = 0; i < natts; ++i)
|
for (i = 0; i < natts; ++i)
|
||||||
{
|
{
|
||||||
pq_putstr(attrs[i]->attname.data); /* if 16 char name
|
pq_putstr(attrs[i]->attname.data);
|
||||||
* oops.. */
|
|
||||||
pq_putint((int) attrs[i]->atttypid, sizeof(attrs[i]->atttypid));
|
pq_putint((int) attrs[i]->atttypid, sizeof(attrs[i]->atttypid));
|
||||||
pq_putint(attrs[i]->attlen, sizeof(attrs[i]->attlen));
|
pq_putint(attrs[i]->attlen, sizeof(attrs[i]->attlen));
|
||||||
if (PG_PROTOCOL_MAJOR(FrontendProtocol) >= 2)
|
if (PG_PROTOCOL_MAJOR(FrontendProtocol) >= 2)
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.19 1998/06/15 19:29:37 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/regproc.c,v 1.20 1998/07/20 16:57:01 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -130,7 +130,7 @@ regprocout(RegProcedure proid)
|
|||||||
RelationGetTupleDescriptor(proc), &isnull);
|
RelationGetTupleDescriptor(proc), &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
{
|
{
|
||||||
StrNCpy(result, s, 16);
|
StrNCpy(result, s, NAMEDATALEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
elog(FATAL, "regprocout: null procedure %d", proid);
|
elog(FATAL, "regprocout: null procedure %d", proid);
|
||||||
@ -207,7 +207,8 @@ oid8types(Oid (*oidArray)[])
|
|||||||
RelationGetTupleDescriptor(type), &isnull);
|
RelationGetTupleDescriptor(type), &isnull);
|
||||||
if (!isnull)
|
if (!isnull)
|
||||||
{
|
{
|
||||||
StrNCpy(VARDATA(result) + strlen(VARDATA(result)), s, 16);
|
StrNCpy(VARDATA(result) + strlen(VARDATA(result)), s,
|
||||||
|
NAMEDATALEN);
|
||||||
strcat(VARDATA(result), " ");
|
strcat(VARDATA(result), " ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.13 1998/04/27 04:07:00 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/Attic/sets.c,v 1.14 1998/07/20 16:57:02 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@ SetDefine(char *querystr, char *typename)
|
|||||||
Oid setoid;
|
Oid setoid;
|
||||||
char *procname = GENERICSETNAME;
|
char *procname = GENERICSETNAME;
|
||||||
char *fileName = "-";
|
char *fileName = "-";
|
||||||
char realprocname[16];
|
char realprocname[NAMEDATALEN];
|
||||||
HeapTuple tup,
|
HeapTuple tup,
|
||||||
newtup = NULL;
|
newtup = NULL;
|
||||||
Form_pg_proc proc;
|
Form_pg_proc proc;
|
||||||
|
4
src/backend/utils/cache/catcache.c
vendored
4
src/backend/utils/cache/catcache.c
vendored
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.29 1998/06/15 19:29:38 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/catcache.c,v 1.30 1998/07/20 16:57:03 momjian Exp $
|
||||||
*
|
*
|
||||||
* Notes:
|
* Notes:
|
||||||
* XXX This needs to use exception.h to handle recovery when
|
* XXX This needs to use exception.h to handle recovery when
|
||||||
@ -220,7 +220,7 @@ CatalogCacheInitializeCache(struct catcache * cache,
|
|||||||
&cache->cc_skey[i].sk_func);
|
&cache->cc_skey[i].sk_func);
|
||||||
cache->cc_skey[i].sk_nargs = cache->cc_skey[i].sk_func.fn_nargs;
|
cache->cc_skey[i].sk_nargs = cache->cc_skey[i].sk_func.fn_nargs;
|
||||||
|
|
||||||
CACHE5_elog(DEBUG, "CatalogCacheInit %16s %d %d %x",
|
CACHE5_elog(DEBUG, "CatalogCacheInit %s %d %d %x",
|
||||||
&relation->rd_rel->relname,
|
&relation->rd_rel->relname,
|
||||||
i,
|
i,
|
||||||
tupdesc->attrs[cache->cc_key[i] - 1]->attlen,
|
tupdesc->attrs[cache->cc_key[i] - 1]->attlen,
|
||||||
|
6
src/backend/utils/cache/syscache.c
vendored
6
src/backend/utils/cache/syscache.c
vendored
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.18 1998/06/15 19:29:40 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.19 1998/07/20 16:57:05 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* These routines allow the parser/planner/executor to perform
|
* These routines allow the parser/planner/executor to perform
|
||||||
@ -372,7 +372,7 @@ InitCatalogCache()
|
|||||||
if (!PointerIsValid((char *) SysCache[cacheId]))
|
if (!PointerIsValid((char *) SysCache[cacheId]))
|
||||||
{
|
{
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"InitCatalogCache: Can't init cache %.16s(%d)",
|
"InitCatalogCache: Can't init cache %s(%d)",
|
||||||
cacheinfo[cacheId].name,
|
cacheinfo[cacheId].name,
|
||||||
cacheId);
|
cacheId);
|
||||||
}
|
}
|
||||||
@ -419,7 +419,7 @@ SearchSysCacheTuple(int cacheId,/* cache selection code */
|
|||||||
cacheinfo[cacheId].iScanFunc);
|
cacheinfo[cacheId].iScanFunc);
|
||||||
if (!PointerIsValid(SysCache[cacheId]))
|
if (!PointerIsValid(SysCache[cacheId]))
|
||||||
elog(ERROR,
|
elog(ERROR,
|
||||||
"InitCatalogCache: Can't init cache %.16s(%d)",
|
"InitCatalogCache: Can't init cache %s(%d)",
|
||||||
cacheinfo[cacheId].name,
|
cacheinfo[cacheId].name,
|
||||||
cacheId);
|
cacheId);
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: libpq.h,v 1.19 1998/07/18 18:34:23 momjian Exp $
|
* $Id: libpq.h,v 1.20 1998/07/20 16:57:06 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -44,7 +44,7 @@ typedef struct
|
|||||||
* Information about an attribute.
|
* Information about an attribute.
|
||||||
* ----------------
|
* ----------------
|
||||||
*/
|
*/
|
||||||
#define NameLength 16
|
#define NameLength NAMEDATALEN
|
||||||
|
|
||||||
typedef struct TypeBlock
|
typedef struct TypeBlock
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 1994, Regents of the University of California
|
* Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: buf_internals.h,v 1.23 1998/07/13 16:34:55 momjian Exp $
|
* $Id: buf_internals.h,v 1.24 1998/07/20 16:57:10 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTE
|
* NOTE
|
||||||
* If BUFFERPAGE0 is defined, then 0 will be used as a
|
* If BUFFERPAGE0 is defined, then 0 will be used as a
|
||||||
@ -86,15 +86,6 @@ struct buftag
|
|||||||
#define BAD_BUFFER_ID(bid) ((bid<1) || (bid>(NBuffers)))
|
#define BAD_BUFFER_ID(bid) ((bid<1) || (bid>(NBuffers)))
|
||||||
#define INVALID_DESCRIPTOR (-3)
|
#define INVALID_DESCRIPTOR (-3)
|
||||||
|
|
||||||
/*
|
|
||||||
* bletch hack -- anyplace that we declare space for relation or
|
|
||||||
* database names, we just use '16', not a symbolic constant, to
|
|
||||||
* specify their lengths. BM_NAMESIZE is the length of these names,
|
|
||||||
* and is used in the buffer manager code. somebody with lots of
|
|
||||||
* spare time should do this for all the other modules, too.
|
|
||||||
*/
|
|
||||||
#define BM_NAMESIZE 16
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* struct sbufdesc -- shared buffer cache metadata for a single
|
* struct sbufdesc -- shared buffer cache metadata for a single
|
||||||
* shared buffer descriptor.
|
* shared buffer descriptor.
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.19 1998/07/09 03:32:09 scrappy Exp $
|
* $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-auth.c,v 1.20 1998/07/20 16:57:13 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
struct authsvc
|
struct authsvc
|
||||||
{
|
{
|
||||||
char name[16]; /* service nickname (for command line) */
|
char name[NAMEDATALEN]; /* service nickname (for command line) */
|
||||||
MsgType msgtype; /* startup packet header type */
|
MsgType msgtype; /* startup packet header type */
|
||||||
int allowed; /* initially allowed (before command line
|
int allowed; /* initially allowed (before command line
|
||||||
* option parsing)? */
|
* option parsing)? */
|
||||||
|
@ -83,7 +83,7 @@ typedef enum {
|
|||||||
#define NO_AUTHENTICATION 7
|
#define NO_AUTHENTICATION 7
|
||||||
#define PATH_SIZE 64
|
#define PATH_SIZE 64
|
||||||
#define ARGV_SIZE 64
|
#define ARGV_SIZE 64
|
||||||
#define NAMEDATALEN 16
|
#define NAMEDATALEN 32
|
||||||
|
|
||||||
typedef unsigned int ProtocolVersion;
|
typedef unsigned int ProtocolVersion;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.26 1998/04/26 04:10:07 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.27 1998/07/20 16:57:18 momjian Exp $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <float.h> /* faked on sunos */
|
#include <float.h> /* faked on sunos */
|
||||||
@ -283,15 +283,15 @@ char *string;
|
|||||||
int len;
|
int len;
|
||||||
char *new_string;
|
char *new_string;
|
||||||
|
|
||||||
if (!(new_string = palloc(16)))
|
if (!(new_string = palloc(NAMEDATALEN)))
|
||||||
{
|
{
|
||||||
fprintf(stderr, "reverse_name: palloc failed\n");
|
fprintf(stderr, "reverse_name: palloc failed\n");
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
MemSet(new_string, 0, 16);
|
MemSet(new_string, 0, NAMEDATALEN);
|
||||||
for (i = 0; i < 16 && string[i]; ++i)
|
for (i = 0; i < NAMEDATALEN && string[i]; ++i)
|
||||||
;
|
;
|
||||||
if (i == 16 || !string[i])
|
if (i == NAMEDATALEN || !string[i])
|
||||||
--i;
|
--i;
|
||||||
len = i;
|
len = i;
|
||||||
for (; i >= 0; --i)
|
for (; i >= 0; --i)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user