Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9d00fbb

Browse files
committed
Change some labels in bootparse to make ctags happy. Clean up outfunc/readfunc code and add missing fields for Query structure and new Union fields. Fix optimizer bug shown in new \do command. Change WARN to ERROR in contrib and regression stuff.
1 parent 42acc6e commit 9d00fbb

File tree

15 files changed

+568
-583
lines changed

15 files changed

+568
-583
lines changed

contrib/array/array_iterator.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
5656
/* Lookup element type information */
5757
typ_tuple = SearchSysCacheTuple(TYPOID, ObjectIdGetDatum(elemtype),0,0,0);
5858
if (!HeapTupleIsValid(typ_tuple)) {
59-
elog(WARN,"array_iterator: cache lookup failed for type %d", elemtype);
59+
elog(ERROR,"array_iterator: cache lookup failed for type %d", elemtype);
6060
return 0;
6161
}
6262
typ_struct = (TypeTupleForm) GETSTRUCT(typ_tuple);
@@ -67,7 +67,7 @@ array_iterator(Oid elemtype, Oid proc, int and, ArrayType *array, Datum value)
6767
proc_fn = (func_ptr) NULL;
6868
fmgr_info(proc, &proc_fn, &pronargs);
6969
if ((proc_fn == NULL) || (pronargs != 2)) {
70-
elog(WARN, "array_iterator: fmgr_info lookup failed for oid %d", proc);
70+
elog(ERROR, "array_iterator: fmgr_info lookup failed for oid %d", proc);
7171
return (0);
7272
}
7373

contrib/datetime/datetime_functions.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ hhmm_in(char *str)
4747
int ftype[MAXDATEFIELDS];
4848

4949
if (!PointerIsValid(str))
50-
elog(WARN,"Bad (null) time external representation",NULL);
50+
elog(ERROR,"Bad (null) time external representation",NULL);
5151

5252
if ((ParseDateTime( str, lowstr, field, ftype, MAXDATEFIELDS, &nf) != 0)
5353
|| (DecodeTimeOnly( field, ftype, nf, &dtype, tm, &fsec) != 0))
54-
elog(WARN,"Bad time external representation '%s'",str);
54+
elog(ERROR,"Bad time external representation '%s'",str);
5555

