Skip to content

Commit 3bb7e1e

Browse files
committed
Fix sequence casting.
1 parent c7d17a5 commit 3bb7e1e

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/backend/commands/sequence.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.94 2003/03/20 07:02:07 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.95 2003/03/21 03:55:21 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -96,11 +96,11 @@ DefineSequence(CreateSeqStmt *seq)
9696
NameData name;
9797

9898
/* Values are NULL (or false) by default */
99-
new.last_value = NULL;
100-
new.increment_by = NULL;
101-
new.max_value = NULL;
102-
new.min_value = NULL;
103-
new.cache_value = NULL;
99+
new.last_value = 0;
100+
new.increment_by = 0;
101+
new.max_value = 0;
102+
new.min_value = 0;
103+
new.cache_value = 0;
104104
new.is_cycled = false;
105105

106106
/* Check and set values */
@@ -879,8 +879,8 @@ init_params(char *caller, List *options, Form_pg_sequence new)
879879
* start is for a new sequence
880880
* restart is for alter
881881
*/
882-
else if ((new->last_value == NULL && strcmp(defel->defname, "start") == 0)
883-
|| (new->last_value != NULL && strcmp(defel->defname, "restart") == 0))
882+
else if ((new->last_value == 0L && strcmp(defel->defname, "start") == 0)
883+
|| (new->last_value != 0 && strcmp(defel->defname, "restart") == 0))
884884
{
885885
if (last_value)
886886
elog(ERROR, "%s: LAST VALUE defined twice", caller);
@@ -917,7 +917,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
917917
}
918918

919919
/* INCREMENT BY */
920-
if (new->increment_by == NULL && increment_by == (DefElem *) NULL)
920+
if (new->increment_by == 0 && increment_by == (DefElem *) NULL)
921921
new->increment_by = 1;
922922
else if (increment_by != (DefElem *) NULL)
923923
{
@@ -928,7 +928,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
928928
}
929929

930930
/* MAXVALUE */
931-
if ((new->max_value == NULL && max_value == (DefElem *) NULL)
931+
if ((new->max_value == 0 && max_value == (DefElem *) NULL)
932932
|| (max_value != (DefElem *) NULL && !max_value->arg))
933933
{
934934
if (new->increment_by > 0)
@@ -940,7 +940,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
940940
new->max_value = defGetInt64(max_value);
941941

942942
/* MINVALUE */
943-
if ((new->min_value == NULL && min_value == (DefElem *) NULL)
943+
if ((new->min_value == 0 && min_value == (DefElem *) NULL)
944944
|| (min_value != (DefElem *) NULL && !min_value->arg))
945945
{
946946
if (new->increment_by > 0)
@@ -963,7 +963,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
963963
}
964964

965965
/* START WITH */
966-
if (new->last_value == NULL && last_value == (DefElem *) NULL)
966+
if (new->last_value == 0 && last_value == (DefElem *) NULL)
967967
{
968968
if (new->increment_by > 0)
969969
new->last_value = new->min_value; /* ascending seq */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy