More janitorial work: remove the explicit casting of NULL literals to a
pointer type when it is not necessary to do so. For future reference, casting NULL to a pointer type is only necessary when (a) invoking a function AND either (b) the function has no prototype OR (c) the function is a varargs function.
This commit is contained in:
parent
afca5d50dc
commit
192ad63bd7
@ -9,7 +9,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.79 2003/11/29 19:51:39 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/common/printtup.c,v 1.80 2004/01/07 18:56:23 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -509,7 +509,7 @@ debugStartup(DestReceiver *self, int operation, TupleDesc typeinfo)
|
|||||||
* show the return type of the tuples
|
* show the return type of the tuples
|
||||||
*/
|
*/
|
||||||
for (i = 0; i < natts; ++i)
|
for (i = 0; i < natts; ++i)
|
||||||
printatt((unsigned) i + 1, attinfo[i], (char *) NULL);
|
printatt((unsigned) i + 1, attinfo[i], NULL);
|
||||||
printf("\t----\n");
|
printf("\t----\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.106 2003/11/29 19:51:39 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/gist/gist.c,v 1.107 2004/01/07 18:56:23 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -45,10 +45,10 @@
|
|||||||
*/
|
*/
|
||||||
#define FILLITEM(evp, isnullkey, okey, okeyb, rkey, rkeyb) do { \
|
#define FILLITEM(evp, isnullkey, okey, okeyb, rkey, rkeyb) do { \
|
||||||
if ( isnullkey ) { \
|
if ( isnullkey ) { \
|
||||||
gistentryinit((evp), rkey, r, (Page) NULL , \
|
gistentryinit((evp), rkey, r, NULL, \
|
||||||
(OffsetNumber) 0, rkeyb, FALSE); \
|
(OffsetNumber) 0, rkeyb, FALSE); \
|
||||||
} else { \
|
} else { \
|
||||||
gistentryinit((evp), okey, r, (Page) NULL, \
|
gistentryinit((evp), okey, r, NULL, \
|
||||||
(OffsetNumber) 0, okeyb, FALSE); \
|
(OffsetNumber) 0, okeyb, FALSE); \
|
||||||
} \
|
} \
|
||||||
} while(0)
|
} while(0)
|
||||||
@ -248,7 +248,7 @@ gistbuildCallback(Relation index,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
gistcentryinit(&buildstate->giststate, i, &tmpcentry, attdata[i],
|
gistcentryinit(&buildstate->giststate, i, &tmpcentry, attdata[i],
|
||||||
(Relation) NULL, (Page) NULL, (OffsetNumber) 0,
|
NULL, NULL, (OffsetNumber) 0,
|
||||||
-1 /* size is currently bogus */ , TRUE, FALSE);
|
-1 /* size is currently bogus */ , TRUE, FALSE);
|
||||||
if (attdata[i] != tmpcentry.key &&
|
if (attdata[i] != tmpcentry.key &&
|
||||||
!(isAttByVal(&buildstate->giststate, i)))
|
!(isAttByVal(&buildstate->giststate, i)))
|
||||||
@ -332,7 +332,7 @@ gistinsert(PG_FUNCTION_ARGS)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
gistcentryinit(&giststate, i, &tmpentry, datum[i],
|
gistcentryinit(&giststate, i, &tmpentry, datum[i],
|
||||||
(Relation) NULL, (Page) NULL, (OffsetNumber) 0,
|
NULL, NULL, (OffsetNumber) 0,
|
||||||
-1 /* size is currently bogus */ , TRUE, FALSE);
|
-1 /* size is currently bogus */ , TRUE, FALSE);
|
||||||
if (datum[i] != tmpentry.key && !(isAttByVal(&giststate, i)))
|
if (datum[i] != tmpentry.key && !(isAttByVal(&giststate, i)))
|
||||||
compvec[i] = TRUE;
|
compvec[i] = TRUE;
|
||||||
@ -695,7 +695,7 @@ gistunion(Relation r, IndexTuple *itvec, int len, GISTSTATE *giststate)
|
|||||||
gistdentryinit(giststate, j,
|
gistdentryinit(giststate, j,
|
||||||
&((GISTENTRY *) VARDATA(evec))[reallen],
|
&((GISTENTRY *) VARDATA(evec))[reallen],
|
||||||
datum,
|
datum,
|
||||||
(Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
|
NULL, NULL, (OffsetNumber) 0,
|
||||||
ATTSIZE(datum, giststate->tupdesc, j + 1, IsNull), FALSE, IsNull);
|
ATTSIZE(datum, giststate->tupdesc, j + 1, IsNull), FALSE, IsNull);
|
||||||
if ((!isAttByVal(giststate, j)) &&
|
if ((!isAttByVal(giststate, j)) &&
|
||||||
((GISTENTRY *) VARDATA(evec))[reallen].key != datum)
|
((GISTENTRY *) VARDATA(evec))[reallen].key != datum)
|
||||||
@ -717,7 +717,7 @@ gistunion(Relation r, IndexTuple *itvec, int len, GISTSTATE *giststate)
|
|||||||
{
|
{
|
||||||
VARATT_SIZEP(evec) = 2 * sizeof(GISTENTRY) + VARHDRSZ;
|
VARATT_SIZEP(evec) = 2 * sizeof(GISTENTRY) + VARHDRSZ;
|
||||||
gistentryinit(((GISTENTRY *) VARDATA(evec))[1],
|
gistentryinit(((GISTENTRY *) VARDATA(evec))[1],
|
||||||
((GISTENTRY *) VARDATA(evec))[0].key, r, (Page) NULL,
|
((GISTENTRY *) VARDATA(evec))[0].key, r, NULL,
|
||||||
(OffsetNumber) 0, ((GISTENTRY *) VARDATA(evec))[0].bytes, FALSE);
|
(OffsetNumber) 0, ((GISTENTRY *) VARDATA(evec))[0].bytes, FALSE);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -732,7 +732,7 @@ gistunion(Relation r, IndexTuple *itvec, int len, GISTSTATE *giststate)
|
|||||||
pfree(DatumGetPointer(((GISTENTRY *) VARDATA(evec))[i].key));
|
pfree(DatumGetPointer(((GISTENTRY *) VARDATA(evec))[i].key));
|
||||||
|
|
||||||
gistcentryinit(giststate, j, ¢ry[j], datum,
|
gistcentryinit(giststate, j, ¢ry[j], datum,
|
||||||
(Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
|
NULL, NULL, (OffsetNumber) 0,
|
||||||
datumsize, FALSE, FALSE);
|
datumsize, FALSE, FALSE);
|
||||||
isnull[j] = ' ';
|
isnull[j] = ' ';
|
||||||
attr[j] = centry[j].key;
|
attr[j] = centry[j].key;
|
||||||
@ -793,10 +793,10 @@ gistgetadjusted(Relation r, IndexTuple oldtup, IndexTuple addtup, GISTSTATE *gis
|
|||||||
ev0p = &((GISTENTRY *) VARDATA(evec))[0];
|
ev0p = &((GISTENTRY *) VARDATA(evec))[0];
|
||||||
ev1p = &((GISTENTRY *) VARDATA(evec))[1];
|
ev1p = &((GISTENTRY *) VARDATA(evec))[1];
|
||||||
|
|
||||||
gistDeCompressAtt(giststate, r, oldtup, (Page) NULL,
|
gistDeCompressAtt(giststate, r, oldtup, NULL,
|
||||||
(OffsetNumber) 0, oldatt, olddec, oldisnull);
|
(OffsetNumber) 0, oldatt, olddec, oldisnull);
|
||||||
|
|
||||||
gistDeCompressAtt(giststate, r, addtup, (Page) NULL,
|
gistDeCompressAtt(giststate, r, addtup, NULL,
|
||||||
(OffsetNumber) 0, addatt, adddec, addisnull);
|
(OffsetNumber) 0, addatt, adddec, addisnull);
|
||||||
|
|
||||||
|
|
||||||
@ -841,7 +841,7 @@ gistgetadjusted(Relation r, IndexTuple oldtup, IndexTuple addtup, GISTSTATE *gis
|
|||||||
pfree(DatumGetPointer(addatt[j].key));
|
pfree(DatumGetPointer(addatt[j].key));
|
||||||
|
|
||||||
gistcentryinit(giststate, j, ¢ry[j], datum,
|
gistcentryinit(giststate, j, ¢ry[j], datum,
|
||||||
(Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
|
NULL, NULL, (OffsetNumber) 0,
|
||||||
datumsize, FALSE, FALSE);
|
datumsize, FALSE, FALSE);
|
||||||
|
|
||||||
isnull[j] = ' ';
|
isnull[j] = ' ';
|
||||||
@ -929,8 +929,7 @@ gistunionsubkey(Relation r, GISTSTATE *giststate, IndexTuple *itvec, GIST_SPLITV
|
|||||||
gistdentryinit(giststate, j,
|
gistdentryinit(giststate, j,
|
||||||
&((GISTENTRY *) VARDATA(evec))[reallen],
|
&((GISTENTRY *) VARDATA(evec))[reallen],
|
||||||
datum,
|
datum,
|
||||||
(Relation) NULL, (Page) NULL,
|
NULL, NULL, (OffsetNumber) 0,
|
||||||
(OffsetNumber) NULL,
|
|
||||||
ATTSIZE(datum, giststate->tupdesc, j + 1, IsNull), FALSE, IsNull);
|
ATTSIZE(datum, giststate->tupdesc, j + 1, IsNull), FALSE, IsNull);
|
||||||
if ((!isAttByVal(giststate, j)) &&
|
if ((!isAttByVal(giststate, j)) &&
|
||||||
((GISTENTRY *) VARDATA(evec))[reallen].key != datum)
|
((GISTENTRY *) VARDATA(evec))[reallen].key != datum)
|
||||||
@ -1110,7 +1109,7 @@ gistadjsubkey(Relation r,
|
|||||||
{
|
{
|
||||||
if (v->spl_idgrp[i + 1] == 0) /* already inserted */
|
if (v->spl_idgrp[i + 1] == 0) /* already inserted */
|
||||||
continue;
|
continue;
|
||||||
gistDeCompressAtt(giststate, r, itup[i], (Page) NULL, (OffsetNumber) 0,
|
gistDeCompressAtt(giststate, r, itup[i], NULL, (OffsetNumber) 0,
|
||||||
identry, decfree, isnull);
|
identry, decfree, isnull);
|
||||||
|
|
||||||
v->spl_ngrp[v->spl_idgrp[i + 1]]--;
|
v->spl_ngrp[v->spl_idgrp[i + 1]]--;
|
||||||
@ -1127,12 +1126,12 @@ gistadjsubkey(Relation r,
|
|||||||
/* where? */
|
/* where? */
|
||||||
for (j = 1; j < r->rd_att->natts; j++)
|
for (j = 1; j < r->rd_att->natts; j++)
|
||||||
{
|
{
|
||||||
gistentryinit(entry, v->spl_lattr[j], r, (Page) NULL,
|
gistentryinit(entry, v->spl_lattr[j], r, NULL,
|
||||||
(OffsetNumber) 0, v->spl_lattrsize[j], FALSE);
|
(OffsetNumber) 0, v->spl_lattrsize[j], FALSE);
|
||||||
gistpenalty(giststate, j, &entry, v->spl_lisnull[j],
|
gistpenalty(giststate, j, &entry, v->spl_lisnull[j],
|
||||||
&identry[j], isnull[j], &lpenalty);
|
&identry[j], isnull[j], &lpenalty);
|
||||||
|
|
||||||
gistentryinit(entry, v->spl_rattr[j], r, (Page) NULL,
|
gistentryinit(entry, v->spl_rattr[j], r, NULL,
|
||||||
(OffsetNumber) 0, v->spl_rattrsize[j], FALSE);
|
(OffsetNumber) 0, v->spl_rattrsize[j], FALSE);
|
||||||
gistpenalty(giststate, j, &entry, v->spl_risnull[j],
|
gistpenalty(giststate, j, &entry, v->spl_risnull[j],
|
||||||
&identry[j], isnull[j], &rpenalty);
|
&identry[j], isnull[j], &rpenalty);
|
||||||
@ -1486,7 +1485,7 @@ gistchoose(Relation r, Page p, IndexTuple it, /* it has compressed entry */
|
|||||||
which = -1;
|
which = -1;
|
||||||
sum_grow = 1;
|
sum_grow = 1;
|
||||||
gistDeCompressAtt(giststate, r,
|
gistDeCompressAtt(giststate, r,
|
||||||
it, (Page) NULL, (OffsetNumber) 0,
|
it, NULL, (OffsetNumber) 0,
|
||||||
identry, decompvec, isnull);
|
identry, decompvec, isnull);
|
||||||
|
|
||||||
for (i = FirstOffsetNumber; i <= maxoff && sum_grow; i = OffsetNumberNext(i))
|
for (i = FirstOffsetNumber; i <= maxoff && sum_grow; i = OffsetNumberNext(i))
|
||||||
@ -1530,7 +1529,7 @@ gistfreestack(GISTSTACK *s)
|
|||||||
{
|
{
|
||||||
GISTSTACK *p;
|
GISTSTACK *p;
|
||||||
|
|
||||||
while (s != (GISTSTACK *) NULL)
|
while (s != NULL)
|
||||||
{
|
{
|
||||||
p = s->gs_parent;
|
p = s->gs_parent;
|
||||||
pfree(s);
|
pfree(s);
|
||||||
@ -1609,7 +1608,7 @@ gistbulkdelete(PG_FUNCTION_ARGS)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* walk through the entire index */
|
/* walk through the entire index */
|
||||||
iscan = index_beginscan(NULL, rel, SnapshotAny, 0, (ScanKey) NULL);
|
iscan = index_beginscan(NULL, rel, SnapshotAny, 0, NULL);
|
||||||
/* including killed tuples */
|
/* including killed tuples */
|
||||||
iscan->ignore_killed_tuples = false;
|
iscan->ignore_killed_tuples = false;
|
||||||
|
|
||||||
@ -1829,7 +1828,7 @@ gistFormTuple(GISTSTATE *giststate, Relation r,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
gistcentryinit(giststate, j, ¢ry[j], attdata[j],
|
gistcentryinit(giststate, j, ¢ry[j], attdata[j],
|
||||||
(Relation) NULL, (Page) NULL, (OffsetNumber) NULL,
|
NULL, NULL, (OffsetNumber) 0,
|
||||||
datumsize[j], FALSE, FALSE);
|
datumsize[j], FALSE, FALSE);
|
||||||
isnullchar[j] = ' ';
|
isnullchar[j] = ' ';
|
||||||
compatt[j] = centry[j].key;
|
compatt[j] = centry[j].key;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.39 2003/11/29 19:51:39 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/gist/gistget.c,v 1.40 2004/01/07 18:56:23 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -76,7 +76,7 @@ gistfirst(IndexScanDesc s, ScanDirection dir)
|
|||||||
while (n < FirstOffsetNumber || n > maxoff)
|
while (n < FirstOffsetNumber || n > maxoff)
|
||||||
{
|
{
|
||||||
ReleaseBuffer(b);
|
ReleaseBuffer(b);
|
||||||
if (so->s_stack == (GISTSTACK *) NULL)
|
if (so->s_stack == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stk = so->s_stack;
|
stk = so->s_stack;
|
||||||
@ -158,7 +158,7 @@ gistnext(IndexScanDesc s, ScanDirection dir)
|
|||||||
while (n < FirstOffsetNumber || n > maxoff)
|
while (n < FirstOffsetNumber || n > maxoff)
|
||||||
{
|
{
|
||||||
ReleaseBuffer(b);
|
ReleaseBuffer(b);
|
||||||
if (so->s_stack == (GISTSTACK *) NULL)
|
if (so->s_stack == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stk = so->s_stack;
|
stk = so->s_stack;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.50 2003/11/29 19:51:39 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/gist/gistscan.c,v 1.51 2004/01/07 18:56:23 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@ typedef struct GISTScanListData
|
|||||||
typedef GISTScanListData *GISTScanList;
|
typedef GISTScanListData *GISTScanList;
|
||||||
|
|
||||||
/* pointer to list of local scans on GiSTs */
|
/* pointer to list of local scans on GiSTs */
|
||||||
static GISTScanList GISTScans = (GISTScanList) NULL;
|
static GISTScanList GISTScans = NULL;
|
||||||
|
|
||||||
Datum
|
Datum
|
||||||
gistbeginscan(PG_FUNCTION_ARGS)
|
gistbeginscan(PG_FUNCTION_ARGS)
|
||||||
@ -79,19 +79,19 @@ gistrescan(PG_FUNCTION_ARGS)
|
|||||||
ItemPointerSetInvalid(&s->currentMarkData);
|
ItemPointerSetInvalid(&s->currentMarkData);
|
||||||
|
|
||||||
p = (GISTScanOpaque) s->opaque;
|
p = (GISTScanOpaque) s->opaque;
|
||||||
if (p != (GISTScanOpaque) NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
/* rescan an existing indexscan --- reset state */
|
/* rescan an existing indexscan --- reset state */
|
||||||
gistfreestack(p->s_stack);
|
gistfreestack(p->s_stack);
|
||||||
gistfreestack(p->s_markstk);
|
gistfreestack(p->s_markstk);
|
||||||
p->s_stack = p->s_markstk = (GISTSTACK *) NULL;
|
p->s_stack = p->s_markstk = NULL;
|
||||||
p->s_flags = 0x0;
|
p->s_flags = 0x0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* initialize opaque data */
|
/* initialize opaque data */
|
||||||
p = (GISTScanOpaque) palloc(sizeof(GISTScanOpaqueData));
|
p = (GISTScanOpaque) palloc(sizeof(GISTScanOpaqueData));
|
||||||
p->s_stack = p->s_markstk = (GISTSTACK *) NULL;
|
p->s_stack = p->s_markstk = NULL;
|
||||||
p->s_flags = 0x0;
|
p->s_flags = 0x0;
|
||||||
s->opaque = p;
|
s->opaque = p;
|
||||||
p->giststate = (GISTSTATE *) palloc(sizeof(GISTSTATE));
|
p->giststate = (GISTSTATE *) palloc(sizeof(GISTSTATE));
|
||||||
@ -137,11 +137,11 @@ gistmarkpos(PG_FUNCTION_ARGS)
|
|||||||
else
|
else
|
||||||
p->s_flags &= ~GS_MRKBEFORE;
|
p->s_flags &= ~GS_MRKBEFORE;
|
||||||
|
|
||||||
o = (GISTSTACK *) NULL;
|
o = NULL;
|
||||||
n = p->s_stack;
|
n = p->s_stack;
|
||||||
|
|
||||||
/* copy the parent stack from the current item data */
|
/* copy the parent stack from the current item data */
|
||||||
while (n != (GISTSTACK *) NULL)
|
while (n != NULL)
|
||||||
{
|
{
|
||||||
tmp = (GISTSTACK *) palloc(sizeof(GISTSTACK));
|
tmp = (GISTSTACK *) palloc(sizeof(GISTSTACK));
|
||||||
tmp->gs_child = n->gs_child;
|
tmp->gs_child = n->gs_child;
|
||||||
@ -173,11 +173,11 @@ gistrestrpos(PG_FUNCTION_ARGS)
|
|||||||
else
|
else
|
||||||
p->s_flags &= ~GS_CURBEFORE;
|
p->s_flags &= ~GS_CURBEFORE;
|
||||||
|
|
||||||
o = (GISTSTACK *) NULL;
|
o = NULL;
|
||||||
n = p->s_markstk;
|
n = p->s_markstk;
|
||||||
|
|
||||||
/* copy the parent stack from the current item data */
|
/* copy the parent stack from the current item data */
|
||||||
while (n != (GISTSTACK *) NULL)
|
while (n != NULL)
|
||||||
{
|
{
|
||||||
tmp = (GISTSTACK *) palloc(sizeof(GISTSTACK));
|
tmp = (GISTSTACK *) palloc(sizeof(GISTSTACK));
|
||||||
tmp->gs_child = n->gs_child;
|
tmp->gs_child = n->gs_child;
|
||||||
@ -201,7 +201,7 @@ gistendscan(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
p = (GISTScanOpaque) s->opaque;
|
p = (GISTScanOpaque) s->opaque;
|
||||||
|
|
||||||
if (p != (GISTScanOpaque) NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
gistfreestack(p->s_stack);
|
gistfreestack(p->s_stack);
|
||||||
gistfreestack(p->s_markstk);
|
gistfreestack(p->s_markstk);
|
||||||
@ -233,18 +233,16 @@ gistdropscan(IndexScanDesc s)
|
|||||||
GISTScanList l;
|
GISTScanList l;
|
||||||
GISTScanList prev;
|
GISTScanList prev;
|
||||||
|
|
||||||
prev = (GISTScanList) NULL;
|
prev = NULL;
|
||||||
|
|
||||||
for (l = GISTScans;
|
for (l = GISTScans; l != NULL && l->gsl_scan != s; l = l->gsl_next)
|
||||||
l != (GISTScanList) NULL && l->gsl_scan != s;
|
|
||||||
l = l->gsl_next)
|
|
||||||
prev = l;
|
prev = l;
|
||||||
|
|
||||||
if (l == (GISTScanList) NULL)
|
if (l == NULL)
|
||||||
elog(ERROR, "GiST scan list corrupted -- could not find 0x%p",
|
elog(ERROR, "GiST scan list corrupted -- could not find 0x%p",
|
||||||
(void *) s);
|
(void *) s);
|
||||||
|
|
||||||
if (prev == (GISTScanList) NULL)
|
if (prev == NULL)
|
||||||
GISTScans = l->gsl_next;
|
GISTScans = l->gsl_next;
|
||||||
else
|
else
|
||||||
prev->gsl_next = l->gsl_next;
|
prev->gsl_next = l->gsl_next;
|
||||||
@ -280,7 +278,7 @@ gistadjscans(Relation rel, int op, BlockNumber blkno, OffsetNumber offnum)
|
|||||||
Oid relid;
|
Oid relid;
|
||||||
|
|
||||||
relid = RelationGetRelid(rel);
|
relid = RelationGetRelid(rel);
|
||||||
for (l = GISTScans; l != (GISTScanList) NULL; l = l->gsl_next)
|
for (l = GISTScans; l != NULL; l = l->gsl_next)
|
||||||
{
|
{
|
||||||
if (l->gsl_scan->indexRelation->rd_id == relid)
|
if (l->gsl_scan->indexRelation->rd_id == relid)
|
||||||
gistadjone(l->gsl_scan, op, blkno, offnum);
|
gistadjone(l->gsl_scan, op, blkno, offnum);
|
||||||
@ -397,12 +395,10 @@ adjustiptr(IndexScanDesc s,
|
|||||||
* are looking at already in this transaction, we ignore the update
|
* are looking at already in this transaction, we ignore the update
|
||||||
* request.
|
* request.
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
|
||||||
static void
|
static void
|
||||||
adjuststack(GISTSTACK *stk,
|
adjuststack(GISTSTACK *stk, BlockNumber blkno)
|
||||||
BlockNumber blkno)
|
|
||||||
{
|
{
|
||||||
while (stk != (GISTSTACK *) NULL)
|
while (stk != NULL)
|
||||||
{
|
{
|
||||||
if (stk->gs_blk == blkno)
|
if (stk->gs_blk == blkno)
|
||||||
stk->gs_child = FirstOffsetNumber;
|
stk->gs_child = FirstOffsetNumber;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.69 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/hash/hash.c,v 1.70 2004/01/07 18:56:23 neilc Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This file contains only the public interface routines.
|
* This file contains only the public interface routines.
|
||||||
@ -180,7 +180,7 @@ hashinsert(PG_FUNCTION_ARGS)
|
|||||||
if (IndexTupleHasNulls(itup))
|
if (IndexTupleHasNulls(itup))
|
||||||
{
|
{
|
||||||
pfree(itup);
|
pfree(itup);
|
||||||
PG_RETURN_POINTER((InsertIndexResult) NULL);
|
PG_RETURN_POINTER(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
hitem = _hash_formitem(itup);
|
hitem = _hash_formitem(itup);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/hash/hashscan.c,v 1.32 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/hash/hashscan.c,v 1.33 2004/01/07 18:56:23 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -26,7 +26,7 @@ typedef struct HashScanListData
|
|||||||
|
|
||||||
typedef HashScanListData *HashScanList;
|
typedef HashScanListData *HashScanList;
|
||||||
|
|
||||||
static HashScanList HashScans = (HashScanList) NULL;
|
static HashScanList HashScans = NULL;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -73,16 +73,16 @@ _hash_dropscan(IndexScanDesc scan)
|
|||||||
HashScanList chk,
|
HashScanList chk,
|
||||||
last;
|
last;
|
||||||
|
|
||||||
last = (HashScanList) NULL;
|
last = NULL;
|
||||||
for (chk = HashScans;
|
for (chk = HashScans;
|
||||||
chk != (HashScanList) NULL && chk->hashsl_scan != scan;
|
chk != NULL && chk->hashsl_scan != scan;
|
||||||
chk = chk->hashsl_next)
|
chk = chk->hashsl_next)
|
||||||
last = chk;
|
last = chk;
|
||||||
|
|
||||||
if (chk == (HashScanList) NULL)
|
if (chk == NULL)
|
||||||
elog(ERROR, "hash scan list trashed; can't find 0x%p", (void *) scan);
|
elog(ERROR, "hash scan list trashed; can't find 0x%p", (void *) scan);
|
||||||
|
|
||||||
if (last == (HashScanList) NULL)
|
if (last == NULL)
|
||||||
HashScans = chk->hashsl_next;
|
HashScans = chk->hashsl_next;
|
||||||
else
|
else
|
||||||
last->hashsl_next = chk->hashsl_next;
|
last->hashsl_next = chk->hashsl_next;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.160 2004/01/05 20:36:04 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/access/heap/heapam.c,v 1.161 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -124,7 +124,7 @@ heapgettup(Relation relation,
|
|||||||
int linesleft;
|
int linesleft;
|
||||||
ItemPointer tid;
|
ItemPointer tid;
|
||||||
|
|
||||||
tid = (tuple->t_data == NULL) ? (ItemPointer) NULL : &(tuple->t_self);
|
tid = (tuple->t_data == NULL) ? NULL : &(tuple->t_self);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* debugging stuff
|
* debugging stuff
|
||||||
@ -919,7 +919,7 @@ heap_fetch(Relation relation,
|
|||||||
* check time qualification of tuple, then release lock
|
* check time qualification of tuple, then release lock
|
||||||
*/
|
*/
|
||||||
HeapTupleSatisfies(tuple, relation, buffer, dp,
|
HeapTupleSatisfies(tuple, relation, buffer, dp,
|
||||||
snapshot, 0, (ScanKey) NULL, valid);
|
snapshot, 0, NULL, valid);
|
||||||
|
|
||||||
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
|
LockBuffer(buffer, BUFFER_LOCK_UNLOCK);
|
||||||
|
|
||||||
@ -1026,7 +1026,7 @@ heap_get_latest_tid(Relation relation,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
HeapTupleSatisfies(&tp, relation, buffer, dp,
|
HeapTupleSatisfies(&tp, relation, buffer, dp,
|
||||||
snapshot, 0, (ScanKey) NULL, valid);
|
snapshot, 0, NULL, valid);
|
||||||
|
|
||||||
linkend = true;
|
linkend = true;
|
||||||
if ((t_data->t_infomask & HEAP_XMIN_COMMITTED) != 0 &&
|
if ((t_data->t_infomask & HEAP_XMIN_COMMITTED) != 0 &&
|
||||||
@ -1946,7 +1946,7 @@ heap_restrpos(HeapScanDesc scan)
|
|||||||
&(scan->rs_cbuf),
|
&(scan->rs_cbuf),
|
||||||
scan->rs_snapshot,
|
scan->rs_snapshot,
|
||||||
0,
|
0,
|
||||||
(ScanKey) NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.110 2003/12/21 01:23:06 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.111 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1186,7 +1186,7 @@ _bt_insert_parent(Relation rel,
|
|||||||
{
|
{
|
||||||
Buffer rootbuf;
|
Buffer rootbuf;
|
||||||
|
|
||||||
Assert(stack == (BTStack) NULL);
|
Assert(stack == NULL);
|
||||||
Assert(is_only);
|
Assert(is_only);
|
||||||
/* create a new root node and update the metapage */
|
/* create a new root node and update the metapage */
|
||||||
rootbuf = _bt_newroot(rel, buf, rbuf);
|
rootbuf = _bt_newroot(rel, buf, rbuf);
|
||||||
@ -1206,7 +1206,7 @@ _bt_insert_parent(Relation rel,
|
|||||||
BTItem ritem;
|
BTItem ritem;
|
||||||
Buffer pbuf;
|
Buffer pbuf;
|
||||||
|
|
||||||
if (stack == (BTStack) NULL)
|
if (stack == NULL)
|
||||||
{
|
{
|
||||||
BTPageOpaque lpageop;
|
BTPageOpaque lpageop;
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.108 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtree.c,v 1.109 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -396,7 +396,7 @@ btrescan(PG_FUNCTION_ARGS)
|
|||||||
if (scan->numberOfKeys > 0)
|
if (scan->numberOfKeys > 0)
|
||||||
so->keyData = (ScanKey) palloc(scan->numberOfKeys * sizeof(ScanKeyData));
|
so->keyData = (ScanKey) palloc(scan->numberOfKeys * sizeof(ScanKeyData));
|
||||||
else
|
else
|
||||||
so->keyData = (ScanKey) NULL;
|
so->keyData = NULL;
|
||||||
scan->opaque = so;
|
scan->opaque = so;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -459,7 +459,7 @@ btendscan(PG_FUNCTION_ARGS)
|
|||||||
ItemPointerSetInvalid(iptr);
|
ItemPointerSetInvalid(iptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (so->keyData != (ScanKey) NULL)
|
if (so->keyData != NULL)
|
||||||
pfree(so->keyData);
|
pfree(so->keyData);
|
||||||
pfree(so);
|
pfree(so);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.79 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtsort.c,v 1.80 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -257,7 +257,7 @@ _bt_pagestate(Relation index, uint32 level)
|
|||||||
/* create initial page */
|
/* create initial page */
|
||||||
_bt_blnewpage(index, &(state->btps_buf), &(state->btps_page), level);
|
_bt_blnewpage(index, &(state->btps_buf), &(state->btps_page), level);
|
||||||
|
|
||||||
state->btps_minkey = (BTItem) NULL;
|
state->btps_minkey = NULL;
|
||||||
/* initialize lastoff so first item goes into P_FIRSTKEY */
|
/* initialize lastoff so first item goes into P_FIRSTKEY */
|
||||||
state->btps_lastoff = P_HIKEY;
|
state->btps_lastoff = P_HIKEY;
|
||||||
state->btps_level = level;
|
state->btps_level = level;
|
||||||
@ -267,7 +267,7 @@ _bt_pagestate(Relation index, uint32 level)
|
|||||||
else
|
else
|
||||||
state->btps_full = PageGetPageSize(state->btps_page) / 10;
|
state->btps_full = PageGetPageSize(state->btps_page) / 10;
|
||||||
/* no parent level, yet */
|
/* no parent level, yet */
|
||||||
state->btps_next = (BTPageState *) NULL;
|
state->btps_next = NULL;
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
@ -444,7 +444,7 @@ _bt_buildadd(Relation index, BTPageState *state, BTItem bti)
|
|||||||
* we don't have a parent, we have to create one; this adds a new
|
* we don't have a parent, we have to create one; this adds a new
|
||||||
* btree level.
|
* btree level.
|
||||||
*/
|
*/
|
||||||
if (state->btps_next == (BTPageState *) NULL)
|
if (state->btps_next == NULL)
|
||||||
state->btps_next = _bt_pagestate(index, state->btps_level + 1);
|
state->btps_next = _bt_pagestate(index, state->btps_level + 1);
|
||||||
|
|
||||||
Assert(state->btps_minkey != NULL);
|
Assert(state->btps_minkey != NULL);
|
||||||
@ -520,7 +520,7 @@ _bt_uppershutdown(Relation index, BTPageState *state)
|
|||||||
/*
|
/*
|
||||||
* Each iteration of this loop completes one more level of the tree.
|
* Each iteration of this loop completes one more level of the tree.
|
||||||
*/
|
*/
|
||||||
for (s = state; s != (BTPageState *) NULL; s = s->btps_next)
|
for (s = state; s != NULL; s = s->btps_next)
|
||||||
{
|
{
|
||||||
BlockNumber blkno;
|
BlockNumber blkno;
|
||||||
BTPageOpaque opaque;
|
BTPageOpaque opaque;
|
||||||
@ -536,7 +536,7 @@ _bt_uppershutdown(Relation index, BTPageState *state)
|
|||||||
* key. This may cause the last page of the parent level to
|
* key. This may cause the last page of the parent level to
|
||||||
* split, but that's not a problem -- we haven't gotten to it yet.
|
* split, but that's not a problem -- we haven't gotten to it yet.
|
||||||
*/
|
*/
|
||||||
if (s->btps_next == (BTPageState *) NULL)
|
if (s->btps_next == NULL)
|
||||||
{
|
{
|
||||||
opaque->btpo_flags |= BTP_ROOT;
|
opaque->btpo_flags |= BTP_ROOT;
|
||||||
rootblkno = blkno;
|
rootblkno = blkno;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.57 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtutils.c,v 1.58 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -126,7 +126,7 @@ _bt_freestack(BTStack stack)
|
|||||||
{
|
{
|
||||||
BTStack ostack;
|
BTStack ostack;
|
||||||
|
|
||||||
while (stack != (BTStack) NULL)
|
while (stack != NULL)
|
||||||
{
|
{
|
||||||
ostack = stack;
|
ostack = stack;
|
||||||
stack = stack->bts_parent;
|
stack = stack->bts_parent;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.9 2003/12/14 00:34:47 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtxlog.c,v 1.10 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -995,7 +995,7 @@ btree_xlog_cleanup(void)
|
|||||||
/* if the two pages are all of their level, it's a only-page split */
|
/* if the two pages are all of their level, it's a only-page split */
|
||||||
is_only = P_LEFTMOST(lpageop) && P_RIGHTMOST(rpageop);
|
is_only = P_LEFTMOST(lpageop) && P_RIGHTMOST(rpageop);
|
||||||
|
|
||||||
_bt_insert_parent(reln, lbuf, rbuf, (BTStack) NULL,
|
_bt_insert_parent(reln, lbuf, rbuf, NULL,
|
||||||
split->is_root, is_only);
|
split->is_root, is_only);
|
||||||
}
|
}
|
||||||
incomplete_splits = NIL;
|
incomplete_splits = NIL;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/rtree/rtget.c,v 1.30 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/rtree/rtget.c,v 1.31 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -74,7 +74,7 @@ rtfirst(IndexScanDesc s, ScanDirection dir)
|
|||||||
while (n < FirstOffsetNumber || n > maxoff)
|
while (n < FirstOffsetNumber || n > maxoff)
|
||||||
{
|
{
|
||||||
ReleaseBuffer(b);
|
ReleaseBuffer(b);
|
||||||
if (so->s_stack == (RTSTACK *) NULL)
|
if (so->s_stack == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stk = so->s_stack;
|
stk = so->s_stack;
|
||||||
@ -156,7 +156,7 @@ rtnext(IndexScanDesc s, ScanDirection dir)
|
|||||||
while (n < FirstOffsetNumber || n > maxoff)
|
while (n < FirstOffsetNumber || n > maxoff)
|
||||||
{
|
{
|
||||||
ReleaseBuffer(b);
|
ReleaseBuffer(b);
|
||||||
if (so->s_stack == (RTSTACK *) NULL)
|
if (so->s_stack == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
stk = so->s_stack;
|
stk = so->s_stack;
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/rtree/rtproc.c,v 1.39 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/rtree/rtproc.c,v 1.40 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -74,7 +74,7 @@ rt_box_size(PG_FUNCTION_ARGS)
|
|||||||
/* NB: size is an output argument */
|
/* NB: size is an output argument */
|
||||||
float *size = (float *) PG_GETARG_POINTER(1);
|
float *size = (float *) PG_GETARG_POINTER(1);
|
||||||
|
|
||||||
if (a == (BOX *) NULL || a->high.x <= a->low.x || a->high.y <= a->low.y)
|
if (a == NULL || a->high.x <= a->low.x || a->high.y <= a->low.y)
|
||||||
*size = 0.0;
|
*size = 0.0;
|
||||||
else
|
else
|
||||||
*size = (float) ((a->high.x - a->low.x) * (a->high.y - a->low.y));
|
*size = (float) ((a->high.x - a->low.x) * (a->high.y - a->low.y));
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/rtree/rtree.c,v 1.81 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/rtree/rtree.c,v 1.82 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -244,7 +244,7 @@ rtinsert(PG_FUNCTION_ARGS)
|
|||||||
if (IndexTupleHasNulls(itup))
|
if (IndexTupleHasNulls(itup))
|
||||||
{
|
{
|
||||||
pfree(itup);
|
pfree(itup);
|
||||||
PG_RETURN_POINTER((InsertIndexResult) NULL);
|
PG_RETURN_POINTER(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
initRtstate(&rtState, r);
|
initRtstate(&rtState, r);
|
||||||
@ -275,7 +275,7 @@ rtdoinsert(Relation r, IndexTuple itup, RTSTATE *rtstate)
|
|||||||
|
|
||||||
blk = P_ROOT;
|
blk = P_ROOT;
|
||||||
buffer = InvalidBuffer;
|
buffer = InvalidBuffer;
|
||||||
stack = (RTSTACK *) NULL;
|
stack = NULL;
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -360,7 +360,7 @@ rttighten(Relation r,
|
|||||||
newd_size;
|
newd_size;
|
||||||
Buffer b;
|
Buffer b;
|
||||||
|
|
||||||
if (stk == (RTSTACK *) NULL)
|
if (stk == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
b = ReadBuffer(r, stk->rts_blk);
|
b = ReadBuffer(r, stk->rts_blk);
|
||||||
@ -622,7 +622,7 @@ rtintinsert(Relation r,
|
|||||||
newdatum;
|
newdatum;
|
||||||
InsertIndexResult res;
|
InsertIndexResult res;
|
||||||
|
|
||||||
if (stk == (RTSTACK *) NULL)
|
if (stk == NULL)
|
||||||
{
|
{
|
||||||
rtnewroot(r, ltup, rtup);
|
rtnewroot(r, ltup, rtup);
|
||||||
return;
|
return;
|
||||||
@ -912,7 +912,7 @@ rtpicksplit(Relation r,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* to keep compiler quiet */
|
/* to keep compiler quiet */
|
||||||
cost_vector = (SPLITCOST *) NULL;
|
cost_vector = NULL;
|
||||||
|
|
||||||
if (num_tuples_without_seeds > 0)
|
if (num_tuples_without_seeds > 0)
|
||||||
{
|
{
|
||||||
@ -1172,7 +1172,7 @@ freestack(RTSTACK *s)
|
|||||||
{
|
{
|
||||||
RTSTACK *p;
|
RTSTACK *p;
|
||||||
|
|
||||||
while (s != (RTSTACK *) NULL)
|
while (s != NULL)
|
||||||
{
|
{
|
||||||
p = s->rts_parent;
|
p = s->rts_parent;
|
||||||
pfree(s);
|
pfree(s);
|
||||||
@ -1213,7 +1213,7 @@ rtbulkdelete(PG_FUNCTION_ARGS)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* walk through the entire index */
|
/* walk through the entire index */
|
||||||
iscan = index_beginscan(NULL, rel, SnapshotAny, 0, (ScanKey) NULL);
|
iscan = index_beginscan(NULL, rel, SnapshotAny, 0, NULL);
|
||||||
/* including killed tuples */
|
/* including killed tuples */
|
||||||
iscan->ignore_killed_tuples = false;
|
iscan->ignore_killed_tuples = false;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/rtree/rtscan.c,v 1.50 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/rtree/rtscan.c,v 1.51 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -48,7 +48,7 @@ typedef struct RTScanListData
|
|||||||
typedef RTScanListData *RTScanList;
|
typedef RTScanListData *RTScanList;
|
||||||
|
|
||||||
/* pointer to list of local scans on rtrees */
|
/* pointer to list of local scans on rtrees */
|
||||||
static RTScanList RTScans = (RTScanList) NULL;
|
static RTScanList RTScans = NULL;
|
||||||
|
|
||||||
Datum
|
Datum
|
||||||
rtbeginscan(PG_FUNCTION_ARGS)
|
rtbeginscan(PG_FUNCTION_ARGS)
|
||||||
@ -80,19 +80,19 @@ rtrescan(PG_FUNCTION_ARGS)
|
|||||||
ItemPointerSetInvalid(&s->currentMarkData);
|
ItemPointerSetInvalid(&s->currentMarkData);
|
||||||
|
|
||||||
p = (RTreeScanOpaque) s->opaque;
|
p = (RTreeScanOpaque) s->opaque;
|
||||||
if (p != (RTreeScanOpaque) NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
/* rescan an existing indexscan --- reset state */
|
/* rescan an existing indexscan --- reset state */
|
||||||
freestack(p->s_stack);
|
freestack(p->s_stack);
|
||||||
freestack(p->s_markstk);
|
freestack(p->s_markstk);
|
||||||
p->s_stack = p->s_markstk = (RTSTACK *) NULL;
|
p->s_stack = p->s_markstk = NULL;
|
||||||
p->s_flags = 0x0;
|
p->s_flags = 0x0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* initialize opaque data */
|
/* initialize opaque data */
|
||||||
p = (RTreeScanOpaque) palloc(sizeof(RTreeScanOpaqueData));
|
p = (RTreeScanOpaque) palloc(sizeof(RTreeScanOpaqueData));
|
||||||
p->s_stack = p->s_markstk = (RTSTACK *) NULL;
|
p->s_stack = p->s_markstk = NULL;
|
||||||
p->s_internalNKey = s->numberOfKeys;
|
p->s_internalNKey = s->numberOfKeys;
|
||||||
p->s_flags = 0x0;
|
p->s_flags = 0x0;
|
||||||
s->opaque = p;
|
s->opaque = p;
|
||||||
@ -156,11 +156,11 @@ rtmarkpos(PG_FUNCTION_ARGS)
|
|||||||
else
|
else
|
||||||
p->s_flags &= ~RTS_MRKBEFORE;
|
p->s_flags &= ~RTS_MRKBEFORE;
|
||||||
|
|
||||||
o = (RTSTACK *) NULL;
|
o = NULL;
|
||||||
n = p->s_stack;
|
n = p->s_stack;
|
||||||
|
|
||||||
/* copy the parent stack from the current item data */
|
/* copy the parent stack from the current item data */
|
||||||
while (n != (RTSTACK *) NULL)
|
while (n != NULL)
|
||||||
{
|
{
|
||||||
tmp = (RTSTACK *) palloc(sizeof(RTSTACK));
|
tmp = (RTSTACK *) palloc(sizeof(RTSTACK));
|
||||||
tmp->rts_child = n->rts_child;
|
tmp->rts_child = n->rts_child;
|
||||||
@ -192,11 +192,11 @@ rtrestrpos(PG_FUNCTION_ARGS)
|
|||||||
else
|
else
|
||||||
p->s_flags &= ~RTS_CURBEFORE;
|
p->s_flags &= ~RTS_CURBEFORE;
|
||||||
|
|
||||||
o = (RTSTACK *) NULL;
|
o = NULL;
|
||||||
n = p->s_markstk;
|
n = p->s_markstk;
|
||||||
|
|
||||||
/* copy the parent stack from the current item data */
|
/* copy the parent stack from the current item data */
|
||||||
while (n != (RTSTACK *) NULL)
|
while (n != NULL)
|
||||||
{
|
{
|
||||||
tmp = (RTSTACK *) palloc(sizeof(RTSTACK));
|
tmp = (RTSTACK *) palloc(sizeof(RTSTACK));
|
||||||
tmp->rts_child = n->rts_child;
|
tmp->rts_child = n->rts_child;
|
||||||
@ -220,7 +220,7 @@ rtendscan(PG_FUNCTION_ARGS)
|
|||||||
|
|
||||||
p = (RTreeScanOpaque) s->opaque;
|
p = (RTreeScanOpaque) s->opaque;
|
||||||
|
|
||||||
if (p != (RTreeScanOpaque) NULL)
|
if (p != NULL)
|
||||||
{
|
{
|
||||||
freestack(p->s_stack);
|
freestack(p->s_stack);
|
||||||
freestack(p->s_markstk);
|
freestack(p->s_markstk);
|
||||||
@ -250,18 +250,18 @@ rtdropscan(IndexScanDesc s)
|
|||||||
RTScanList l;
|
RTScanList l;
|
||||||
RTScanList prev;
|
RTScanList prev;
|
||||||
|
|
||||||
prev = (RTScanList) NULL;
|
prev = NULL;
|
||||||
|
|
||||||
for (l = RTScans;
|
for (l = RTScans;
|
||||||
l != (RTScanList) NULL && l->rtsl_scan != s;
|
l != NULL && l->rtsl_scan != s;
|
||||||
l = l->rtsl_next)
|
l = l->rtsl_next)
|
||||||
prev = l;
|
prev = l;
|
||||||
|
|
||||||
if (l == (RTScanList) NULL)
|
if (l == NULL)
|
||||||
elog(ERROR, "rtree scan list corrupted -- could not find 0x%p",
|
elog(ERROR, "rtree scan list corrupted -- could not find 0x%p",
|
||||||
(void *) s);
|
(void *) s);
|
||||||
|
|
||||||
if (prev == (RTScanList) NULL)
|
if (prev == NULL)
|
||||||
RTScans = l->rtsl_next;
|
RTScans = l->rtsl_next;
|
||||||
else
|
else
|
||||||
prev->rtsl_next = l->rtsl_next;
|
prev->rtsl_next = l->rtsl_next;
|
||||||
@ -297,7 +297,7 @@ rtadjscans(Relation r, int op, BlockNumber blkno, OffsetNumber offnum)
|
|||||||
Oid relid;
|
Oid relid;
|
||||||
|
|
||||||
relid = RelationGetRelid(r);
|
relid = RelationGetRelid(r);
|
||||||
for (l = RTScans; l != (RTScanList) NULL; l = l->rtsl_next)
|
for (l = RTScans; l != NULL; l = l->rtsl_next)
|
||||||
{
|
{
|
||||||
if (RelationGetRelid(l->rtsl_scan->indexRelation) == relid)
|
if (RelationGetRelid(l->rtsl_scan->indexRelation) == relid)
|
||||||
rtadjone(l->rtsl_scan, op, blkno, offnum);
|
rtadjone(l->rtsl_scan, op, blkno, offnum);
|
||||||
@ -414,12 +414,10 @@ adjustiptr(IndexScanDesc s,
|
|||||||
* are looking at already in this transaction, we ignore the update
|
* are looking at already in this transaction, we ignore the update
|
||||||
* request.
|
* request.
|
||||||
*/
|
*/
|
||||||
/*ARGSUSED*/
|
|
||||||
static void
|
static void
|
||||||
adjuststack(RTSTACK *stk,
|
adjuststack(RTSTACK *stk, BlockNumber blkno)
|
||||||
BlockNumber blkno)
|
|
||||||
{
|
{
|
||||||
while (stk != (RTSTACK *) NULL)
|
while (stk != NULL)
|
||||||
{
|
{
|
||||||
if (stk->rts_blk == blkno)
|
if (stk->rts_blk == blkno)
|
||||||
stk->rts_child = FirstOffsetNumber;
|
stk->rts_child = FirstOffsetNumber;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.53 2003/11/29 19:51:40 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/varsup.c,v 1.54 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -77,7 +77,7 @@ GetNewTransactionId(void)
|
|||||||
* (SInvalLock would then mean primarily that PROCs couldn't be added/
|
* (SInvalLock would then mean primarily that PROCs couldn't be added/
|
||||||
* removed while holding the lock.)
|
* removed while holding the lock.)
|
||||||
*/
|
*/
|
||||||
if (MyProc != (PGPROC *) NULL)
|
if (MyProc != NULL)
|
||||||
MyProc->xid = xid;
|
MyProc->xid = xid;
|
||||||
|
|
||||||
LWLockRelease(XidGenLock);
|
LWLockRelease(XidGenLock);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.158 2003/12/02 19:26:47 joe Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.159 2004/01/07 18:56:24 neilc Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Transaction aborts can now occur two ways:
|
* Transaction aborts can now occur two ways:
|
||||||
@ -947,7 +947,7 @@ CommitTransaction(void)
|
|||||||
* as running as well or it will see two tuple versions - one deleted
|
* as running as well or it will see two tuple versions - one deleted
|
||||||
* by xid 1 and one inserted by xid 0. See notes in GetSnapshotData.
|
* by xid 1 and one inserted by xid 0. See notes in GetSnapshotData.
|
||||||
*/
|
*/
|
||||||
if (MyProc != (PGPROC *) NULL)
|
if (MyProc != NULL)
|
||||||
{
|
{
|
||||||
/* Lock SInvalLock because that's what GetSnapshotData uses. */
|
/* Lock SInvalLock because that's what GetSnapshotData uses. */
|
||||||
LWLockAcquire(SInvalLock, LW_EXCLUSIVE);
|
LWLockAcquire(SInvalLock, LW_EXCLUSIVE);
|
||||||
@ -1064,7 +1064,7 @@ AbortTransaction(void)
|
|||||||
* this must be done _before_ releasing locks we hold and _after_
|
* this must be done _before_ releasing locks we hold and _after_
|
||||||
* RecordTransactionAbort.
|
* RecordTransactionAbort.
|
||||||
*/
|
*/
|
||||||
if (MyProc != (PGPROC *) NULL)
|
if (MyProc != NULL)
|
||||||
{
|
{
|
||||||
/* Lock SInvalLock because that's what GetSnapshotData uses. */
|
/* Lock SInvalLock because that's what GetSnapshotData uses. */
|
||||||
LWLockAcquire(SInvalLock, LW_EXCLUSIVE);
|
LWLockAcquire(SInvalLock, LW_EXCLUSIVE);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.63 2003/11/29 19:51:41 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/bootstrap/bootparse.y,v 1.64 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -220,7 +220,7 @@ Boot_InsertStmt:
|
|||||||
if (num_columns_read != numattr)
|
if (num_columns_read != numattr)
|
||||||
elog(ERROR, "incorrect number of columns in row (expected %d, got %d)",
|
elog(ERROR, "incorrect number of columns in row (expected %d, got %d)",
|
||||||
numattr, num_columns_read);
|
numattr, num_columns_read);
|
||||||
if (boot_reldesc == (Relation) NULL)
|
if (boot_reldesc == NULL)
|
||||||
{
|
{
|
||||||
elog(ERROR, "relation not open");
|
elog(ERROR, "relation not open");
|
||||||
err_out();
|
err_out();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.174 2004/01/06 23:55:18 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/bootstrap/bootstrap.c,v 1.175 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -142,8 +142,8 @@ struct typmap
|
|||||||
FormData_pg_type am_typ;
|
FormData_pg_type am_typ;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct typmap **Typ = (struct typmap **) NULL;
|
static struct typmap **Typ = NULL;
|
||||||
static struct typmap *Ap = (struct typmap *) NULL;
|
static struct typmap *Ap = NULL;
|
||||||
|
|
||||||
static int Warnings = 0;
|
static int Warnings = 0;
|
||||||
static char Blanks[MAXATTR];
|
static char Blanks[MAXATTR];
|
||||||
@ -173,7 +173,7 @@ typedef struct _IndexList
|
|||||||
struct _IndexList *il_next;
|
struct _IndexList *il_next;
|
||||||
} IndexList;
|
} IndexList;
|
||||||
|
|
||||||
static IndexList *ILHead = (IndexList *) NULL;
|
static IndexList *ILHead = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* ----------------------------------------------------------------
|
/* ----------------------------------------------------------------
|
||||||
@ -509,7 +509,7 @@ BootstrapMain(int argc, char *argv[])
|
|||||||
/* Initialize stuff for bootstrap-file processing */
|
/* Initialize stuff for bootstrap-file processing */
|
||||||
for (i = 0; i < MAXATTR; i++)
|
for (i = 0; i < MAXATTR; i++)
|
||||||
{
|
{
|
||||||
attrtypes[i] = (Form_pg_attribute) NULL;
|
attrtypes[i] = NULL;
|
||||||
Blanks[i] = ' ';
|
Blanks[i] = ' ';
|
||||||
}
|
}
|
||||||
for (i = 0; i < STRTABLESIZE; ++i)
|
for (i = 0; i < STRTABLESIZE; ++i)
|
||||||
@ -569,10 +569,10 @@ boot_openrel(char *relname)
|
|||||||
if (strlen(relname) >= NAMEDATALEN - 1)
|
if (strlen(relname) >= NAMEDATALEN - 1)
|
||||||
relname[NAMEDATALEN - 1] = '\0';
|
relname[NAMEDATALEN - 1] = '\0';
|
||||||
|
|
||||||
if (Typ == (struct typmap **) NULL)
|
if (Typ == NULL)
|
||||||
{
|
{
|
||||||
rel = heap_openr(TypeRelationName, NoLock);
|
rel = heap_openr(TypeRelationName, NoLock);
|
||||||
scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
|
scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
|
||||||
i = 0;
|
i = 0;
|
||||||
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
||||||
++i;
|
++i;
|
||||||
@ -580,8 +580,8 @@ boot_openrel(char *relname)
|
|||||||
app = Typ = ALLOC(struct typmap *, i + 1);
|
app = Typ = ALLOC(struct typmap *, i + 1);
|
||||||
while (i-- > 0)
|
while (i-- > 0)
|
||||||
*app++ = ALLOC(struct typmap, 1);
|
*app++ = ALLOC(struct typmap, 1);
|
||||||
*app = (struct typmap *) NULL;
|
*app = NULL;
|
||||||
scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
|
scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
|
||||||
app = Typ;
|
app = Typ;
|
||||||
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
||||||
{
|
{
|
||||||
@ -648,7 +648,7 @@ closerel(char *name)
|
|||||||
{
|
{
|
||||||
elog(DEBUG4, "close relation %s", relname ? relname : "(null)");
|
elog(DEBUG4, "close relation %s", relname ? relname : "(null)");
|
||||||
heap_close(boot_reldesc, NoLock);
|
heap_close(boot_reldesc, NoLock);
|
||||||
boot_reldesc = (Relation) NULL;
|
boot_reldesc = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -674,7 +674,7 @@ DefineAttr(char *name, char *type, int attnum)
|
|||||||
closerel(relname);
|
closerel(relname);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attrtypes[attnum] == (Form_pg_attribute) NULL)
|
if (attrtypes[attnum] == NULL)
|
||||||
attrtypes[attnum] = AllocateAttribute();
|
attrtypes[attnum] = AllocateAttribute();
|
||||||
MemSet(attrtypes[attnum], 0, ATTRIBUTE_TUPLE_SIZE);
|
MemSet(attrtypes[attnum], 0, ATTRIBUTE_TUPLE_SIZE);
|
||||||
|
|
||||||
@ -684,7 +684,7 @@ DefineAttr(char *name, char *type, int attnum)
|
|||||||
|
|
||||||
typeoid = gettype(type);
|
typeoid = gettype(type);
|
||||||
|
|
||||||
if (Typ != (struct typmap **) NULL)
|
if (Typ != NULL)
|
||||||
{
|
{
|
||||||
attrtypes[attnum]->atttypid = Ap->am_oid;
|
attrtypes[attnum]->atttypid = Ap->am_oid;
|
||||||
attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen;
|
attlen = attrtypes[attnum]->attlen = Ap->am_typ.typlen;
|
||||||
@ -817,7 +817,7 @@ InsertOneValue(char *value, int i)
|
|||||||
|
|
||||||
elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
|
elog(DEBUG4, "inserting column %d value \"%s\"", i, value);
|
||||||
|
|
||||||
if (Typ != (struct typmap **) NULL)
|
if (Typ != NULL)
|
||||||
{
|
{
|
||||||
struct typmap *ap;
|
struct typmap *ap;
|
||||||
|
|
||||||
@ -949,9 +949,9 @@ gettype(char *type)
|
|||||||
HeapTuple tup;
|
HeapTuple tup;
|
||||||
struct typmap **app;
|
struct typmap **app;
|
||||||
|
|
||||||
if (Typ != (struct typmap **) NULL)
|
if (Typ != NULL)
|
||||||
{
|
{
|
||||||
for (app = Typ; *app != (struct typmap *) NULL; app++)
|
for (app = Typ; *app != NULL; app++)
|
||||||
{
|
{
|
||||||
if (strncmp(NameStr((*app)->am_typ.typname), type, NAMEDATALEN) == 0)
|
if (strncmp(NameStr((*app)->am_typ.typname), type, NAMEDATALEN) == 0)
|
||||||
{
|
{
|
||||||
@ -969,7 +969,7 @@ gettype(char *type)
|
|||||||
}
|
}
|
||||||
elog(DEBUG4, "external type: %s", type);
|
elog(DEBUG4, "external type: %s", type);
|
||||||
rel = heap_openr(TypeRelationName, NoLock);
|
rel = heap_openr(TypeRelationName, NoLock);
|
||||||
scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
|
scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
|
||||||
i = 0;
|
i = 0;
|
||||||
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
||||||
++i;
|
++i;
|
||||||
@ -977,8 +977,8 @@ gettype(char *type)
|
|||||||
app = Typ = ALLOC(struct typmap *, i + 1);
|
app = Typ = ALLOC(struct typmap *, i + 1);
|
||||||
while (i-- > 0)
|
while (i-- > 0)
|
||||||
*app++ = ALLOC(struct typmap, 1);
|
*app++ = ALLOC(struct typmap, 1);
|
||||||
*app = (struct typmap *) NULL;
|
*app = NULL;
|
||||||
scan = heap_beginscan(rel, SnapshotNow, 0, (ScanKey) NULL);
|
scan = heap_beginscan(rel, SnapshotNow, 0, NULL);
|
||||||
app = Typ;
|
app = Typ;
|
||||||
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
while ((tup = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
||||||
{
|
{
|
||||||
@ -1223,7 +1223,7 @@ index_register(Oid heap,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
if (nogc == NULL)
|
if (nogc == NULL)
|
||||||
nogc = AllocSetContextCreate((MemoryContext) NULL,
|
nogc = AllocSetContextCreate(NULL,
|
||||||
"BootstrapNoGC",
|
"BootstrapNoGC",
|
||||||
ALLOCSET_DEFAULT_MINSIZE,
|
ALLOCSET_DEFAULT_MINSIZE,
|
||||||
ALLOCSET_DEFAULT_INITSIZE,
|
ALLOCSET_DEFAULT_INITSIZE,
|
||||||
@ -1253,9 +1253,9 @@ index_register(Oid heap,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
build_indices()
|
build_indices(void)
|
||||||
{
|
{
|
||||||
for (; ILHead != (IndexList *) NULL; ILHead = ILHead->il_next)
|
for (; ILHead != NULL; ILHead = ILHead->il_next)
|
||||||
{
|
{
|
||||||
Relation heap;
|
Relation heap;
|
||||||
Relation ind;
|
Relation ind;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.224 2003/12/28 21:57:36 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/index.c,v 1.225 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
@ -1419,7 +1419,7 @@ IndexBuildHeapScan(Relation heapRelation,
|
|||||||
scan = heap_beginscan(heapRelation, /* relation */
|
scan = heap_beginscan(heapRelation, /* relation */
|
||||||
snapshot, /* seeself */
|
snapshot, /* seeself */
|
||||||
0, /* number of keys */
|
0, /* number of keys */
|
||||||
(ScanKey) NULL); /* scan key */
|
NULL); /* scan key */
|
||||||
|
|
||||||
reltuples = 0;
|
reltuples = 0;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.91 2003/11/29 19:51:46 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/catalog/pg_type.c,v 1.92 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -336,7 +336,7 @@ TypeCreate(const char *typeName,
|
|||||||
baseType,
|
baseType,
|
||||||
(defaultTypeBin ?
|
(defaultTypeBin ?
|
||||||
stringToNode(defaultTypeBin) :
|
stringToNode(defaultTypeBin) :
|
||||||
(void *) NULL),
|
NULL),
|
||||||
rebuildDeps);
|
rebuildDeps);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.106 2003/12/12 18:45:08 petere Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/async.c,v 1.107 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -199,7 +199,7 @@ Async_Listen(char *relname, int pid)
|
|||||||
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
|
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
|
||||||
|
|
||||||
/* Detect whether we are already listening on this relname */
|
/* Detect whether we are already listening on this relname */
|
||||||
scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
|
scan = heap_beginscan(lRel, SnapshotNow, 0, NULL);
|
||||||
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
||||||
{
|
{
|
||||||
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
|
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
|
||||||
@ -292,7 +292,7 @@ Async_Unlisten(char *relname, int pid)
|
|||||||
|
|
||||||
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
|
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
|
||||||
|
|
||||||
scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
|
scan = heap_beginscan(lRel, SnapshotNow, 0, NULL);
|
||||||
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
while ((tuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
||||||
{
|
{
|
||||||
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
|
Form_pg_listener listener = (Form_pg_listener) GETSTRUCT(tuple);
|
||||||
@ -459,7 +459,7 @@ AtCommit_Notify(void)
|
|||||||
|
|
||||||
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
|
lRel = heap_openr(ListenerRelationName, AccessExclusiveLock);
|
||||||
tdesc = RelationGetDescr(lRel);
|
tdesc = RelationGetDescr(lRel);
|
||||||
scan = heap_beginscan(lRel, SnapshotNow, 0, (ScanKey) NULL);
|
scan = heap_beginscan(lRel, SnapshotNow, 0, NULL);
|
||||||
|
|
||||||
while ((lTuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
while ((lTuple = heap_getnext(scan, ForwardScanDirection)) != NULL)
|
||||||
{
|
{
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.129 2003/12/15 22:56:44 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.130 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -749,7 +749,7 @@ AlterDatabaseSet(AlterDatabaseSetStmt *stmt)
|
|||||||
datum = heap_getattr(tuple, Anum_pg_database_datconfig,
|
datum = heap_getattr(tuple, Anum_pg_database_datconfig,
|
||||||
RelationGetDescr(rel), &isnull);
|
RelationGetDescr(rel), &isnull);
|
||||||
|
|
||||||
a = isnull ? ((ArrayType *) NULL) : DatumGetArrayTypeP(datum);
|
a = isnull ? NULL : DatumGetArrayTypeP(datum);
|
||||||
|
|
||||||
if (valuestr)
|
if (valuestr)
|
||||||
a = GUCArrayAdd(a, stmt->variable, valuestr);
|
a = GUCArrayAdd(a, stmt->variable, valuestr);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
|
* Copyright (c) 2002-2003, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.24 2003/11/29 19:51:47 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/prepare.c,v 1.25 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -323,7 +323,7 @@ StorePreparedStatement(const char *stmt_name,
|
|||||||
* out-of-memory failure only wastes memory and doesn't leave us with
|
* out-of-memory failure only wastes memory and doesn't leave us with
|
||||||
* an incomplete (ie corrupt) hashtable entry.
|
* an incomplete (ie corrupt) hashtable entry.
|
||||||
*/
|
*/
|
||||||
qstring = query_string ? pstrdup(query_string) : (char *) NULL;
|
qstring = query_string ? pstrdup(query_string) : NULL;
|
||||||
query_list = (List *) copyObject(query_list);
|
query_list = (List *) copyObject(query_list);
|
||||||
plan_list = (List *) copyObject(plan_list);
|
plan_list = (List *) copyObject(plan_list);
|
||||||
argtype_list = listCopy(argtype_list);
|
argtype_list = listCopy(argtype_list);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.106 2003/12/14 00:34:47 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.107 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -946,7 +946,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* INCREMENT BY */
|
/* INCREMENT BY */
|
||||||
if (increment_by != (DefElem *) NULL)
|
if (increment_by != NULL)
|
||||||
{
|
{
|
||||||
new->increment_by = defGetInt64(increment_by);
|
new->increment_by = defGetInt64(increment_by);
|
||||||
if (new->increment_by == 0)
|
if (new->increment_by == 0)
|
||||||
@ -958,7 +958,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit)
|
|||||||
new->increment_by = 1;
|
new->increment_by = 1;
|
||||||
|
|
||||||
/* CYCLE */
|
/* CYCLE */
|
||||||
if (is_cycled != (DefElem *) NULL)
|
if (is_cycled != NULL)
|
||||||
{
|
{
|
||||||
new->is_cycled = intVal(is_cycled->arg);
|
new->is_cycled = intVal(is_cycled->arg);
|
||||||
Assert(new->is_cycled == false || new->is_cycled == true);
|
Assert(new->is_cycled == false || new->is_cycled == true);
|
||||||
@ -967,11 +967,11 @@ init_params(List *options, Form_pg_sequence new, bool isInit)
|
|||||||
new->is_cycled = false;
|
new->is_cycled = false;
|
||||||
|
|
||||||
/* MAXVALUE (null arg means NO MAXVALUE) */
|
/* MAXVALUE (null arg means NO MAXVALUE) */
|
||||||
if (max_value != (DefElem *) NULL && max_value->arg)
|
if (max_value != NULL && max_value->arg)
|
||||||
{
|
{
|
||||||
new->max_value = defGetInt64(max_value);
|
new->max_value = defGetInt64(max_value);
|
||||||
}
|
}
|
||||||
else if (isInit || max_value != (DefElem *) NULL)
|
else if (isInit || max_value != NULL)
|
||||||
{
|
{
|
||||||
if (new->increment_by > 0)
|
if (new->increment_by > 0)
|
||||||
new->max_value = SEQ_MAXVALUE; /* ascending seq */
|
new->max_value = SEQ_MAXVALUE; /* ascending seq */
|
||||||
@ -980,11 +980,11 @@ init_params(List *options, Form_pg_sequence new, bool isInit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* MINVALUE (null arg means NO MINVALUE) */
|
/* MINVALUE (null arg means NO MINVALUE) */
|
||||||
if (min_value != (DefElem *) NULL && min_value->arg)
|
if (min_value != NULL && min_value->arg)
|
||||||
{
|
{
|
||||||
new->min_value = defGetInt64(min_value);
|
new->min_value = defGetInt64(min_value);
|
||||||
}
|
}
|
||||||
else if (isInit || min_value != (DefElem *) NULL)
|
else if (isInit || min_value != NULL)
|
||||||
{
|
{
|
||||||
if (new->increment_by > 0)
|
if (new->increment_by > 0)
|
||||||
new->min_value = 1; /* ascending seq */
|
new->min_value = 1; /* ascending seq */
|
||||||
@ -1007,7 +1007,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* START WITH */
|
/* START WITH */
|
||||||
if (last_value != (DefElem *) NULL)
|
if (last_value != NULL)
|
||||||
new->last_value = defGetInt64(last_value);
|
new->last_value = defGetInt64(last_value);
|
||||||
else if (isInit)
|
else if (isInit)
|
||||||
{
|
{
|
||||||
@ -1044,7 +1044,7 @@ init_params(List *options, Form_pg_sequence new, bool isInit)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* CACHE */
|
/* CACHE */
|
||||||
if (cache_value != (DefElem *) NULL)
|
if (cache_value != NULL)
|
||||||
{
|
{
|
||||||
new->cache_value = defGetInt64(cache_value);
|
new->cache_value = defGetInt64(cache_value);
|
||||||
if (new->cache_value <= 0)
|
if (new->cache_value <= 0)
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.131 2003/11/29 19:51:47 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/user.c,v 1.132 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -986,7 +986,7 @@ AlterUserSet(AlterUserSetStmt *stmt)
|
|||||||
datum = SysCacheGetAttr(SHADOWNAME, oldtuple,
|
datum = SysCacheGetAttr(SHADOWNAME, oldtuple,
|
||||||
Anum_pg_shadow_useconfig, &isnull);
|
Anum_pg_shadow_useconfig, &isnull);
|
||||||
|
|
||||||
array = isnull ? ((ArrayType *) NULL) : DatumGetArrayTypeP(datum);
|
array = isnull ? NULL : DatumGetArrayTypeP(datum);
|
||||||
|
|
||||||
if (valuestr)
|
if (valuestr)
|
||||||
array = GUCArrayAdd(array, stmt->variable, valuestr);
|
array = GUCArrayAdd(array, stmt->variable, valuestr);
|
||||||
@ -1457,7 +1457,7 @@ AlterGroup(AlterGroupStmt *stmt, const char *tag)
|
|||||||
/* Fetch old group membership. */
|
/* Fetch old group membership. */
|
||||||
datum = heap_getattr(group_tuple, Anum_pg_group_grolist,
|
datum = heap_getattr(group_tuple, Anum_pg_group_grolist,
|
||||||
pg_group_dsc, &null);
|
pg_group_dsc, &null);
|
||||||
oldarray = null ? ((IdList *) NULL) : DatumGetIdListP(datum);
|
oldarray = null ? NULL : DatumGetIdListP(datum);
|
||||||
|
|
||||||
/* initialize list with old array contents */
|
/* initialize list with old array contents */
|
||||||
newlist = IdArrayToList(oldarray);
|
newlist = IdArrayToList(oldarray);
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.270 2004/01/06 18:07:31 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/commands/vacuum.c,v 1.271 2004/01/07 18:56:25 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -958,7 +958,7 @@ full_vacuum_rel(Relation onerel, VacuumStmt *vacstmt)
|
|||||||
vacrelstats->hasindex = true;
|
vacrelstats->hasindex = true;
|
||||||
|
|
||||||
/* Clean/scan index relation(s) */
|
/* Clean/scan index relation(s) */
|
||||||
if (Irel != (Relation *) NULL)
|
if (Irel != NULL)
|
||||||
{
|
{
|
||||||
if (vacuum_pages.num_pages > 0)
|
if (vacuum_pages.num_pages > 0)
|
||||||
{
|
{
|
||||||
@ -1257,7 +1257,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel,
|
|||||||
* removal of dead tuples. But note we are NOT changing
|
* removal of dead tuples. But note we are NOT changing
|
||||||
* the real page yet...
|
* the real page yet...
|
||||||
*/
|
*/
|
||||||
if (tempPage == (Page) NULL)
|
if (tempPage == NULL)
|
||||||
{
|
{
|
||||||
Size pageSize;
|
Size pageSize;
|
||||||
|
|
||||||
@ -1284,7 +1284,7 @@ scan_heap(VRelStats *vacrelstats, Relation onerel,
|
|||||||
}
|
}
|
||||||
} /* scan along page */
|
} /* scan along page */
|
||||||
|
|
||||||
if (tempPage != (Page) NULL)
|
if (tempPage != NULL)
|
||||||
{
|
{
|
||||||
/* Some tuples are removable; figure free space after removal */
|
/* Some tuples are removable; figure free space after removal */
|
||||||
PageRepairFragmentation(tempPage, NULL);
|
PageRepairFragmentation(tempPage, NULL);
|
||||||
@ -2406,7 +2406,7 @@ repair_frag(VRelStats *vacrelstats, Relation onerel,
|
|||||||
if (Nvacpagelist.num_pages > 0)
|
if (Nvacpagelist.num_pages > 0)
|
||||||
{
|
{
|
||||||
/* vacuum indexes again if needed */
|
/* vacuum indexes again if needed */
|
||||||
if (Irel != (Relation *) NULL)
|
if (Irel != NULL)
|
||||||
{
|
{
|
||||||
VacPage *vpleft,
|
VacPage *vpleft,
|
||||||
*vpright,
|
*vpright,
|
||||||
@ -3057,7 +3057,7 @@ vac_open_indexes(Relation relation, int *nindexes, Relation **Irel)
|
|||||||
void
|
void
|
||||||
vac_close_indexes(int nindexes, Relation *Irel)
|
vac_close_indexes(int nindexes, Relation *Irel)
|
||||||
{
|
{
|
||||||
if (Irel == (Relation *) NULL)
|
if (Irel == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while (nindexes--)
|
while (nindexes--)
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.37 2003/11/29 19:51:48 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/execJunk.c,v 1.38 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -267,7 +267,7 @@ ExecRemoveJunk(JunkFilter *junkfilter, TupleTableSlot *slot)
|
|||||||
* Handle the trivial case first.
|
* Handle the trivial case first.
|
||||||
*/
|
*/
|
||||||
if (cleanLength == 0)
|
if (cleanLength == 0)
|
||||||
return (HeapTuple) NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create the arrays that will hold the attribute values and the null
|
* Create the arrays that will hold the attribute values and the null
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.224 2003/12/28 21:57:36 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/execMain.c,v 1.225 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -782,7 +782,7 @@ InitPlan(QueryDesc *queryDesc, bool explainOnly)
|
|||||||
*
|
*
|
||||||
* If EXPLAIN, skip creating the "into" relation.
|
* If EXPLAIN, skip creating the "into" relation.
|
||||||
*/
|
*/
|
||||||
intoRelationDesc = (Relation) NULL;
|
intoRelationDesc = NULL;
|
||||||
|
|
||||||
if (do_select_into && !explainOnly)
|
if (do_select_into && !explainOnly)
|
||||||
{
|
{
|
||||||
@ -1076,7 +1076,7 @@ lnext: ;
|
|||||||
*
|
*
|
||||||
* Also, extract all the junk information we need.
|
* Also, extract all the junk information we need.
|
||||||
*/
|
*/
|
||||||
if ((junkfilter = estate->es_junkFilter) != (JunkFilter *) NULL)
|
if ((junkfilter = estate->es_junkFilter) != NULL)
|
||||||
{
|
{
|
||||||
Datum datum;
|
Datum datum;
|
||||||
HeapTuple newTuple;
|
HeapTuple newTuple;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.152 2003/12/18 22:23:42 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/execQual.c,v 1.153 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -548,7 +548,7 @@ GetAttributeByNum(TupleTableSlot *slot,
|
|||||||
if (!AttributeNumberIsValid(attrno))
|
if (!AttributeNumberIsValid(attrno))
|
||||||
elog(ERROR, "invalid attribute number %d", attrno);
|
elog(ERROR, "invalid attribute number %d", attrno);
|
||||||
|
|
||||||
if (isNull == (bool *) NULL)
|
if (isNull == NULL)
|
||||||
elog(ERROR, "a NULL isNull pointer was passed");
|
elog(ERROR, "a NULL isNull pointer was passed");
|
||||||
|
|
||||||
if (TupIsNull(slot))
|
if (TupIsNull(slot))
|
||||||
@ -579,7 +579,7 @@ GetAttributeByName(TupleTableSlot *slot, char *attname, bool *isNull)
|
|||||||
if (attname == NULL)
|
if (attname == NULL)
|
||||||
elog(ERROR, "invalid attribute name");
|
elog(ERROR, "invalid attribute name");
|
||||||
|
|
||||||
if (isNull == (bool *) NULL)
|
if (isNull == NULL)
|
||||||
elog(ERROR, "a NULL isNull pointer was passed");
|
elog(ERROR, "a NULL isNull pointer was passed");
|
||||||
|
|
||||||
if (TupIsNull(slot))
|
if (TupIsNull(slot))
|
||||||
@ -3116,7 +3116,7 @@ ExecProject(ProjectionInfo *projInfo, ExprDoneCond *isDone)
|
|||||||
* sanity checks
|
* sanity checks
|
||||||
*/
|
*/
|
||||||
if (projInfo == NULL)
|
if (projInfo == NULL)
|
||||||
return (TupleTableSlot *) NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* get the projection info we want
|
* get the projection info we want
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.74 2003/12/01 23:09:02 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/execTuples.c,v 1.75 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -271,11 +271,11 @@ ExecAllocTableSlot(TupleTable table)
|
|||||||
|
|
||||||
/* Make sure the allocated slot is valid (and empty) */
|
/* Make sure the allocated slot is valid (and empty) */
|
||||||
slot->type = T_TupleTableSlot;
|
slot->type = T_TupleTableSlot;
|
||||||
slot->val = (HeapTuple) NULL;
|
slot->val = NULL;
|
||||||
slot->ttc_shouldFree = true;
|
slot->ttc_shouldFree = true;
|
||||||
slot->ttc_descIsNew = true;
|
slot->ttc_descIsNew = true;
|
||||||
slot->ttc_shouldFreeDesc = true;
|
slot->ttc_shouldFreeDesc = true;
|
||||||
slot->ttc_tupleDescriptor = (TupleDesc) NULL;
|
slot->ttc_tupleDescriptor = NULL;
|
||||||
slot->ttc_buffer = InvalidBuffer;
|
slot->ttc_buffer = InvalidBuffer;
|
||||||
|
|
||||||
return slot;
|
return slot;
|
||||||
@ -296,11 +296,11 @@ MakeTupleTableSlot(void)
|
|||||||
TupleTableSlot *slot = makeNode(TupleTableSlot);
|
TupleTableSlot *slot = makeNode(TupleTableSlot);
|
||||||
|
|
||||||
/* This should match ExecAllocTableSlot() */
|
/* This should match ExecAllocTableSlot() */
|
||||||
slot->val = (HeapTuple) NULL;
|
slot->val = NULL;
|
||||||
slot->ttc_shouldFree = true;
|
slot->ttc_shouldFree = true;
|
||||||
slot->ttc_descIsNew = true;
|
slot->ttc_descIsNew = true;
|
||||||
slot->ttc_shouldFreeDesc = true;
|
slot->ttc_shouldFreeDesc = true;
|
||||||
slot->ttc_tupleDescriptor = (TupleDesc) NULL;
|
slot->ttc_tupleDescriptor = NULL;
|
||||||
slot->ttc_buffer = InvalidBuffer;
|
slot->ttc_buffer = InvalidBuffer;
|
||||||
|
|
||||||
return slot;
|
return slot;
|
||||||
@ -406,7 +406,7 @@ ExecClearTuple(TupleTableSlot *slot) /* slot in which to store tuple */
|
|||||||
if (slot->ttc_shouldFree && oldtuple != NULL)
|
if (slot->ttc_shouldFree && oldtuple != NULL)
|
||||||
heap_freetuple(oldtuple);
|
heap_freetuple(oldtuple);
|
||||||
|
|
||||||
slot->val = (HeapTuple) NULL;
|
slot->val = NULL;
|
||||||
|
|
||||||
slot->ttc_shouldFree = true; /* probably useless code... */
|
slot->ttc_shouldFree = true; /* probably useless code... */
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.76 2003/11/29 19:51:48 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/functions.c,v 1.77 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -47,7 +47,7 @@ typedef struct local_es
|
|||||||
QueryDesc *qd; /* null unless status == RUN */
|
QueryDesc *qd; /* null unless status == RUN */
|
||||||
} execution_state;
|
} execution_state;
|
||||||
|
|
||||||
#define LAST_POSTQUEL_COMMAND(es) ((es)->next == (execution_state *) NULL)
|
#define LAST_POSTQUEL_COMMAND(es) ((es)->next == NULL)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -259,7 +259,7 @@ init_sql_fcache(FmgrInfo *finfo)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
argOidVect = (Oid *) NULL;
|
argOidVect = NULL;
|
||||||
|
|
||||||
tmp = SysCacheGetAttr(PROCOID,
|
tmp = SysCacheGetAttr(PROCOID,
|
||||||
procedureTuple,
|
procedureTuple,
|
||||||
@ -304,7 +304,7 @@ postquel_getnext(execution_state *es)
|
|||||||
if (es->qd->operation == CMD_UTILITY)
|
if (es->qd->operation == CMD_UTILITY)
|
||||||
{
|
{
|
||||||
ProcessUtility(es->qd->parsetree->utilityStmt, es->qd->dest, NULL);
|
ProcessUtility(es->qd->parsetree->utilityStmt, es->qd->dest, NULL);
|
||||||
return (TupleTableSlot *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -358,7 +358,7 @@ postquel_sub_params(SQLFunctionCachePtr fcache,
|
|||||||
paramLI[nargs].kind = PARAM_INVALID;
|
paramLI[nargs].kind = PARAM_INVALID;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
paramLI = (ParamListInfo) NULL;
|
paramLI = NULL;
|
||||||
|
|
||||||
if (fcache->paramLI)
|
if (fcache->paramLI)
|
||||||
pfree(fcache->paramLI);
|
pfree(fcache->paramLI);
|
||||||
@ -551,7 +551,7 @@ fmgr_sql(PG_FUNCTION_ARGS)
|
|||||||
/*
|
/*
|
||||||
* If we've gone through every command in this function, we are done.
|
* If we've gone through every command in this function, we are done.
|
||||||
*/
|
*/
|
||||||
if (es == (execution_state *) NULL)
|
if (es == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Reset the execution states to start over again on next call.
|
* Reset the execution states to start over again on next call.
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.59 2003/11/29 19:51:48 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/nodeHashjoin.c,v 1.60 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -405,10 +405,10 @@ ExecInitHashJoin(HashJoin *node, EState *estate)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
hjstate->hj_hashdone = false;
|
hjstate->hj_hashdone = false;
|
||||||
hjstate->hj_HashTable = (HashJoinTable) NULL;
|
hjstate->hj_HashTable = NULL;
|
||||||
|
|
||||||
hjstate->hj_CurBucketNo = 0;
|
hjstate->hj_CurBucketNo = 0;
|
||||||
hjstate->hj_CurTuple = (HashJoinTuple) NULL;
|
hjstate->hj_CurTuple = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Deconstruct the hash clauses into outer and inner argument values,
|
* Deconstruct the hash clauses into outer and inner argument values,
|
||||||
@ -733,9 +733,9 @@ ExecReScanHashJoin(HashJoinState *node, ExprContext *exprCtxt)
|
|||||||
|
|
||||||
/* Always reset intra-tuple state */
|
/* Always reset intra-tuple state */
|
||||||
node->hj_CurBucketNo = 0;
|
node->hj_CurBucketNo = 0;
|
||||||
node->hj_CurTuple = (HashJoinTuple) NULL;
|
node->hj_CurTuple = NULL;
|
||||||
|
|
||||||
node->js.ps.ps_OuterTupleSlot = (TupleTableSlot *) NULL;
|
node->js.ps.ps_OuterTupleSlot = NULL;
|
||||||
node->js.ps.ps_TupFromTlist = false;
|
node->js.ps.ps_TupFromTlist = false;
|
||||||
node->hj_NeedNewOuter = true;
|
node->hj_NeedNewOuter = true;
|
||||||
node->hj_MatchedOuter = false;
|
node->hj_MatchedOuter = false;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.89 2004/01/06 04:31:01 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/executor/nodeIndexscan.c,v 1.90 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -758,9 +758,9 @@ ExecInitIndexScan(IndexScan *node, EState *estate)
|
|||||||
lossyflags = lfirst(indxlossy);
|
lossyflags = lfirst(indxlossy);
|
||||||
indxlossy = lnext(indxlossy);
|
indxlossy = lnext(indxlossy);
|
||||||
n_keys = length(quals);
|
n_keys = length(quals);
|
||||||
scan_keys = (n_keys <= 0) ? (ScanKey) NULL :
|
scan_keys = (n_keys <= 0) ? NULL :
|
||||||
(ScanKey) palloc(n_keys * sizeof(ScanKeyData));
|
(ScanKey) palloc(n_keys * sizeof(ScanKeyData));
|
||||||
run_keys = (n_keys <= 0) ? (ExprState **) NULL :
|
run_keys = (n_keys <= 0) ? NULL :
|
||||||
(ExprState **) palloc(n_keys * sizeof(ExprState *));
|
(ExprState **) palloc(n_keys * sizeof(ExprState *));
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.163 2003/11/29 19:51:49 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/nodes/readfuncs.c,v 1.164 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Path and Plan nodes do not have any readfuncs support, because we
|
* Path and Plan nodes do not have any readfuncs support, because we
|
||||||
@ -129,7 +129,7 @@
|
|||||||
#define strtobool(x) ((*(x) == 't') ? true : false)
|
#define strtobool(x) ((*(x) == 't') ? true : false)
|
||||||
|
|
||||||
#define nullable_string(token,length) \
|
#define nullable_string(token,length) \
|
||||||
((length) == 0 ? (char *) NULL : debackslash(token, length))
|
((length) == 0 ? NULL : debackslash(token, length))
|
||||||
|
|
||||||
|
|
||||||
static Datum readDatum(bool typbyval);
|
static Datum readDatum(bool typbyval);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.165 2004/01/06 04:31:01 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.166 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -2177,7 +2177,7 @@ make_agg(Query *root, List *tlist, List *qual,
|
|||||||
plan->qual = qual;
|
plan->qual = qual;
|
||||||
plan->targetlist = tlist;
|
plan->targetlist = tlist;
|
||||||
plan->lefttree = lefttree;
|
plan->lefttree = lefttree;
|
||||||
plan->righttree = (Plan *) NULL;
|
plan->righttree = NULL;
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
@ -2229,7 +2229,7 @@ make_group(Query *root,
|
|||||||
plan->qual = NIL;
|
plan->qual = NIL;
|
||||||
plan->targetlist = tlist;
|
plan->targetlist = tlist;
|
||||||
plan->lefttree = lefttree;
|
plan->lefttree = lefttree;
|
||||||
plan->righttree = (Plan *) NULL;
|
plan->righttree = NULL;
|
||||||
|
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/tlist.c,v 1.61 2003/11/29 19:51:51 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/optimizer/util/tlist.c,v 1.62 2004/01/07 18:56:26 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -58,7 +58,7 @@ matching_tlist_expr(Node *node, List *targetlist)
|
|||||||
if (tlentry)
|
if (tlentry)
|
||||||
return tlentry->expr;
|
return tlentry->expr;
|
||||||
|
|
||||||
return (Node *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -76,7 +76,7 @@ tlist_member(Node *node, List *targetlist)
|
|||||||
if (tlentry)
|
if (tlentry)
|
||||||
return tlentry->resdom;
|
return tlentry->resdom;
|
||||||
|
|
||||||
return (Resdom *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.442 2004/01/06 23:55:18 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.443 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
* HISTORY
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -467,13 +467,13 @@ stmtblock: stmtmulti { parsetree = $1; }
|
|||||||
|
|
||||||
/* the thrashing around here is to discard "empty" statements... */
|
/* the thrashing around here is to discard "empty" statements... */
|
||||||
stmtmulti: stmtmulti ';' stmt
|
stmtmulti: stmtmulti ';' stmt
|
||||||
{ if ($3 != (Node *)NULL)
|
{ if ($3 != NULL)
|
||||||
$$ = lappend($1, $3);
|
$$ = lappend($1, $3);
|
||||||
else
|
else
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| stmt
|
| stmt
|
||||||
{ if ($1 != (Node *)NULL)
|
{ if ($1 != NULL)
|
||||||
$$ = makeList1($1);
|
$$ = makeList1($1);
|
||||||
else
|
else
|
||||||
$$ = NIL;
|
$$ = NIL;
|
||||||
@ -553,7 +553,7 @@ stmt :
|
|||||||
| VariableShowStmt
|
| VariableShowStmt
|
||||||
| ViewStmt
|
| ViewStmt
|
||||||
| /*EMPTY*/
|
| /*EMPTY*/
|
||||||
{ $$ = (Node *)NULL; }
|
{ $$ = NULL; }
|
||||||
;
|
;
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
@ -1955,11 +1955,11 @@ OptSeqElem: CACHE NumericOnly
|
|||||||
}
|
}
|
||||||
| NO MAXVALUE
|
| NO MAXVALUE
|
||||||
{
|
{
|
||||||
$$ = makeDefElem("maxvalue", (Node *)NULL);
|
$$ = makeDefElem("maxvalue", NULL);
|
||||||
}
|
}
|
||||||
| NO MINVALUE
|
| NO MINVALUE
|
||||||
{
|
{
|
||||||
$$ = makeDefElem("minvalue", (Node *)NULL);
|
$$ = makeDefElem("minvalue", NULL);
|
||||||
}
|
}
|
||||||
| START opt_with NumericOnly
|
| START opt_with NumericOnly
|
||||||
{
|
{
|
||||||
@ -2371,7 +2371,7 @@ def_elem: ColLabel '=' def_arg
|
|||||||
}
|
}
|
||||||
| ColLabel
|
| ColLabel
|
||||||
{
|
{
|
||||||
$$ = makeDefElem($1, (Node *)NULL);
|
$$ = makeDefElem($1, NULL);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -3563,13 +3563,13 @@ RuleActionList:
|
|||||||
/* the thrashing around here is to discard "empty" statements... */
|
/* the thrashing around here is to discard "empty" statements... */
|
||||||
RuleActionMulti:
|
RuleActionMulti:
|
||||||
RuleActionMulti ';' RuleActionStmtOrEmpty
|
RuleActionMulti ';' RuleActionStmtOrEmpty
|
||||||
{ if ($3 != (Node *) NULL)
|
{ if ($3 != NULL)
|
||||||
$$ = lappend($1, $3);
|
$$ = lappend($1, $3);
|
||||||
else
|
else
|
||||||
$$ = $1;
|
$$ = $1;
|
||||||
}
|
}
|
||||||
| RuleActionStmtOrEmpty
|
| RuleActionStmtOrEmpty
|
||||||
{ if ($1 != (Node *) NULL)
|
{ if ($1 != NULL)
|
||||||
$$ = makeList1($1);
|
$$ = makeList1($1);
|
||||||
else
|
else
|
||||||
$$ = NIL;
|
$$ = NIL;
|
||||||
@ -3586,7 +3586,7 @@ RuleActionStmt:
|
|||||||
|
|
||||||
RuleActionStmtOrEmpty:
|
RuleActionStmtOrEmpty:
|
||||||
RuleActionStmt { $$ = $1; }
|
RuleActionStmt { $$ = $1; }
|
||||||
| /*EMPTY*/ { $$ = (Node *)NULL; }
|
| /*EMPTY*/ { $$ = NULL; }
|
||||||
;
|
;
|
||||||
|
|
||||||
/* change me to select, update, etc. some day */
|
/* change me to select, update, etc. some day */
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.164 2003/11/29 19:51:52 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/parser/parse_func.c,v 1.165 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -993,7 +993,7 @@ argtype_inherit(int nargs, Oid *argtypes)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
arginh[i].nsupers = 0;
|
arginh[i].nsupers = 0;
|
||||||
arginh[i].supervec = (Oid *) NULL;
|
arginh[i].supervec = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1090,7 +1090,7 @@ find_inheritors(Oid relid, Oid **supervec)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*supervec = (Oid *) NULL;
|
*supervec = NULL;
|
||||||
|
|
||||||
freeList(visited);
|
freeList(visited);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* available with a PostgreSQL-compatible license. Kudos Wilfredo
|
* available with a PostgreSQL-compatible license. Kudos Wilfredo
|
||||||
* Sánchez <wsanchez@apple.com>.
|
* Sánchez <wsanchez@apple.com>.
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/darwin.c,v 1.9 2003/11/29 19:51:54 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/port/dynloader/darwin.c,v 1.10 2004/01/07 18:56:27 neilc Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres.h"
|
#include "postgres.h"
|
||||||
|
|
||||||
@ -50,7 +50,7 @@ pg_dlsym(void *handle, char *funcname)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
free(symname);
|
free(symname);
|
||||||
return (PGFunction) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ BSD44_derived_dlerror(void)
|
|||||||
|
|
||||||
strcpy(ret, error_message);
|
strcpy(ret, error_message);
|
||||||
error_message[0] = 0;
|
error_message[0] = 0;
|
||||||
return (ret[0] == 0) ? (char *) NULL : ret;
|
return (ret[0] == 0) ? NULL : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@ -65,7 +65,7 @@ BSD44_derived_dlopen(const char *file, int num)
|
|||||||
#else
|
#else
|
||||||
void *vp;
|
void *vp;
|
||||||
|
|
||||||
if ((vp = dlopen((char *) file, num)) == (void *) NULL)
|
if ((vp = dlopen((char *) file, num)) == NULL)
|
||||||
snprintf(error_message, sizeof(error_message),
|
snprintf(error_message, sizeof(error_message),
|
||||||
"dlopen '%s' failed. (%s)", file, dlerror());
|
"dlopen '%s' failed. (%s)", file, dlerror());
|
||||||
return vp;
|
return vp;
|
||||||
@ -91,7 +91,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
|
|||||||
name = buf;
|
name = buf;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
|
if ((vp = dlsym(handle, (char *) name)) == NULL)
|
||||||
snprintf(error_message, sizeof(error_message),
|
snprintf(error_message, sizeof(error_message),
|
||||||
"dlsym (%s) failed", name);
|
"dlsym (%s) failed", name);
|
||||||
return vp;
|
return vp;
|
||||||
|
@ -53,7 +53,7 @@ BSD44_derived_dlerror(void)
|
|||||||
|
|
||||||
strcpy(ret, error_message);
|
strcpy(ret, error_message);
|
||||||
error_message[0] = 0;
|
error_message[0] = 0;
|
||||||
return (ret[0] == 0) ? (char *) NULL : ret;
|
return (ret[0] == 0) ? NULL : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@ -66,7 +66,7 @@ BSD44_derived_dlopen(const char *file, int num)
|
|||||||
#else
|
#else
|
||||||
void *vp;
|
void *vp;
|
||||||
|
|
||||||
if ((vp = dlopen((char *) file, num)) == (void *) NULL)
|
if ((vp = dlopen((char *) file, num)) == NULL)
|
||||||
snprintf(error_message, sizeof(error_message),
|
snprintf(error_message, sizeof(error_message),
|
||||||
"dlopen (%s) failed", file);
|
"dlopen (%s) failed", file);
|
||||||
return vp;
|
return vp;
|
||||||
@ -91,7 +91,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
|
|||||||
snprintf(buf, sizeof(buf), "_%s", name);
|
snprintf(buf, sizeof(buf), "_%s", name);
|
||||||
name = buf;
|
name = buf;
|
||||||
}
|
}
|
||||||
if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
|
if ((vp = dlsym(handle, (char *) name)) == NULL)
|
||||||
snprintf(error_message, sizeof(error_message),
|
snprintf(error_message, sizeof(error_message),
|
||||||
"dlsym (%s) failed", name);
|
"dlsym (%s) failed", name);
|
||||||
return vp;
|
return vp;
|
||||||
|
@ -53,7 +53,7 @@ BSD44_derived_dlerror(void)
|
|||||||
|
|
||||||
strcpy(ret, error_message);
|
strcpy(ret, error_message);
|
||||||
error_message[0] = 0;
|
error_message[0] = 0;
|
||||||
return (ret[0] == 0) ? (char *) NULL : ret;
|
return (ret[0] == 0) ? NULL : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void *
|
void *
|
||||||
@ -66,7 +66,7 @@ BSD44_derived_dlopen(const char *file, int num)
|
|||||||
#else
|
#else
|
||||||
void *vp;
|
void *vp;
|
||||||
|
|
||||||
if ((vp = dlopen((char *) file, num)) == (void *) NULL)
|
if ((vp = dlopen((char *) file, num)) == NULL)
|
||||||
snprintf(error_message, sizeof(error_message),
|
snprintf(error_message, sizeof(error_message),
|
||||||
"dlopen (%s) failed", file);
|
"dlopen (%s) failed", file);
|
||||||
return vp;
|
return vp;
|
||||||
@ -91,7 +91,7 @@ BSD44_derived_dlsym(void *handle, const char *name)
|
|||||||
snprintf(buf, sizeof(buf), "_%s", name);
|
snprintf(buf, sizeof(buf), "_%s", name);
|
||||||
name = buf;
|
name = buf;
|
||||||
}
|
}
|
||||||
if ((vp = dlsym(handle, (char *) name)) == (void *) NULL)
|
if ((vp = dlsym(handle, (char *) name)) == NULL)
|
||||||
snprintf(error_message, sizeof(error_message),
|
snprintf(error_message, sizeof(error_message),
|
||||||
"dlsym (%s) failed", name);
|
"dlsym (%s) failed", name);
|
||||||
return vp;
|
return vp;
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/port/dynloader/qnx4.c,v 1.5 2003/11/29 19:51:54 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/port/dynloader/qnx4.c,v 1.6 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -28,7 +28,7 @@
|
|||||||
void *
|
void *
|
||||||
pg_dlopen(char *filename)
|
pg_dlopen(char *filename)
|
||||||
{
|
{
|
||||||
return (void *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
PGFunction
|
PGFunction
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.27 2003/12/01 22:15:37 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/port/sysv_shmem.c,v 1.28 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -174,7 +174,7 @@ IpcMemoryDetach(int status, Datum shmaddr)
|
|||||||
static void
|
static void
|
||||||
IpcMemoryDelete(int status, Datum shmId)
|
IpcMemoryDelete(int status, Datum shmId)
|
||||||
{
|
{
|
||||||
if (shmctl(DatumGetInt32(shmId), IPC_RMID, (struct shmid_ds *) NULL) < 0)
|
if (shmctl(DatumGetInt32(shmId), IPC_RMID, NULL) < 0)
|
||||||
elog(LOG, "shmctl(%d, %d, 0) failed: %m",
|
elog(LOG, "shmctl(%d, %d, 0) failed: %m",
|
||||||
DatumGetInt32(shmId), IPC_RMID);
|
DatumGetInt32(shmId), IPC_RMID);
|
||||||
}
|
}
|
||||||
@ -299,7 +299,7 @@ PGSharedMemoryCreate(uint32 size, bool makePrivate, int port)
|
|||||||
* quietly.
|
* quietly.
|
||||||
*/
|
*/
|
||||||
shmdt(memAddress);
|
shmdt(memAddress);
|
||||||
if (shmctl(shmid, IPC_RMID, (struct shmid_ds *) NULL) < 0)
|
if (shmctl(shmid, IPC_RMID, NULL) < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.354 2004/01/06 23:15:22 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/postmaster/postmaster.c,v 1.355 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
*
|
*
|
||||||
@ -167,7 +167,7 @@ int MaxBackends;
|
|||||||
int ReservedBackends;
|
int ReservedBackends;
|
||||||
|
|
||||||
|
|
||||||
static char *progname = (char *) NULL;
|
static char *progname = NULL;
|
||||||
|
|
||||||
/* The socket(s) we're listening to. */
|
/* The socket(s) we're listening to. */
|
||||||
#define MAXLISTEN 10
|
#define MAXLISTEN 10
|
||||||
@ -1082,8 +1082,7 @@ ServerLoop(void)
|
|||||||
|
|
||||||
PG_SETMASK(&UnBlockSig);
|
PG_SETMASK(&UnBlockSig);
|
||||||
|
|
||||||
if (select(nSockets, &rmask, (fd_set *) NULL,
|
if (select(nSockets, &rmask, NULL, NULL, &timeout) < 0)
|
||||||
(fd_set *) NULL, &timeout) < 0)
|
|
||||||
{
|
{
|
||||||
PG_SETMASK(&BlockSig);
|
PG_SETMASK(&BlockSig);
|
||||||
if (errno == EINTR || errno == EWOULDBLOCK)
|
if (errno == EINTR || errno == EWOULDBLOCK)
|
||||||
@ -2583,7 +2582,7 @@ BackendRun(Port *port)
|
|||||||
if (port->cmdline_options)
|
if (port->cmdline_options)
|
||||||
split_opts(av, &ac, port->cmdline_options);
|
split_opts(av, &ac, port->cmdline_options);
|
||||||
|
|
||||||
av[ac] = (char *) NULL;
|
av[ac] = NULL;
|
||||||
|
|
||||||
Assert(ac < maxac);
|
Assert(ac < maxac);
|
||||||
|
|
||||||
@ -3038,7 +3037,7 @@ SSDataBase(int xlop)
|
|||||||
av[ac++] = "template1";
|
av[ac++] = "template1";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
av[ac] = (char *) NULL;
|
av[ac] = NULL;
|
||||||
|
|
||||||
Assert(ac < lengthof(av));
|
Assert(ac < lengthof(av));
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.150 2003/12/20 22:18:02 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/buffer/bufmgr.c,v 1.151 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -372,7 +372,7 @@ BufferAlloc(Relation reln,
|
|||||||
* it to disk. Remember to unlock BufMgrLock while doing the IOs.
|
* it to disk. Remember to unlock BufMgrLock while doing the IOs.
|
||||||
*/
|
*/
|
||||||
inProgress = FALSE;
|
inProgress = FALSE;
|
||||||
for (buf = (BufferDesc *) NULL; buf == (BufferDesc *) NULL;)
|
for (buf = NULL; buf == NULL;)
|
||||||
{
|
{
|
||||||
buf = StrategyGetBuffer();
|
buf = StrategyGetBuffer();
|
||||||
|
|
||||||
@ -399,7 +399,7 @@ BufferAlloc(Relation reln,
|
|||||||
if ((buf->flags & BM_IO_ERROR) != 0)
|
if ((buf->flags & BM_IO_ERROR) != 0)
|
||||||
{
|
{
|
||||||
UnpinBuffer(buf);
|
UnpinBuffer(buf);
|
||||||
buf = (BufferDesc *) NULL;
|
buf = NULL;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -440,7 +440,7 @@ BufferAlloc(Relation reln,
|
|||||||
buf->flags &= ~BM_IO_IN_PROGRESS;
|
buf->flags &= ~BM_IO_IN_PROGRESS;
|
||||||
TerminateBufferIO(buf);
|
TerminateBufferIO(buf);
|
||||||
UnpinBuffer(buf);
|
UnpinBuffer(buf);
|
||||||
buf = (BufferDesc *) NULL;
|
buf = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -476,7 +476,7 @@ BufferAlloc(Relation reln,
|
|||||||
buf->flags &= ~BM_IO_IN_PROGRESS;
|
buf->flags &= ~BM_IO_IN_PROGRESS;
|
||||||
TerminateBufferIO(buf);
|
TerminateBufferIO(buf);
|
||||||
UnpinBuffer(buf);
|
UnpinBuffer(buf);
|
||||||
buf = (BufferDesc *) NULL;
|
buf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -799,7 +799,7 @@ BufferSync(int percent, int maxpages)
|
|||||||
bufHdr->flags &= ~BM_JUST_DIRTIED;
|
bufHdr->flags &= ~BM_JUST_DIRTIED;
|
||||||
LWLockRelease(BufMgrLock);
|
LWLockRelease(BufMgrLock);
|
||||||
|
|
||||||
if (reln == (Relation) NULL)
|
if (reln == NULL)
|
||||||
{
|
{
|
||||||
status = smgrblindwrt(DEFAULT_SMGR,
|
status = smgrblindwrt(DEFAULT_SMGR,
|
||||||
bufHdr->tag.rnode,
|
bufHdr->tag.rnode,
|
||||||
@ -849,7 +849,7 @@ BufferSync(int percent, int maxpages)
|
|||||||
LWLockRelease(BufMgrLock);
|
LWLockRelease(BufMgrLock);
|
||||||
|
|
||||||
/* drop refcnt obtained by RelationNodeCacheGetRelation */
|
/* drop refcnt obtained by RelationNodeCacheGetRelation */
|
||||||
if (reln != (Relation) NULL)
|
if (reln != NULL)
|
||||||
RelationDecrementReferenceCount(reln);
|
RelationDecrementReferenceCount(reln);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1105,7 +1105,7 @@ BufferReplace(BufferDesc *bufHdr)
|
|||||||
|
|
||||||
reln = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
|
reln = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
|
||||||
|
|
||||||
if (reln != (Relation) NULL)
|
if (reln != NULL)
|
||||||
{
|
{
|
||||||
status = smgrwrite(DEFAULT_SMGR, reln,
|
status = smgrwrite(DEFAULT_SMGR, reln,
|
||||||
bufHdr->tag.blockNum,
|
bufHdr->tag.blockNum,
|
||||||
@ -1119,7 +1119,7 @@ BufferReplace(BufferDesc *bufHdr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* drop relcache refcnt incremented by RelationNodeCacheGetRelation */
|
/* drop relcache refcnt incremented by RelationNodeCacheGetRelation */
|
||||||
if (reln != (Relation) NULL)
|
if (reln != NULL)
|
||||||
RelationDecrementReferenceCount(reln);
|
RelationDecrementReferenceCount(reln);
|
||||||
|
|
||||||
/* Pop the error context stack */
|
/* Pop the error context stack */
|
||||||
@ -1949,7 +1949,7 @@ LockBufferForCleanup(Buffer buffer)
|
|||||||
* Note : We assume that nested buffer IO never occur.
|
* Note : We assume that nested buffer IO never occur.
|
||||||
* i.e at most one io_in_progress lock is held per proc.
|
* i.e at most one io_in_progress lock is held per proc.
|
||||||
*/
|
*/
|
||||||
static BufferDesc *InProgressBuf = (BufferDesc *) NULL;
|
static BufferDesc *InProgressBuf = NULL;
|
||||||
static bool IsForInput;
|
static bool IsForInput;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1991,7 +1991,7 @@ TerminateBufferIO(BufferDesc *buf)
|
|||||||
{
|
{
|
||||||
Assert(buf == InProgressBuf);
|
Assert(buf == InProgressBuf);
|
||||||
LWLockRelease(buf->io_in_progress_lock);
|
LWLockRelease(buf->io_in_progress_lock);
|
||||||
InProgressBuf = (BufferDesc *) NULL;
|
InProgressBuf = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2016,7 +2016,7 @@ ContinueBufferIO(BufferDesc *buf, bool forInput)
|
|||||||
void
|
void
|
||||||
InitBufferIO(void)
|
InitBufferIO(void)
|
||||||
{
|
{
|
||||||
InProgressBuf = (BufferDesc *) NULL;
|
InProgressBuf = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.50 2003/11/29 19:51:56 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/buffer/localbuf.c,v 1.51 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -41,7 +41,7 @@ BufferDesc *
|
|||||||
LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
|
LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
BufferDesc *bufHdr = (BufferDesc *) NULL;
|
BufferDesc *bufHdr = NULL;
|
||||||
|
|
||||||
/* a low tech search for now -- not optimized for scans */
|
/* a low tech search for now -- not optimized for scans */
|
||||||
for (i = 0; i < NLocBuffer; i++)
|
for (i = 0; i < NLocBuffer; i++)
|
||||||
@ -93,7 +93,7 @@ LocalBufferAlloc(Relation reln, BlockNumber blockNum, bool *foundPtr)
|
|||||||
Relation bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
|
Relation bufrel = RelationNodeCacheGetRelation(bufHdr->tag.rnode);
|
||||||
|
|
||||||
/* flush this page */
|
/* flush this page */
|
||||||
if (bufrel == (Relation) NULL)
|
if (bufrel == NULL)
|
||||||
{
|
{
|
||||||
smgrblindwrt(DEFAULT_SMGR,
|
smgrblindwrt(DEFAULT_SMGR,
|
||||||
bufHdr->tag.rnode,
|
bufHdr->tag.rnode,
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.143 2003/12/25 03:52:51 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/lmgr/proc.c,v 1.144 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -745,7 +745,7 @@ ProcWakeup(PGPROC *proc, int errType)
|
|||||||
/* Proc should be sleeping ... */
|
/* Proc should be sleeping ... */
|
||||||
if (proc->links.prev == INVALID_OFFSET ||
|
if (proc->links.prev == INVALID_OFFSET ||
|
||||||
proc->links.next == INVALID_OFFSET)
|
proc->links.next == INVALID_OFFSET)
|
||||||
return (PGPROC *) NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Save next process before we zap the list link */
|
/* Save next process before we zap the list link */
|
||||||
retProc = (PGPROC *) MAKE_PTR(proc->links.next);
|
retProc = (PGPROC *) MAKE_PTR(proc->links.next);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.100 2004/01/06 18:07:31 neilc Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/smgr/md.c,v 1.101 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -60,7 +60,7 @@ typedef struct _MdfdVec
|
|||||||
} MdfdVec;
|
} MdfdVec;
|
||||||
|
|
||||||
static int Nfds = 100; /* initial/current size of Md_fdvec array */
|
static int Nfds = 100; /* initial/current size of Md_fdvec array */
|
||||||
static MdfdVec *Md_fdvec = (MdfdVec *) NULL;
|
static MdfdVec *Md_fdvec = NULL;
|
||||||
static int Md_Free = -1; /* head of freelist of unused fdvec
|
static int Md_Free = -1; /* head of freelist of unused fdvec
|
||||||
* entries */
|
* entries */
|
||||||
static int CurFd = 0; /* first never-used fdvec index */
|
static int CurFd = 0; /* first never-used fdvec index */
|
||||||
@ -158,7 +158,7 @@ mdcreate(Relation reln)
|
|||||||
Md_fdvec[vfd].mdfd_vfd = fd;
|
Md_fdvec[vfd].mdfd_vfd = fd;
|
||||||
Md_fdvec[vfd].mdfd_flags = (uint16) 0;
|
Md_fdvec[vfd].mdfd_flags = (uint16) 0;
|
||||||
#ifndef LET_OS_MANAGE_FILESIZE
|
#ifndef LET_OS_MANAGE_FILESIZE
|
||||||
Md_fdvec[vfd].mdfd_chain = (MdfdVec *) NULL;
|
Md_fdvec[vfd].mdfd_chain = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return vfd;
|
return vfd;
|
||||||
@ -322,7 +322,7 @@ mdopen(Relation reln)
|
|||||||
Md_fdvec[vfd].mdfd_vfd = fd;
|
Md_fdvec[vfd].mdfd_vfd = fd;
|
||||||
Md_fdvec[vfd].mdfd_flags = (uint16) 0;
|
Md_fdvec[vfd].mdfd_flags = (uint16) 0;
|
||||||
#ifndef LET_OS_MANAGE_FILESIZE
|
#ifndef LET_OS_MANAGE_FILESIZE
|
||||||
Md_fdvec[vfd].mdfd_chain = (MdfdVec *) NULL;
|
Md_fdvec[vfd].mdfd_chain = NULL;
|
||||||
Assert(_mdnblocks(fd, BLCKSZ) <= ((BlockNumber) RELSEG_SIZE));
|
Assert(_mdnblocks(fd, BLCKSZ) <= ((BlockNumber) RELSEG_SIZE));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -359,7 +359,7 @@ mdclose_fd(int fd)
|
|||||||
MdfdVec *v;
|
MdfdVec *v;
|
||||||
|
|
||||||
#ifndef LET_OS_MANAGE_FILESIZE
|
#ifndef LET_OS_MANAGE_FILESIZE
|
||||||
for (v = &Md_fdvec[fd]; v != (MdfdVec *) NULL;)
|
for (v = &Md_fdvec[fd]; v != NULL;)
|
||||||
{
|
{
|
||||||
MdfdVec *ov = v;
|
MdfdVec *ov = v;
|
||||||
|
|
||||||
@ -372,10 +372,10 @@ mdclose_fd(int fd)
|
|||||||
pfree(ov);
|
pfree(ov);
|
||||||
}
|
}
|
||||||
|
|
||||||
Md_fdvec[fd].mdfd_chain = (MdfdVec *) NULL;
|
Md_fdvec[fd].mdfd_chain = NULL;
|
||||||
#else
|
#else
|
||||||
v = &Md_fdvec[fd];
|
v = &Md_fdvec[fd];
|
||||||
if (v != (MdfdVec *) NULL)
|
if (v != NULL)
|
||||||
{
|
{
|
||||||
if (v->mdfd_vfd >= 0)
|
if (v->mdfd_vfd >= 0)
|
||||||
FileClose(v->mdfd_vfd);
|
FileClose(v->mdfd_vfd);
|
||||||
@ -553,7 +553,7 @@ mdnblocks(Relation reln)
|
|||||||
* levels to handle that scenario by closing and re-opening the md
|
* levels to handle that scenario by closing and re-opening the md
|
||||||
* fd.)
|
* fd.)
|
||||||
*/
|
*/
|
||||||
while (v->mdfd_chain != (MdfdVec *) NULL)
|
while (v->mdfd_chain != NULL)
|
||||||
{
|
{
|
||||||
segno++;
|
segno++;
|
||||||
v = v->mdfd_chain;
|
v = v->mdfd_chain;
|
||||||
@ -572,7 +572,7 @@ mdnblocks(Relation reln)
|
|||||||
*/
|
*/
|
||||||
segno++;
|
segno++;
|
||||||
|
|
||||||
if (v->mdfd_chain == (MdfdVec *) NULL)
|
if (v->mdfd_chain == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Because we pass O_CREAT, we will create the next segment
|
* Because we pass O_CREAT, we will create the next segment
|
||||||
@ -582,7 +582,7 @@ mdnblocks(Relation reln)
|
|||||||
* worth.
|
* worth.
|
||||||
*/
|
*/
|
||||||
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 == NULL)
|
||||||
elog(ERROR, "could not count blocks of \"%s\": %m",
|
elog(ERROR, "could not count blocks of \"%s\": %m",
|
||||||
RelationGetRelationName(reln));
|
RelationGetRelationName(reln));
|
||||||
}
|
}
|
||||||
@ -625,7 +625,7 @@ mdtruncate(Relation reln, BlockNumber nblocks)
|
|||||||
|
|
||||||
#ifndef LET_OS_MANAGE_FILESIZE
|
#ifndef LET_OS_MANAGE_FILESIZE
|
||||||
priorblocks = 0;
|
priorblocks = 0;
|
||||||
while (v != (MdfdVec *) NULL)
|
while (v != NULL)
|
||||||
{
|
{
|
||||||
MdfdVec *ov = v;
|
MdfdVec *ov = v;
|
||||||
|
|
||||||
@ -660,7 +660,7 @@ mdtruncate(Relation reln, BlockNumber nblocks)
|
|||||||
if (FileTruncate(v->mdfd_vfd, lastsegblocks * BLCKSZ) < 0)
|
if (FileTruncate(v->mdfd_vfd, lastsegblocks * BLCKSZ) < 0)
|
||||||
return InvalidBlockNumber;
|
return InvalidBlockNumber;
|
||||||
v = v->mdfd_chain;
|
v = v->mdfd_chain;
|
||||||
ov->mdfd_chain = (MdfdVec *) NULL;
|
ov->mdfd_chain = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -815,7 +815,7 @@ _mdfd_openseg(Relation reln, BlockNumber segno, int oflags)
|
|||||||
pfree(fullpath);
|
pfree(fullpath);
|
||||||
|
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return (MdfdVec *) NULL;
|
return NULL;
|
||||||
|
|
||||||
/* allocate an mdfdvec entry for it */
|
/* allocate an mdfdvec entry for it */
|
||||||
v = (MdfdVec *) MemoryContextAlloc(MdCxt, sizeof(MdfdVec));
|
v = (MdfdVec *) MemoryContextAlloc(MdCxt, sizeof(MdfdVec));
|
||||||
@ -824,7 +824,7 @@ _mdfd_openseg(Relation reln, BlockNumber segno, int oflags)
|
|||||||
v->mdfd_vfd = fd;
|
v->mdfd_vfd = fd;
|
||||||
v->mdfd_flags = (uint16) 0;
|
v->mdfd_flags = (uint16) 0;
|
||||||
#ifndef LET_OS_MANAGE_FILESIZE
|
#ifndef LET_OS_MANAGE_FILESIZE
|
||||||
v->mdfd_chain = (MdfdVec *) NULL;
|
v->mdfd_chain = NULL;
|
||||||
Assert(_mdnblocks(fd, BLCKSZ) <= ((BlockNumber) RELSEG_SIZE));
|
Assert(_mdnblocks(fd, BLCKSZ) <= ((BlockNumber) RELSEG_SIZE));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -877,7 +877,7 @@ _mdfd_getseg(Relation reln, BlockNumber blkno)
|
|||||||
i++, segno--)
|
i++, segno--)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (v->mdfd_chain == (MdfdVec *) NULL)
|
if (v->mdfd_chain == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* We will create the next segment only if the target block is
|
* We will create the next segment only if the target block is
|
||||||
@ -891,7 +891,7 @@ _mdfd_getseg(Relation reln, BlockNumber blkno)
|
|||||||
*/
|
*/
|
||||||
v->mdfd_chain = _mdfd_openseg(reln, i, (segno == 1) ? O_CREAT : 0);
|
v->mdfd_chain = _mdfd_openseg(reln, i, (segno == 1) ? O_CREAT : 0);
|
||||||
|
|
||||||
if (v->mdfd_chain == (MdfdVec *) NULL)
|
if (v->mdfd_chain == NULL)
|
||||||
elog(ERROR, "could not open segment %u of relation \"%s\" (target block %u): %m",
|
elog(ERROR, "could not open segment %u of relation \"%s\" (target block %u): %m",
|
||||||
i, RelationGetRelationName(reln), blkno);
|
i, RelationGetRelationName(reln), blkno);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/storage/smgr/mm.c,v 1.35 2003/11/29 19:51:57 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/storage/smgr/mm.c,v 1.36 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -96,7 +96,7 @@ mminit(void)
|
|||||||
mmsize += MAXALIGN((MMNBUFFERS * sizeof(MMCacheTag)));
|
mmsize += MAXALIGN((MMNBUFFERS * sizeof(MMCacheTag)));
|
||||||
mmcacheblk = (char *) ShmemInitStruct("Main memory smgr", mmsize, &found);
|
mmcacheblk = (char *) ShmemInitStruct("Main memory smgr", mmsize, &found);
|
||||||
|
|
||||||
if (mmcacheblk == (char *) NULL)
|
if (mmcacheblk == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
return SM_FAIL;
|
return SM_FAIL;
|
||||||
@ -110,7 +110,7 @@ mminit(void)
|
|||||||
MMNBUFFERS, MMNBUFFERS,
|
MMNBUFFERS, MMNBUFFERS,
|
||||||
&info, (HASH_ELEM | HASH_FUNCTION));
|
&info, (HASH_ELEM | HASH_FUNCTION));
|
||||||
|
|
||||||
if (MMCacheHT == (HTAB *) NULL)
|
if (MMCacheHT == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
return SM_FAIL;
|
return SM_FAIL;
|
||||||
@ -124,7 +124,7 @@ mminit(void)
|
|||||||
MMNRELATIONS, MMNRELATIONS,
|
MMNRELATIONS, MMNRELATIONS,
|
||||||
&info, (HASH_ELEM | HASH_FUNCTION));
|
&info, (HASH_ELEM | HASH_FUNCTION));
|
||||||
|
|
||||||
if (MMRelCacheHT == (HTAB *) NULL)
|
if (MMRelCacheHT == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
return SM_FAIL;
|
return SM_FAIL;
|
||||||
@ -183,7 +183,7 @@ mmcreate(Relation reln)
|
|||||||
(void *) &tag,
|
(void *) &tag,
|
||||||
HASH_ENTER, &found);
|
HASH_ENTER, &found);
|
||||||
|
|
||||||
if (entry == (MMRelHashEntry *) NULL)
|
if (entry == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
ereport(FATAL,
|
ereport(FATAL,
|
||||||
@ -228,7 +228,7 @@ mmunlink(RelFileNode rnode)
|
|||||||
entry = (MMHashEntry *) hash_search(MMCacheHT,
|
entry = (MMHashEntry *) hash_search(MMCacheHT,
|
||||||
(void *) &MMBlockTags[i],
|
(void *) &MMBlockTags[i],
|
||||||
HASH_REMOVE, NULL);
|
HASH_REMOVE, NULL);
|
||||||
if (entry == (MMHashEntry *) NULL)
|
if (entry == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
elog(FATAL, "cache hash table corrupted");
|
elog(FATAL, "cache hash table corrupted");
|
||||||
@ -245,7 +245,7 @@ mmunlink(RelFileNode rnode)
|
|||||||
(void *) &rtag,
|
(void *) &rtag,
|
||||||
HASH_REMOVE, NULL);
|
HASH_REMOVE, NULL);
|
||||||
|
|
||||||
if (rentry == (MMRelHashEntry *) NULL)
|
if (rentry == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
elog(FATAL, "rel cache hash table corrupted");
|
elog(FATAL, "rel cache hash table corrupted");
|
||||||
@ -308,7 +308,7 @@ mmextend(Relation reln, BlockNumber blocknum, char *buffer)
|
|||||||
rentry = (MMRelHashEntry *) hash_search(MMRelCacheHT,
|
rentry = (MMRelHashEntry *) hash_search(MMRelCacheHT,
|
||||||
(void *) &rtag,
|
(void *) &rtag,
|
||||||
HASH_FIND, NULL);
|
HASH_FIND, NULL);
|
||||||
if (rentry == (MMRelHashEntry *) NULL)
|
if (rentry == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
elog(FATAL, "rel cache hash table corrupted");
|
elog(FATAL, "rel cache hash table corrupted");
|
||||||
@ -319,7 +319,7 @@ mmextend(Relation reln, BlockNumber blocknum, char *buffer)
|
|||||||
entry = (MMHashEntry *) hash_search(MMCacheHT,
|
entry = (MMHashEntry *) hash_search(MMCacheHT,
|
||||||
(void *) &tag,
|
(void *) &tag,
|
||||||
HASH_ENTER, &found);
|
HASH_ENTER, &found);
|
||||||
if (entry == (MMHashEntry *) NULL || found)
|
if (entry == NULL || found)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
elog(FATAL, "cache hash table corrupted");
|
elog(FATAL, "cache hash table corrupted");
|
||||||
@ -389,7 +389,7 @@ mmread(Relation reln, BlockNumber blocknum, char *buffer)
|
|||||||
(void *) &tag,
|
(void *) &tag,
|
||||||
HASH_FIND, NULL);
|
HASH_FIND, NULL);
|
||||||
|
|
||||||
if (entry == (MMHashEntry *) NULL)
|
if (entry == NULL)
|
||||||
{
|
{
|
||||||
/* reading nonexistent pages is defined to fill them with zeroes */
|
/* reading nonexistent pages is defined to fill them with zeroes */
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
@ -430,7 +430,7 @@ mmwrite(Relation reln, BlockNumber blocknum, char *buffer)
|
|||||||
(void *) &tag,
|
(void *) &tag,
|
||||||
HASH_FIND, NULL);
|
HASH_FIND, NULL);
|
||||||
|
|
||||||
if (entry == (MMHashEntry *) NULL)
|
if (entry == NULL)
|
||||||
{
|
{
|
||||||
LWLockRelease(MMCacheLock);
|
LWLockRelease(MMCacheLock);
|
||||||
elog(FATAL, "cache hash table missing requested page");
|
elog(FATAL, "cache hash table missing requested page");
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.70 2003/11/29 19:51:57 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/tcop/fastpath.c,v 1.71 2004/01/07 18:56:27 neilc Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* This cruft is the server side of PQfn.
|
* This cruft is the server side of PQfn.
|
||||||
@ -206,7 +206,7 @@ fetch_fp_info(Oid func_id, struct fp_info * fip)
|
|||||||
Form_pg_proc pp;
|
Form_pg_proc pp;
|
||||||
|
|
||||||
Assert(OidIsValid(func_id));
|
Assert(OidIsValid(func_id));
|
||||||
Assert(fip != (struct fp_info *) NULL);
|
Assert(fip != NULL);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since the validity of this structure is determined by whether the
|
* Since the validity of this structure is determined by whether the
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
# IDENTIFICATION
|
# IDENTIFICATION
|
||||||
# $PostgreSQL: pgsql/src/backend/utils/Gen_fmgrtab.sh,v 1.28 2004/01/04 05:57:21 tgl Exp $
|
# $PostgreSQL: pgsql/src/backend/utils/Gen_fmgrtab.sh,v 1.29 2004/01/07 18:56:28 neilc Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -223,7 +223,7 @@ cat >> "$$-$TABLEFILE" <<FuNkYfMgRtAbStUfF
|
|||||||
/* dummy entry is easier than getting rid of comma after last real one */
|
/* dummy entry is easier than getting rid of comma after last real one */
|
||||||
/* (not that there has ever been anything wrong with *having* a
|
/* (not that there has ever been anything wrong with *having* a
|
||||||
comma after the last field in an array initializer) */
|
comma after the last field in an array initializer) */
|
||||||
{ 0, NULL, 0, false, false, (PGFunction) NULL }
|
{ 0, NULL, 0, false, false, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Note fmgr_nbuiltins excludes the dummy entry */
|
/* Note fmgr_nbuiltins excludes the dummy entry */
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.101 2003/11/29 19:51:57 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.102 2004/01/07 18:56:28 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -307,10 +307,8 @@ array_in(PG_FUNCTION_ARGS)
|
|||||||
retval->size = nbytes;
|
retval->size = nbytes;
|
||||||
retval->ndim = ndim;
|
retval->ndim = ndim;
|
||||||
retval->elemtype = element_type;
|
retval->elemtype = element_type;
|
||||||
memcpy((char *) ARR_DIMS(retval), (char *) dim,
|
memcpy(ARR_DIMS(retval), dim, ndim * sizeof(int));
|
||||||
ndim * sizeof(int));
|
memcpy(ARR_LBOUND(retval), lBound, ndim * sizeof(int));
|
||||||
memcpy((char *) ARR_LBOUND(retval), (char *) lBound,
|
|
||||||
ndim * sizeof(int));
|
|
||||||
|
|
||||||
CopyArrayEls(ARR_DATA_PTR(retval), dataPtr, nitems,
|
CopyArrayEls(ARR_DATA_PTR(retval), dataPtr, nitems,
|
||||||
typlen, typbyval, typalign, true);
|
typlen, typbyval, typalign, true);
|
||||||
@ -972,10 +970,8 @@ array_recv(PG_FUNCTION_ARGS)
|
|||||||
retval->size = nbytes;
|
retval->size = nbytes;
|
||||||
retval->ndim = ndim;
|
retval->ndim = ndim;
|
||||||
retval->elemtype = element_type;
|
retval->elemtype = element_type;
|
||||||
memcpy((char *) ARR_DIMS(retval), (char *) dim,
|
memcpy(ARR_DIMS(retval), dim, ndim * sizeof(int));
|
||||||
ndim * sizeof(int));
|
memcpy(ARR_LBOUND(retval), lBound, ndim * sizeof(int));
|
||||||
memcpy((char *) ARR_LBOUND(retval), (char *) lBound,
|
|
||||||
ndim * sizeof(int));
|
|
||||||
|
|
||||||
CopyArrayEls(ARR_DATA_PTR(retval), dataPtr, nitems,
|
CopyArrayEls(ARR_DATA_PTR(retval), dataPtr, nitems,
|
||||||
typlen, typbyval, typalign, true);
|
typlen, typbyval, typalign, true);
|
||||||
@ -1384,7 +1380,7 @@ array_ref(ArrayType *array,
|
|||||||
char *arraydataptr,
|
char *arraydataptr,
|
||||||
*retptr;
|
*retptr;
|
||||||
|
|
||||||
if (array == (ArrayType *) NULL)
|
if (array == NULL)
|
||||||
RETURN_NULL(Datum);
|
RETURN_NULL(Datum);
|
||||||
|
|
||||||
if (arraylen > 0)
|
if (arraylen > 0)
|
||||||
@ -1463,7 +1459,7 @@ array_get_slice(ArrayType *array,
|
|||||||
int bytes,
|
int bytes,
|
||||||
span[MAXDIM];
|
span[MAXDIM];
|
||||||
|
|
||||||
if (array == (ArrayType *) NULL)
|
if (array == NULL)
|
||||||
RETURN_NULL(ArrayType *);
|
RETURN_NULL(ArrayType *);
|
||||||
|
|
||||||
if (arraylen > 0)
|
if (arraylen > 0)
|
||||||
@ -1602,7 +1598,7 @@ array_set(ArrayType *array,
|
|||||||
lenbefore,
|
lenbefore,
|
||||||
lenafter;
|
lenafter;
|
||||||
|
|
||||||
if (array == (ArrayType *) NULL)
|
if (array == NULL)
|
||||||
RETURN_NULL(ArrayType *);
|
RETURN_NULL(ArrayType *);
|
||||||
|
|
||||||
if (arraylen > 0)
|
if (arraylen > 0)
|
||||||
@ -1798,9 +1794,9 @@ array_set_slice(ArrayType *array,
|
|||||||
lenbefore,
|
lenbefore,
|
||||||
lenafter;
|
lenafter;
|
||||||
|
|
||||||
if (array == (ArrayType *) NULL)
|
if (array == NULL)
|
||||||
RETURN_NULL(ArrayType *);
|
RETURN_NULL(ArrayType *);
|
||||||
if (srcArray == (ArrayType *) NULL)
|
if (srcArray == NULL)
|
||||||
return array;
|
return array;
|
||||||
|
|
||||||
if (arraylen > 0)
|
if (arraylen > 0)
|
||||||
@ -2279,8 +2275,8 @@ construct_md_array(Datum *elems,
|
|||||||
result->ndim = ndims;
|
result->ndim = ndims;
|
||||||
result->flags = 0;
|
result->flags = 0;
|
||||||
result->elemtype = elmtype;
|
result->elemtype = elmtype;
|
||||||
memcpy((char *) ARR_DIMS(result), (char *) dims, ndims * sizeof(int));
|
memcpy(ARR_DIMS(result), dims, ndims * sizeof(int));
|
||||||
memcpy((char *) ARR_LBOUND(result), (char *) lbs, ndims * sizeof(int));
|
memcpy(ARR_LBOUND(result), lbs, ndims * sizeof(int));
|
||||||
CopyArrayEls(ARR_DATA_PTR(result), elems, nelems,
|
CopyArrayEls(ARR_DATA_PTR(result), elems, nelems,
|
||||||
elmlen, elmbyval, elmalign, false);
|
elmlen, elmbyval, elmalign, false);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/* -----------------------------------------------------------------------
|
/* -----------------------------------------------------------------------
|
||||||
* formatting.c
|
* formatting.c
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.71 2003/12/25 03:36:23 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/formatting.c,v 1.72 2004/01/07 18:56:28 neilc Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* Portions Copyright (c) 1999-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1999-2003, PostgreSQL Global Development Group
|
||||||
@ -927,7 +927,7 @@ index_seq_search(char *str, KeyWord *kw, int *index)
|
|||||||
int poz;
|
int poz;
|
||||||
|
|
||||||
if (!KeyWord_INDEX_FILTER(*str))
|
if (!KeyWord_INDEX_FILTER(*str))
|
||||||
return (KeyWord *) NULL;
|
return NULL;
|
||||||
|
|
||||||
if ((poz = *(index + (*str - ' '))) > -1)
|
if ((poz = *(index + (*str - ' '))) > -1)
|
||||||
{
|
{
|
||||||
@ -940,10 +940,10 @@ index_seq_search(char *str, KeyWord *kw, int *index)
|
|||||||
return k;
|
return k;
|
||||||
k++;
|
k++;
|
||||||
if (!k->name)
|
if (!k->name)
|
||||||
return (KeyWord *) NULL;
|
return NULL;
|
||||||
} while (*str == *k->name);
|
} while (*str == *k->name);
|
||||||
}
|
}
|
||||||
return (KeyWord *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static KeySuffix *
|
static KeySuffix *
|
||||||
@ -959,7 +959,7 @@ suff_search(char *str, KeySuffix *suf, int type)
|
|||||||
if (!strncmp(str, s->name, s->len))
|
if (!strncmp(str, s->name, s->len))
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
return (KeySuffix *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------
|
/* ----------
|
||||||
@ -1246,7 +1246,7 @@ parse_format(FormatNode *node, char *str, KeyWord *kw,
|
|||||||
}
|
}
|
||||||
n->type = NODE_TYPE_CHAR;
|
n->type = NODE_TYPE_CHAR;
|
||||||
n->character = *str;
|
n->character = *str;
|
||||||
n->key = (KeyWord *) NULL;
|
n->key = NULL;
|
||||||
n->suffix = 0;
|
n->suffix = 0;
|
||||||
++n;
|
++n;
|
||||||
x = *str;
|
x = *str;
|
||||||
@ -1266,7 +1266,7 @@ parse_format(FormatNode *node, char *str, KeyWord *kw,
|
|||||||
{
|
{
|
||||||
n->type = NODE_TYPE_CHAR;
|
n->type = NODE_TYPE_CHAR;
|
||||||
n->character = *str;
|
n->character = *str;
|
||||||
n->key = (KeyWord *) NULL;
|
n->key = NULL;
|
||||||
node_set = 1;
|
node_set = 1;
|
||||||
last = 0;
|
last = 0;
|
||||||
str++;
|
str++;
|
||||||
@ -2731,7 +2731,7 @@ DCH_cache_getnew(char *str)
|
|||||||
return ent;
|
return ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DCHCacheEntry *) NULL; /* never */
|
return NULL; /* never */
|
||||||
}
|
}
|
||||||
|
|
||||||
static DCHCacheEntry *
|
static DCHCacheEntry *
|
||||||
@ -2761,7 +2761,7 @@ DCH_cache_search(char *str)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (DCHCacheEntry *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static text *
|
static text *
|
||||||
@ -3362,7 +3362,7 @@ NUM_cache_search(char *str)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (NUMCacheEntry *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.59 2003/11/29 19:51:59 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/numutils.c,v 1.60 2004/01/07 18:56:28 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -64,7 +64,7 @@ pg_atoi(char *s, int size, int c)
|
|||||||
* Some versions of strtol treat the empty string as an error, but
|
* Some versions of strtol treat the empty string as an error, but
|
||||||
* some seem not to. Make an explicit test to be sure we catch it.
|
* some seem not to. Make an explicit test to be sure we catch it.
|
||||||
*/
|
*/
|
||||||
if (s == (char *) NULL)
|
if (s == NULL)
|
||||||
elog(ERROR, "NULL pointer");
|
elog(ERROR, "NULL pointer");
|
||||||
if (*s == 0)
|
if (*s == 0)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
*
|
*
|
||||||
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.65 2003/11/29 19:51:59 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/ri_triggers.c,v 1.66 2004/01/07 18:56:28 neilc Exp $
|
||||||
*
|
*
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
@ -114,7 +114,7 @@ typedef struct RI_QueryHashEntry
|
|||||||
* Local data
|
* Local data
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
static HTAB *ri_query_cache = (HTAB *) NULL;
|
static HTAB *ri_query_cache = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* ----------
|
/* ----------
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.153 2004/01/05 23:39:54 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.154 2004/01/07 18:56:28 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -3822,7 +3822,7 @@ make_greater_string(const Const *str_const)
|
|||||||
if (workstr != NULL)
|
if (workstr != NULL)
|
||||||
pfree(workstr);
|
pfree(workstr);
|
||||||
|
|
||||||
return (Const *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.67 2003/11/29 19:52:01 pgsql Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/fmgr/dfmgr.c,v 1.68 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -40,8 +40,8 @@ typedef struct df_files
|
|||||||
*/
|
*/
|
||||||
} DynamicFileList;
|
} DynamicFileList;
|
||||||
|
|
||||||
static DynamicFileList *file_list = (DynamicFileList *) NULL;
|
static DynamicFileList *file_list = NULL;
|
||||||
static DynamicFileList *file_tail = (DynamicFileList *) NULL;
|
static DynamicFileList *file_tail = NULL;
|
||||||
|
|
||||||
#define SAME_INODE(A,B) ((A).st_ino == (B).inode && (A).st_dev == (B).device)
|
#define SAME_INODE(A,B) ((A).st_ino == (B).inode && (A).st_dev == (B).device)
|
||||||
|
|
||||||
@ -84,11 +84,11 @@ load_external_function(char *filename, char *funcname,
|
|||||||
* Scan the list of loaded FILES to see if the file has been loaded.
|
* Scan the list of loaded FILES to see if the file has been loaded.
|
||||||
*/
|
*/
|
||||||
for (file_scanner = file_list;
|
for (file_scanner = file_list;
|
||||||
file_scanner != (DynamicFileList *) NULL &&
|
file_scanner != NULL &&
|
||||||
strcmp(fullname, file_scanner->filename) != 0;
|
strcmp(fullname, file_scanner->filename) != 0;
|
||||||
file_scanner = file_scanner->next)
|
file_scanner = file_scanner->next)
|
||||||
;
|
;
|
||||||
if (file_scanner == (DynamicFileList *) NULL)
|
if (file_scanner == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Check for same files - different paths (ie, symlink or link)
|
* Check for same files - different paths (ie, symlink or link)
|
||||||
@ -100,13 +100,13 @@ load_external_function(char *filename, char *funcname,
|
|||||||
fullname)));
|
fullname)));
|
||||||
|
|
||||||
for (file_scanner = file_list;
|
for (file_scanner = file_list;
|
||||||
file_scanner != (DynamicFileList *) NULL &&
|
file_scanner != NULL &&
|
||||||
!SAME_INODE(stat_buf, *file_scanner);
|
!SAME_INODE(stat_buf, *file_scanner);
|
||||||
file_scanner = file_scanner->next)
|
file_scanner = file_scanner->next)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (file_scanner == (DynamicFileList *) NULL)
|
if (file_scanner == NULL)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* File not loaded yet.
|
* File not loaded yet.
|
||||||
@ -122,10 +122,10 @@ load_external_function(char *filename, char *funcname,
|
|||||||
strcpy(file_scanner->filename, fullname);
|
strcpy(file_scanner->filename, fullname);
|
||||||
file_scanner->device = stat_buf.st_dev;
|
file_scanner->device = stat_buf.st_dev;
|
||||||
file_scanner->inode = stat_buf.st_ino;
|
file_scanner->inode = stat_buf.st_ino;
|
||||||
file_scanner->next = (DynamicFileList *) NULL;
|
file_scanner->next = NULL;
|
||||||
|
|
||||||
file_scanner->handle = pg_dlopen(fullname);
|
file_scanner->handle = pg_dlopen(fullname);
|
||||||
if (file_scanner->handle == (void *) NULL)
|
if (file_scanner->handle == NULL)
|
||||||
{
|
{
|
||||||
load_error = (char *) pg_dlerror();
|
load_error = (char *) pg_dlerror();
|
||||||
free((char *) file_scanner);
|
free((char *) file_scanner);
|
||||||
@ -137,7 +137,7 @@ load_external_function(char *filename, char *funcname,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* OK to link it into list */
|
/* OK to link it into list */
|
||||||
if (file_list == (DynamicFileList *) NULL)
|
if (file_list == NULL)
|
||||||
file_list = file_scanner;
|
file_list = file_scanner;
|
||||||
else
|
else
|
||||||
file_tail->next = file_scanner;
|
file_tail->next = file_scanner;
|
||||||
@ -151,15 +151,15 @@ load_external_function(char *filename, char *funcname,
|
|||||||
/*
|
/*
|
||||||
* If funcname is NULL, we only wanted to load the file.
|
* If funcname is NULL, we only wanted to load the file.
|
||||||
*/
|
*/
|
||||||
if (funcname == (char *) NULL)
|
if (funcname == NULL)
|
||||||
{
|
{
|
||||||
pfree(fullname);
|
pfree(fullname);
|
||||||
return (PGFunction) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
retval = pg_dlsym(file_scanner->handle, funcname);
|
retval = pg_dlsym(file_scanner->handle, funcname);
|
||||||
|
|
||||||
if (retval == (PGFunction) NULL && signalNotFound)
|
if (retval == NULL && signalNotFound)
|
||||||
ereport(ERROR,
|
ereport(ERROR,
|
||||||
(errcode(ERRCODE_UNDEFINED_FUNCTION),
|
(errcode(ERRCODE_UNDEFINED_FUNCTION),
|
||||||
errmsg("could not find function \"%s\" in file \"%s\"",
|
errmsg("could not find function \"%s\" in file \"%s\"",
|
||||||
@ -221,7 +221,7 @@ load_file(char *filename)
|
|||||||
prv = file_scanner;
|
prv = file_scanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
load_external_function(fullname, (char *) NULL, false, (void *) NULL);
|
load_external_function(fullname, NULL, false, NULL);
|
||||||
|
|
||||||
pfree(fullname);
|
pfree(fullname);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.78 2004/01/06 23:55:19 tgl Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/fmgr/fmgr.c,v 1.79 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -93,7 +93,7 @@ fmgr_isbuiltin(Oid id)
|
|||||||
else
|
else
|
||||||
high = i - 1;
|
high = i - 1;
|
||||||
}
|
}
|
||||||
return (const FmgrBuiltin *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -111,7 +111,7 @@ fmgr_lookupByName(const char *name)
|
|||||||
if (strcmp(name, fmgr_builtins[i].funcName) == 0)
|
if (strcmp(name, fmgr_builtins[i].funcName) == 0)
|
||||||
return fmgr_builtins + i;
|
return fmgr_builtins + i;
|
||||||
}
|
}
|
||||||
return (const FmgrBuiltin *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -384,7 +384,7 @@ fetch_finfo_record(void *filehandle, char *funcname)
|
|||||||
/* Try to look up the info function */
|
/* Try to look up the info function */
|
||||||
infofunc = (PGFInfoFunction) lookup_external_function(filehandle,
|
infofunc = (PGFInfoFunction) lookup_external_function(filehandle,
|
||||||
infofuncname);
|
infofuncname);
|
||||||
if (infofunc == (PGFInfoFunction) NULL)
|
if (infofunc == NULL)
|
||||||
{
|
{
|
||||||
/* Not found --- assume version 0 */
|
/* Not found --- assume version 0 */
|
||||||
pfree(infofuncname);
|
pfree(infofuncname);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.30 2003/12/03 08:49:17 meskes Exp $ */
|
/* $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/execute.c,v 1.31 2004/01/07 18:56:29 neilc Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The aim is to get a simpler inteface to the database routines.
|
* The aim is to get a simpler inteface to the database routines.
|
||||||
@ -190,7 +190,7 @@ free_variable(struct variable * var)
|
|||||||
{
|
{
|
||||||
struct variable *var_next;
|
struct variable *var_next;
|
||||||
|
|
||||||
if (var == (struct variable *) NULL)
|
if (var == NULL)
|
||||||
return;
|
return;
|
||||||
var_next = var->next;
|
var_next = var->next;
|
||||||
ECPGfree(var);
|
ECPGfree(var);
|
||||||
@ -206,7 +206,7 @@ free_variable(struct variable * var)
|
|||||||
static void
|
static void
|
||||||
free_statement(struct statement * stmt)
|
free_statement(struct statement * stmt)
|
||||||
{
|
{
|
||||||
if (stmt == (struct statement *) NULL)
|
if (stmt == NULL)
|
||||||
return;
|
return;
|
||||||
free_variable(stmt->inlist);
|
free_variable(stmt->inlist);
|
||||||
free_variable(stmt->outlist);
|
free_variable(stmt->outlist);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtcl.c,v 1.29 2003/11/29 19:52:11 pgsql Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtcl.c,v 1.30 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -53,109 +53,109 @@ Pgtcl_Init(Tcl_Interp *interp)
|
|||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_conndefaults",
|
"pg_conndefaults",
|
||||||
Pg_conndefaults,
|
Pg_conndefaults,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_connect",
|
"pg_connect",
|
||||||
Pg_connect,
|
Pg_connect,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_disconnect",
|
"pg_disconnect",
|
||||||
Pg_disconnect,
|
Pg_disconnect,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_exec",
|
"pg_exec",
|
||||||
Pg_exec,
|
Pg_exec,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_select",
|
"pg_select",
|
||||||
Pg_select,
|
Pg_select,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_result",
|
"pg_result",
|
||||||
Pg_result,
|
Pg_result,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_execute",
|
"pg_execute",
|
||||||
Pg_execute,
|
Pg_execute,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_open",
|
"pg_lo_open",
|
||||||
Pg_lo_open,
|
Pg_lo_open,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_close",
|
"pg_lo_close",
|
||||||
Pg_lo_close,
|
Pg_lo_close,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
#ifdef PGTCL_USE_TCLOBJ
|
#ifdef PGTCL_USE_TCLOBJ
|
||||||
Tcl_CreateObjCommand(interp,
|
Tcl_CreateObjCommand(interp,
|
||||||
"pg_lo_read",
|
"pg_lo_read",
|
||||||
Pg_lo_read,
|
Pg_lo_read,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateObjCommand(interp,
|
Tcl_CreateObjCommand(interp,
|
||||||
"pg_lo_write",
|
"pg_lo_write",
|
||||||
Pg_lo_write,
|
Pg_lo_write,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
#else
|
#else
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_read",
|
"pg_lo_read",
|
||||||
Pg_lo_read,
|
Pg_lo_read,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_write",
|
"pg_lo_write",
|
||||||
Pg_lo_write,
|
Pg_lo_write,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_lseek",
|
"pg_lo_lseek",
|
||||||
Pg_lo_lseek,
|
Pg_lo_lseek,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_creat",
|
"pg_lo_creat",
|
||||||
Pg_lo_creat,
|
Pg_lo_creat,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_tell",
|
"pg_lo_tell",
|
||||||
Pg_lo_tell,
|
Pg_lo_tell,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_unlink",
|
"pg_lo_unlink",
|
||||||
Pg_lo_unlink,
|
Pg_lo_unlink,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_import",
|
"pg_lo_import",
|
||||||
Pg_lo_import,
|
Pg_lo_import,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_lo_export",
|
"pg_lo_export",
|
||||||
Pg_lo_export,
|
Pg_lo_export,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_listen",
|
"pg_listen",
|
||||||
Pg_listen,
|
Pg_listen,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_CreateCommand(interp,
|
Tcl_CreateCommand(interp,
|
||||||
"pg_on_connection_loss",
|
"pg_on_connection_loss",
|
||||||
Pg_on_connection_loss,
|
Pg_on_connection_loss,
|
||||||
(ClientData) NULL, (Tcl_CmdDeleteProc *) NULL);
|
NULL, NULL);
|
||||||
|
|
||||||
Tcl_PkgProvide(interp, "Pgtcl", "1.4");
|
Tcl_PkgProvide(interp, "Pgtcl", "1.4");
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclCmds.c,v 1.76 2003/11/29 19:52:11 pgsql Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclCmds.c,v 1.77 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -153,7 +153,7 @@ tcl_value(char *value)
|
|||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
if (!value)
|
if (!value)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
|
|
||||||
#ifdef TCL_ARRAYS_DEBUG
|
#ifdef TCL_ARRAYS_DEBUG
|
||||||
printf("pq_value = '%s'\n", value);
|
printf("pq_value = '%s'\n", value);
|
||||||
@ -417,8 +417,8 @@ Pg_disconnect(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Check that it is a PG connection and not something else */
|
/* Check that it is a PG connection and not something else */
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
return Tcl_UnregisterChannel(interp, conn_chan);
|
return Tcl_UnregisterChannel(interp, conn_chan);
|
||||||
@ -450,7 +450,7 @@ Pg_exec(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], &connid);
|
conn = PgGetConnectionId(interp, argv[1], &connid);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
if (connid->res_copyStatus != RES_COPY_NONE)
|
if (connid->res_copyStatus != RES_COPY_NONE)
|
||||||
@ -555,7 +555,7 @@ Pg_result(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
result = PgGetResultId(interp, argv[1]);
|
result = PgGetResultId(interp, argv[1]);
|
||||||
if (result == (PGresult *) NULL)
|
if (result == NULL)
|
||||||
{
|
{
|
||||||
Tcl_AppendResult(interp, "\n",
|
Tcl_AppendResult(interp, "\n",
|
||||||
argv[1], " is not a valid query result", 0);
|
argv[1], " is not a valid query result", 0);
|
||||||
@ -878,7 +878,7 @@ Pg_execute(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
* Get the connection and make sure no COPY command is pending
|
* Get the connection and make sure no COPY command is pending
|
||||||
*/
|
*/
|
||||||
conn = PgGetConnectionId(interp, argv[i++], &connid);
|
conn = PgGetConnectionId(interp, argv[i++], &connid);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
if (connid->res_copyStatus != RES_COPY_NONE)
|
if (connid->res_copyStatus != RES_COPY_NONE)
|
||||||
@ -1085,8 +1085,8 @@ Pg_lo_open(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
lobjId = atoi(argv[2]);
|
lobjId = atoi(argv[2]);
|
||||||
@ -1153,8 +1153,8 @@ Pg_lo_close(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[]
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
fd = atoi(argv[2]);
|
fd = atoi(argv[2]);
|
||||||
@ -1195,8 +1195,8 @@ Pg_lo_read(ClientData cData, Tcl_Interp *interp, int objc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, Tcl_GetStringFromObj(objv[1], NULL),
|
conn = PgGetConnectionId(interp, Tcl_GetStringFromObj(objv[1], NULL),
|
||||||
(Pg_ConnectionId **) NULL);
|
NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
if (Tcl_GetIntFromObj(interp, objv[2], &fd) != TCL_OK)
|
if (Tcl_GetIntFromObj(interp, objv[2], &fd) != TCL_OK)
|
||||||
@ -1254,8 +1254,8 @@ Pg_lo_read(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
fd = atoi(argv[2]);
|
fd = atoi(argv[2]);
|
||||||
@ -1310,8 +1310,8 @@ Pg_lo_write(ClientData cData, Tcl_Interp *interp, int objc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, Tcl_GetStringFromObj(objv[1], NULL),
|
conn = PgGetConnectionId(interp, Tcl_GetStringFromObj(objv[1], NULL),
|
||||||
(Pg_ConnectionId **) NULL);
|
NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
if (Tcl_GetIntFromObj(interp, objv[2], &fd) != TCL_OK)
|
if (Tcl_GetIntFromObj(interp, objv[2], &fd) != TCL_OK)
|
||||||
@ -1357,8 +1357,8 @@ Pg_lo_write(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[]
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
fd = atoi(argv[2]);
|
fd = atoi(argv[2]);
|
||||||
@ -1405,8 +1405,8 @@ Pg_lo_lseek(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[]
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
fd = atoi(argv[2]);
|
fd = atoi(argv[2]);
|
||||||
@ -1457,8 +1457,8 @@ Pg_lo_creat(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[]
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
modeStr = strdup(argv[2]);
|
modeStr = strdup(argv[2]);
|
||||||
@ -1477,7 +1477,7 @@ Pg_lo_creat(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[]
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((modeWord = strtok((char *) NULL, "|")) != NULL)
|
while ((modeWord = strtok(NULL, "|")) != NULL)
|
||||||
{
|
{
|
||||||
if (strcmp(modeWord, "INV_READ") == 0)
|
if (strcmp(modeWord, "INV_READ") == 0)
|
||||||
mode |= INV_READ;
|
mode |= INV_READ;
|
||||||
@ -1518,8 +1518,8 @@ Pg_lo_tell(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
fd = atoi(argv[2]);
|
fd = atoi(argv[2]);
|
||||||
@ -1552,8 +1552,8 @@ Pg_lo_unlink(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
lobjId = atoi(argv[2]);
|
lobjId = atoi(argv[2]);
|
||||||
@ -1594,8 +1594,8 @@ Pg_lo_import(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
filename = argv[2];
|
filename = argv[2];
|
||||||
@ -1638,8 +1638,8 @@ Pg_lo_export(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[
|
|||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], (Pg_ConnectionId **) NULL);
|
conn = PgGetConnectionId(interp, argv[1], NULL);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
lobjId = atoi(argv[2]);
|
lobjId = atoi(argv[2]);
|
||||||
@ -1702,7 +1702,7 @@ Pg_select(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
conn = PgGetConnectionId(interp, argv[1], &connid);
|
conn = PgGetConnectionId(interp, argv[1], &connid);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
if ((result = PQexec(conn, argv[2])) == 0)
|
if ((result = PQexec(conn, argv[2])) == 0)
|
||||||
@ -1858,7 +1858,7 @@ Pg_listen(ClientData cData, Tcl_Interp *interp, int argc, CONST84 char *argv[])
|
|||||||
* allocated by us.
|
* allocated by us.
|
||||||
*/
|
*/
|
||||||
conn = PgGetConnectionId(interp, argv[1], &connid);
|
conn = PgGetConnectionId(interp, argv[1], &connid);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2032,7 +2032,7 @@ Pg_on_connection_loss(ClientData cData, Tcl_Interp *interp, int argc, CONST84 ch
|
|||||||
* Get the command arguments.
|
* Get the command arguments.
|
||||||
*/
|
*/
|
||||||
conn = PgGetConnectionId(interp, argv[1], &connid);
|
conn = PgGetConnectionId(interp, argv[1], &connid);
|
||||||
if (conn == (PGconn *) NULL)
|
if (conn == NULL)
|
||||||
return TCL_ERROR;
|
return TCL_ERROR;
|
||||||
|
|
||||||
if ((argc > 2) && *argv[2])
|
if ((argc > 2) && *argv[2])
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclId.c,v 1.44 2003/11/29 19:52:11 pgsql Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpgtcl/pgtclId.c,v 1.45 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -133,7 +133,7 @@ PgOutputProc(DRIVER_OUTPUT_PROTO)
|
|||||||
Tcl_File
|
Tcl_File
|
||||||
PgGetFileProc(ClientData cData, int direction)
|
PgGetFileProc(ClientData cData, int direction)
|
||||||
{
|
{
|
||||||
return (Tcl_File) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ PgGetConnectionId(Tcl_Interp *interp, CONST84 char *id,
|
|||||||
Tcl_AppendResult(interp, id, " is not a valid postgresql connection", 0);
|
Tcl_AppendResult(interp, id, " is not a valid postgresql connection", 0);
|
||||||
if (connid_p)
|
if (connid_p)
|
||||||
*connid_p = NULL;
|
*connid_p = NULL;
|
||||||
return (PGconn *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
connid = (Pg_ConnectionId *) Tcl_GetChannelInstanceData(conn_chan);
|
connid = (Pg_ConnectionId *) Tcl_GetChannelInstanceData(conn_chan);
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
|
* exceed INITIAL_EXPBUFFER_SIZE (currently 256 bytes).
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.88 2003/12/20 18:45:49 tgl Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-auth.c,v 1.89 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -173,7 +173,7 @@ pg_krb4_authname(char *PQerrormsg)
|
|||||||
snprintf(PQerrormsg, PQERRORMSG_LENGTH,
|
snprintf(PQerrormsg, PQERRORMSG_LENGTH,
|
||||||
"pg_krb4_authname: krb_get_tf_fullname: %s\n",
|
"pg_krb4_authname: krb_get_tf_fullname: %s\n",
|
||||||
krb_err_txt[status]);
|
krb_err_txt[status]);
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
@ -220,8 +220,8 @@ pg_krb4_sendauth(char *PQerrormsg, int sock,
|
|||||||
hostname,
|
hostname,
|
||||||
realm,
|
realm,
|
||||||
(u_long) 0,
|
(u_long) 0,
|
||||||
(MSG_DAT *) NULL,
|
NULL,
|
||||||
(CREDENTIALS *) NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
laddr,
|
laddr,
|
||||||
raddr,
|
raddr,
|
||||||
@ -712,8 +712,8 @@ fe_getauthsvc(char *PQerrormsg)
|
|||||||
char *
|
char *
|
||||||
fe_getauthname(char *PQerrormsg)
|
fe_getauthname(char *PQerrormsg)
|
||||||
{
|
{
|
||||||
const char *name = (char *) NULL;
|
const char *name = NULL;
|
||||||
char *authn = (char *) NULL;
|
char *authn = NULL;
|
||||||
MsgType authsvc;
|
MsgType authsvc;
|
||||||
|
|
||||||
authsvc = fe_getauthsvc(PQerrormsg);
|
authsvc = fe_getauthsvc(PQerrormsg);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.265 2003/12/19 21:50:54 momjian Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-connect.c,v 1.266 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -279,7 +279,7 @@ PQconnectStart(const char *conninfo)
|
|||||||
*/
|
*/
|
||||||
conn = makeEmptyPGconn();
|
conn = makeEmptyPGconn();
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return (PGconn *) NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse the conninfo string
|
* Parse the conninfo string
|
||||||
@ -532,7 +532,7 @@ PQsetdbLogin(const char *pghost, const char *pgport, const char *pgoptions,
|
|||||||
*/
|
*/
|
||||||
conn = makeEmptyPGconn();
|
conn = makeEmptyPGconn();
|
||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return (PGconn *) NULL;
|
return NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse an empty conninfo string in order to set up the same defaults
|
* Parse an empty conninfo string in order to set up the same defaults
|
||||||
@ -1938,7 +1938,7 @@ makeEmptyPGconn(void)
|
|||||||
WSADATA wsaData;
|
WSADATA wsaData;
|
||||||
|
|
||||||
if (WSAStartup(MAKEWORD(1, 1), &wsaData))
|
if (WSAStartup(MAKEWORD(1, 1), &wsaData))
|
||||||
return (PGconn *) NULL;
|
return NULL;
|
||||||
WSASetLastError(0);
|
WSASetLastError(0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1947,7 +1947,7 @@ makeEmptyPGconn(void)
|
|||||||
return conn;
|
return conn;
|
||||||
|
|
||||||
/* Zero all pointers and booleans */
|
/* Zero all pointers and booleans */
|
||||||
MemSet((char *) conn, 0, sizeof(PGconn));
|
MemSet(conn, 0, sizeof(PGconn));
|
||||||
|
|
||||||
conn->noticeHooks.noticeRec = defaultNoticeReceiver;
|
conn->noticeHooks.noticeRec = defaultNoticeReceiver;
|
||||||
conn->noticeHooks.noticeProc = defaultNoticeProcessor;
|
conn->noticeHooks.noticeProc = defaultNoticeProcessor;
|
||||||
@ -2765,7 +2765,7 @@ char *
|
|||||||
PQdb(const PGconn *conn)
|
PQdb(const PGconn *conn)
|
||||||
{
|
{
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
return conn->dbName;
|
return conn->dbName;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2773,7 +2773,7 @@ char *
|
|||||||
PQuser(const PGconn *conn)
|
PQuser(const PGconn *conn)
|
||||||
{
|
{
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
return conn->pguser;
|
return conn->pguser;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2781,7 +2781,7 @@ char *
|
|||||||
PQpass(const PGconn *conn)
|
PQpass(const PGconn *conn)
|
||||||
{
|
{
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
return conn->pgpass;
|
return conn->pgpass;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2789,7 +2789,7 @@ char *
|
|||||||
PQhost(const PGconn *conn)
|
PQhost(const PGconn *conn)
|
||||||
{
|
{
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
return conn->pghost ? conn->pghost : conn->pgunixsocket;
|
return conn->pghost ? conn->pghost : conn->pgunixsocket;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2797,7 +2797,7 @@ char *
|
|||||||
PQport(const PGconn *conn)
|
PQport(const PGconn *conn)
|
||||||
{
|
{
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
return conn->pgport;
|
return conn->pgport;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2805,7 +2805,7 @@ char *
|
|||||||
PQtty(const PGconn *conn)
|
PQtty(const PGconn *conn)
|
||||||
{
|
{
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
return conn->pgtty;
|
return conn->pgtty;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2813,7 +2813,7 @@ char *
|
|||||||
PQoptions(const PGconn *conn)
|
PQoptions(const PGconn *conn)
|
||||||
{
|
{
|
||||||
if (!conn)
|
if (!conn)
|
||||||
return (char *) NULL;
|
return NULL;
|
||||||
return conn->pgoptions;
|
return conn->pgoptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2915,7 +2915,7 @@ PQsetClientEncoding(PGconn *conn, const char *encoding)
|
|||||||
sprintf(qbuf, query, encoding);
|
sprintf(qbuf, query, encoding);
|
||||||
res = PQexec(conn, qbuf);
|
res = PQexec(conn, qbuf);
|
||||||
|
|
||||||
if (res == (PGresult *) NULL)
|
if (res == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
if (res->resultStatus != PGRES_COMMAND_OK)
|
if (res->resultStatus != PGRES_COMMAND_OK)
|
||||||
status = -1;
|
status = -1;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-lobj.c,v 1.45 2003/11/29 19:52:12 pgsql Exp $
|
* $PostgreSQL: pgsql/src/interfaces/libpq/fe-lobj.c,v 1.46 2004/01/07 18:56:29 neilc Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -58,7 +58,7 @@ lo_open(PGconn *conn, Oid lobjId, int mode)
|
|||||||
argv[1].len = 4;
|
argv[1].len = 4;
|
||||||
argv[1].u.integer = mode;
|
argv[1].u.integer = mode;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -97,7 +97,7 @@ lo_close(PGconn *conn, int fd)
|
|||||||
int retval;
|
int retval;
|
||||||
int result_len;
|
int result_len;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -135,7 +135,7 @@ lo_read(PGconn *conn, int fd, char *buf, size_t len)
|
|||||||
PGresult *res;
|
PGresult *res;
|
||||||
int result_len;
|
int result_len;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -177,7 +177,7 @@ lo_write(PGconn *conn, int fd, char *buf, size_t len)
|
|||||||
int result_len;
|
int result_len;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -223,7 +223,7 @@ lo_lseek(PGconn *conn, int fd, int offset, int whence)
|
|||||||
int retval;
|
int retval;
|
||||||
int result_len;
|
int result_len;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -272,7 +272,7 @@ lo_creat(PGconn *conn, int mode)
|
|||||||
int retval;
|
int retval;
|
||||||
int result_len;
|
int result_len;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return InvalidOid;
|
return InvalidOid;
|
||||||
@ -310,7 +310,7 @@ lo_tell(PGconn *conn, int fd)
|
|||||||
PGresult *res;
|
PGresult *res;
|
||||||
int result_len;
|
int result_len;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -348,7 +348,7 @@ lo_unlink(PGconn *conn, Oid lobjId)
|
|||||||
int result_len;
|
int result_len;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
if (conn->lobjfuncs == (PGlobjfuncs *) NULL)
|
if (conn->lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
if (lo_initialize(conn) < 0)
|
if (lo_initialize(conn) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -534,7 +534,7 @@ lo_initialize(PGconn *conn)
|
|||||||
* Allocate the structure to hold the functions OID's
|
* Allocate the structure to hold the functions OID's
|
||||||
*/
|
*/
|
||||||
lobjfuncs = (PGlobjfuncs *) malloc(sizeof(PGlobjfuncs));
|
lobjfuncs = (PGlobjfuncs *) malloc(sizeof(PGlobjfuncs));
|
||||||
if (lobjfuncs == (PGlobjfuncs *) NULL)
|
if (lobjfuncs == NULL)
|
||||||
{
|
{
|
||||||
printfPQExpBuffer(&conn->errorMessage,
|
printfPQExpBuffer(&conn->errorMessage,
|
||||||
libpq_gettext("out of memory\n"));
|
libpq_gettext("out of memory\n"));
|
||||||
@ -554,7 +554,7 @@ lo_initialize(PGconn *conn)
|
|||||||
or proname = 'lo_tell' \
|
or proname = 'lo_tell' \
|
||||||
or proname = 'loread' \
|
or proname = 'loread' \
|
||||||
or proname = 'lowrite'");
|
or proname = 'lowrite'");
|
||||||
if (res == (PGresult *) NULL)
|
if (res == NULL)
|
||||||
{
|
{
|
||||||
free(lobjfuncs);
|
free(lobjfuncs);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* procedural language
|
* procedural language
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.72 2004/01/07 06:20:02 tgl Exp $
|
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.73 2004/01/07 18:56:30 neilc Exp $
|
||||||
*
|
*
|
||||||
* This software is copyrighted by Jan Wieck - Hamburg.
|
* This software is copyrighted by Jan Wieck - Hamburg.
|
||||||
*
|
*
|
||||||
@ -84,7 +84,7 @@ PLpgSQL_function *plpgsql_curr_compile;
|
|||||||
* Hash table for compiled functions
|
* Hash table for compiled functions
|
||||||
* ----------
|
* ----------
|
||||||
*/
|
*/
|
||||||
static HTAB *plpgsql_HashTable = (HTAB *) NULL;
|
static HTAB *plpgsql_HashTable = NULL;
|
||||||
|
|
||||||
typedef struct plpgsql_hashent
|
typedef struct plpgsql_hashent
|
||||||
{
|
{
|
||||||
@ -1856,7 +1856,7 @@ plpgsql_HashTableLookup(PLpgSQL_func_hashkey *func_key)
|
|||||||
if (hentry)
|
if (hentry)
|
||||||
return hentry->function;
|
return hentry->function;
|
||||||
else
|
else
|
||||||
return (PLpgSQL_function *) NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
* MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.44 2004/01/06 23:55:19 tgl Exp $
|
* $PostgreSQL: pgsql/src/pl/plpython/plpython.c,v 1.45 2004/01/07 18:56:30 neilc Exp $
|
||||||
*
|
*
|
||||||
*********************************************************************
|
*********************************************************************
|
||||||
*/
|
*/
|
||||||
@ -720,7 +720,7 @@ PLy_trigger_build_args(FunctionCallInfo fcinfo, PLyProcedure * proc, HeapTuple *
|
|||||||
|
|
||||||
PyDict_SetItemString(pltdata, "old", Py_None);
|
PyDict_SetItemString(pltdata, "old", Py_None);
|
||||||
PyDict_SetItemString(pltdata, "new", Py_None);
|
PyDict_SetItemString(pltdata, "new", Py_None);
|
||||||
*rv = (HeapTuple) NULL;
|
*rv = NULL;
|
||||||
|
|
||||||
if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event))
|
if (TRIGGER_FIRED_BY_INSERT(tdata->tg_event))
|
||||||
pltevent = PyString_FromString("INSERT");
|
pltevent = PyString_FromString("INSERT");
|
||||||
|
@ -106,7 +106,7 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
fprintf(stderr, "DECLARE CURSOR command failed\n");
|
fprintf(stderr, "DECLARE CURSOR command failed\n");
|
||||||
PQclear(res1);
|
PQclear(res1);
|
||||||
exit_nicely(conn1, (PGconn *) NULL);
|
exit_nicely(conn1, NULL);
|
||||||
}
|
}
|
||||||
PQclear(res1);
|
PQclear(res1);
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ main(int argc, char **argv)
|
|||||||
{
|
{
|
||||||
fprintf(stderr, "FETCH ALL command didn't return tuples properly\n");
|
fprintf(stderr, "FETCH ALL command didn't return tuples properly\n");
|
||||||
PQclear(res1);
|
PQclear(res1);
|
||||||
exit_nicely(conn1, (PGconn *) NULL);
|
exit_nicely(conn1, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* first, print out the attribute names */
|
/* first, print out the attribute names */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user