5656
if (tm->tm_hour<0 || tm->tm_hour>24 ||
5757
(tm->tm_hour==24 && (tm->tm_min!=0 || tm->tm_sec!=0 || fsec!= 0))) {
58-
elog(WARN,
58+
elog(ERROR,
5959
"time_in: hour must be limited to values 0 through 24:00 "
6060
"in \"%s\"",
6161
str);
6262
}
6363
if ((tm->tm_min < 0) || (tm->tm_min > 59))
64-
elog(WARN,"Minute must be limited to values 0 through 59 in '%s'",str);
64+
elog(ERROR,"Minute must be limited to values 0 through 59 in '%s'",str);
6565
if ((tm->tm_sec < 0) || ((tm->tm_sec + fsec) >= 60))
66-
elog(WARN,"Second must be limited to values 0 through < 60 in '%s'",
66+
elog(ERROR,"Second must be limited to values 0 through < 60 in '%s'",
6767
str);
6868

6969
time = PALLOCTYPE(TimeADT);

contrib/int8/int8.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ int8in(char *str)
110110

111111
#if HAVE_64BIT_INTS
112112
if (!PointerIsValid(str))
113-
elog(WARN, "Bad (null) int8 external representation", NULL);
113+
elog(ERROR, "Bad (null) int8 external representation", NULL);
114114

115115
if (sscanf(str, INT64_FORMAT, result) != 1)
116-
elog(WARN, "Bad int8 external representation '%s'", str);
116+
elog(ERROR, "Bad int8 external representation '%s'", str);
117117

118118
#else
119-
elog(WARN, "64-bit integers are not supported", NULL);
119+
elog(ERROR, "64-bit integers are not supported", NULL);
120120
result = NULL;
121121
#endif
122122

@@ -139,14 +139,14 @@ int8out(int64 * val)
139139
return (NULL);
140140

141141
if ((len = snprintf(buf, MAXINT8LEN, INT64_FORMAT, *val)) < 0)
142-
elog(WARN, "Unable to format int8", NULL);
142+
elog(ERROR, "Unable to format int8", NULL);
143143

144144
result = PALLOC(len + 1);
145145

146146
strcpy(result, buf);
147147

148148
#else
149-
elog(WARN, "64-bit integers are not supported", NULL);
149+
elog(ERROR, "64-bit integers are not supported", NULL);
150150
result = NULL;
151151
#endif
152152

@@ -328,10 +328,10 @@ int84(int64 * val)
328328
int32 result;
329329

330330
if (!PointerIsValid(val))
331-
elog(WARN, "Invalid (null) int64, can't convert int8 to int4", NULL);
331+
elog(ERROR, "Invalid (null) int64, can't convert int8 to int4", NULL);
332332

333333
if ((*val < INT_MIN) || (*val > INT_MAX))
334-
elog(WARN, "int8 conversion to int4 is out of range", NULL);
334+
elog(ERROR, "int8 conversion to int4 is out of range", NULL);
335335

336336
result = *val;
337337

@@ -345,7 +345,7 @@ int28 (int16 val)
345345
int64 *result;
346346

347347
if (!PointerIsValid(result = PALLOCTYPE(int64)))
348-
elog(WARN, "Memory allocation failed, can't convert int8 to int2", NULL);
348+
elog(ERROR, "Memory allocation failed, can't convert int8 to int2", NULL);
349349

350350
*result = val;
351351

@@ -358,7 +358,7 @@ int82(int64 * val)
358358
int16 result;
359359

360360
if (!PointerIsValid(val))
361-
elog(WARN, "Invalid (null) int8, can't convert to int2", NULL);
361+
elog(ERROR, "Invalid (null) int8, can't convert to int2", NULL);
362362

363363
result = *val;
364364

@@ -383,7 +383,7 @@ dtoi8(float64 val)
383383
int64 *result = PALLOCTYPE(int64);
384384

385385
if ((*val < (-pow(2, 64) + 1)) || (*val > (pow(2, 64) - 1)))
386-
elog(WARN, "Floating point conversion to int64 is out of range", NULL);
386+
elog(ERROR, "Floating point conversion to int64 is out of range", NULL);
387387

388388
*result = *val;
389389

contrib/spi/autoinc.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ autoinc()
2323
int i;
2424

2525
if (!CurrentTriggerData)
26-
elog(WARN, "autoinc: triggers are not initialized");
26+
elog(ERROR, "autoinc: triggers are not initialized");
2727
if (TRIGGER_FIRED_FOR_STATEMENT(CurrentTriggerData->tg_event))
28-
elog(WARN, "autoinc: can't process STATEMENT events");
28+
elog(ERROR, "autoinc: can't process STATEMENT events");
2929
if (TRIGGER_FIRED_AFTER(CurrentTriggerData->tg_event))
30-
elog(WARN, "autoinc: must be fired before event");
30+
elog(ERROR, "autoinc: must be fired before event");
3131

3232
if (TRIGGER_FIRED_BY_INSERT(CurrentTriggerData->tg_event))
3333
rettuple = CurrentTriggerData->tg_trigtuple;
3434
else if (TRIGGER_FIRED_BY_UPDATE(CurrentTriggerData->tg_event))
3535
rettuple = CurrentTriggerData->tg_newtuple;
3636
else
37-
elog(WARN, "autoinc: can't process DELETE events");
37+
elog(ERROR, "autoinc: can't process DELETE events");
3838

3939
rel = CurrentTriggerData->tg_relation;
4040
relname = SPI_getrelname(rel);
@@ -43,7 +43,7 @@ autoinc()
4343

4444
nargs = trigger->tgnargs;
4545
if (nargs <= 0 || nargs % 2 != 0)
46-
elog(WARN, "autoinc (%s): even number gt 0 of arguments was expected", relname);
46+
elog(ERROR, "autoinc (%s): even number gt 0 of arguments was expected", relname);
4747

4848
args = trigger->tgargs;
4949
tupdesc = rel->rd_att;
@@ -60,9 +60,9 @@ autoinc()
6060
int32 val;
6161

6262
if ( attnum < 0 )
63-
elog(WARN, "autoinc (%s): there is no attribute %s", relname, args[i]);
63+
elog(ERROR, "autoinc (%s): there is no attribute %s", relname, args[i]);
6464
if (SPI_gettypeid (tupdesc, attnum) != INT4OID)
65-
elog(WARN, "autoinc (%s): attribute %s must be of INT4 type",
65+
elog(ERROR, "autoinc (%s): attribute %s must be of INT4 type",
6666
relname, args[i]);
6767

6868
val = DatumGetInt32 (SPI_getbinval (rettuple, tupdesc, attnum, &isnull));
@@ -88,7 +88,7 @@ autoinc()
8888
{
8989
rettuple = SPI_modifytuple (rel, rettuple, chnattrs, chattrs, newvals, NULL);
9090
if ( rettuple == NULL )
91-
elog (WARN, "autoinc (%s): %d returned by SPI_modifytuple",
91+
elog (ERROR, "autoinc (%s): %d returned by SPI_modifytuple",
9292
relname, SPI_result);
9393
}
9494

contrib/spi/insert_username.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ insert_username ()
2727

2828
/* sanity checks from autoinc.c */
2929
if (!CurrentTriggerData)
30-
elog(WARN, "insert_username: triggers are not initialized");
30+
elog(ERROR, "insert_username: triggers are not initialized");
3131
if (TRIGGER_FIRED_FOR_STATEMENT(CurrentTriggerData->tg_event))
32-
elog(WARN, "insert_username: can't process STATEMENT events");
32+
elog(ERROR, "insert_username: can't process STATEMENT events");
3333
if (TRIGGER_FIRED_AFTER(CurrentTriggerData->tg_event))
34-
elog(WARN, "insert_username: must be fired before event");
34+
elog(ERROR, "insert_username: must be fired before event");
3535

3636
if (TRIGGER_FIRED_BY_INSERT(CurrentTriggerData->tg_event))
3737
rettuple = CurrentTriggerData->tg_trigtuple;
3838
else if (TRIGGER_FIRED_BY_UPDATE(CurrentTriggerData->tg_event))
3939
rettuple = CurrentTriggerData->tg_newtuple;
4040
else
41-
elog(WARN, "insert_username: can't process DELETE events");
41+
elog(ERROR, "insert_username: can't process DELETE events");
4242

4343
rel = CurrentTriggerData->tg_relation;
4444
relname = SPI_getrelname(rel);
@@ -47,7 +47,7 @@ insert_username ()
4747

4848
nargs = trigger->tgnargs;
4949
if (nargs != 1)
50-
elog(WARN, "insert_username (%s): one argument was expected", relname);
50+
elog(ERROR, "insert_username (%s): one argument was expected", relname);
5151

5252
args = trigger->tgargs;
5353
tupdesc = rel->rd_att;
@@ -57,9 +57,9 @@ insert_username ()
5757
attnum = SPI_fnumber (tupdesc, args[0]);
5858

5959
if ( attnum < 0 )
60-
elog(WARN, "insert_username (%s): there is no attribute %s", relname, args[0]);
60+
elog(ERROR, "insert_username (%s): there is no attribute %s", relname, args[0]);
6161
if (SPI_gettypeid (tupdesc, attnum) != TEXTOID)
62-
elog(WARN, "insert_username (%s): attribute %s must be of TEXT type",
62+
elog(ERROR, "insert_username (%s): attribute %s must be of TEXT type",
6363
relname, args[0]);
6464

6565
/* create fields containing name */
@@ -68,7 +68,7 @@ insert_username ()
6868
/* construct new tuple */
6969
rettuple = SPI_modifytuple (rel, rettuple, 1, &attnum, &newval, NULL);
7070
if ( rettuple == NULL )
71-
elog (WARN, "insert_username (%s): %d returned by SPI_modifytuple",
71+
elog (ERROR, "insert_username (%s): %d returned by SPI_modifytuple",
7272
relname, SPI_result);
7373

7474
pfree (relname);

0 commit comments

Comments
 (0)