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

Commit 5717dcb

Browse files
committed
New coding for SET provoked a 'var might be used uninitialized' warning
from gcc. Which wasn't actually a code bug, but I don't like warnings.
1 parent be1d9fe commit 5717dcb

File tree

1 file changed

+11
-20
lines changed

1 file changed

+11
-20
lines changed

src/backend/parser/gram.y

Lines changed: 11 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.165 2000/03/30 06:02:36 thomas Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.166 2000/03/31 02:11:03 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -720,39 +720,30 @@ var_value: Sconst
720720
}
721721
| FCONST
722722
{
723-
/* Floating pumeric argument?
724-
* This recently changed to preserve "stringiness" until here,
723+
/* Floating numeric argument.
724+
* This recently changed to preserve "stringiness",
725725
* so we don't have any work to do at all. Nice.
726726
* - thomas 2000-03-29
727727
*/
728728
$$ = $1;
729729
}
730730
| Iconst
731731
{
732-
char *result;
733732
char buf[64];
734733

735-
/* Integer pumeric argument?
734+
/* Integer numeric argument.
736735
*/
737-
if (sprintf(buf, "%d", $1) != 1)
738-
{
739-
result = pstrdup(buf);
740-
}
741-
else
742-
elog(ERROR, "Unable to convert constant to string (internal error)");
743-
744-
$$ = result;
736+
sprintf(buf, "%d", $1);
737+
$$ = pstrdup(buf);
745738
}
746739
| name_list
747740
{
748741
List *n;
749-
int llen, slen = 0;
742+
int slen = 0;
750743
char *result;
751744

752-
llen = length($1);
753-
754745
/* List of words? Then concatenate together */
755-
if (llen < 1)
746+
if ($1 == NIL)
756747
elog(ERROR, "SET must have at least one argument");
757748

758749
foreach (n, $1)
@@ -5300,7 +5291,7 @@ UserId: IDENT { $$ = $1; };
53005291
* some of these keywords will have to be removed from this
53015292
* list due to shift/reduce conflicts in yacc. If so, move
53025293
* down to the ColLabel entity. - thomas 1997-11-06
5303-
* These show up as operators, ans will screw up the parsing if
5294+
* These show up as operators, and will screw up the parsing if
53045295
* allowed as identifiers or labels.
53055296
* Thanks to Tom Lane for pointing this out. - thomas 2000-03-29
53065297
| BETWEEN { $$ = "between"; }
@@ -5442,7 +5433,7 @@ ColId: IDENT { $$ = $1; }
54425433
* Add other keywords to this list. Note that they appear here
54435434
* rather than in ColId if there was a shift/reduce conflict
54445435
* when used as a full identifier. - thomas 1997-11-06
5445-
* These show up as operators, ans will screw up the parsing if
5436+
* These show up as operators, and will screw up the parsing if
54465437
* allowed as identifiers or labels.
54475438
* Thanks to Tom Lane for pointing this out. - thomas 2000-03-29
54485439
| ALL { $$ = "all"; }
@@ -5452,7 +5443,7 @@ ColId: IDENT { $$ = $1; }
54525443
| LIKE { $$ = "like"; }
54535444
| NOT { $$ = "not"; }
54545445
| NULLIF { $$ = "nullif"; }
5455-
| NULL_P { $$ = "null_p"; }
5446+
| NULL_P { $$ = "null"; }
54565447
| OR { $$ = "or"; }
54575448
| UNION { $$ = "union"; }
54585449
*/

0 commit comments

Comments
 (0)