8
8
*
9
9
*
10
10
* 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 $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -96,11 +96,11 @@ DefineSequence(CreateSeqStmt *seq)
96
96
NameData name ;
97
97
98
98
/* 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 ;
104
104
new .is_cycled = false;
105
105
106
106
/* Check and set values */
@@ -879,8 +879,8 @@ init_params(char *caller, List *options, Form_pg_sequence new)
879
879
* start is for a new sequence
880
880
* restart is for alter
881
881
*/
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 ))
884
884
{
885
885
if (last_value )
886
886
elog (ERROR , "%s: LAST VALUE defined twice" , caller );
@@ -917,7 +917,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
917
917
}
918
918
919
919
/* INCREMENT BY */
920
- if (new -> increment_by == NULL && increment_by == (DefElem * ) NULL )
920
+ if (new -> increment_by == 0 && increment_by == (DefElem * ) NULL )
921
921
new -> increment_by = 1 ;
922
922
else if (increment_by != (DefElem * ) NULL )
923
923
{
@@ -928,7 +928,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
928
928
}
929
929
930
930
/* MAXVALUE */
931
- if ((new -> max_value == NULL && max_value == (DefElem * ) NULL )
931
+ if ((new -> max_value == 0 && max_value == (DefElem * ) NULL )
932
932
|| (max_value != (DefElem * ) NULL && !max_value -> arg ))
933
933
{
934
934
if (new -> increment_by > 0 )
@@ -940,7 +940,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
940
940
new -> max_value = defGetInt64 (max_value );
941
941
942
942
/* MINVALUE */
943
- if ((new -> min_value == NULL && min_value == (DefElem * ) NULL )
943
+ if ((new -> min_value == 0 && min_value == (DefElem * ) NULL )
944
944
|| (min_value != (DefElem * ) NULL && !min_value -> arg ))
945
945
{
946
946
if (new -> increment_by > 0 )
@@ -963,7 +963,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
963
963
}
964
964
965
965
/* START WITH */
966
- if (new -> last_value == NULL && last_value == (DefElem * ) NULL )
966
+ if (new -> last_value == 0 && last_value == (DefElem * ) NULL )
967
967
{
968
968
if (new -> increment_by > 0 )
969
969
new -> last_value = new -> min_value ; /* ascending seq */
0 commit comments