Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3bb7e1ef
Commit
3bb7e1ef
authored
Mar 21, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix sequence casting.
parent
c7d17a55
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
src/backend/commands/sequence.c
src/backend/commands/sequence.c
+12
-12
No files found.
src/backend/commands/sequence.c
View file @
3bb7e1ef
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.9
4 2003/03/20 07:02:07
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/sequence.c,v 1.9
5 2003/03/21 03:55:21
momjian Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -96,11 +96,11 @@ DefineSequence(CreateSeqStmt *seq)
...
@@ -96,11 +96,11 @@ DefineSequence(CreateSeqStmt *seq)
NameData
name
;
NameData
name
;
/* Values are NULL (or false) by default */
/* Values are NULL (or false) by default */
new
.
last_value
=
NULL
;
new
.
last_value
=
0
;
new
.
increment_by
=
NULL
;
new
.
increment_by
=
0
;
new
.
max_value
=
NULL
;
new
.
max_value
=
0
;
new
.
min_value
=
NULL
;
new
.
min_value
=
0
;
new
.
cache_value
=
NULL
;
new
.
cache_value
=
0
;
new
.
is_cycled
=
false
;
new
.
is_cycled
=
false
;
/* Check and set values */
/* Check and set values */
...
@@ -879,8 +879,8 @@ init_params(char *caller, List *options, Form_pg_sequence new)
...
@@ -879,8 +879,8 @@ init_params(char *caller, List *options, Form_pg_sequence new)
* start is for a new sequence
* start is for a new sequence
* restart is for alter
* restart is for alter
*/
*/
else
if
((
new
->
last_value
==
NUL
L
&&
strcmp
(
defel
->
defname
,
"start"
)
==
0
)
else
if
((
new
->
last_value
==
0
L
&&
strcmp
(
defel
->
defname
,
"start"
)
==
0
)
||
(
new
->
last_value
!=
NULL
&&
strcmp
(
defel
->
defname
,
"restart"
)
==
0
))
||
(
new
->
last_value
!=
0
&&
strcmp
(
defel
->
defname
,
"restart"
)
==
0
))
{
{
if
(
last_value
)
if
(
last_value
)
elog
(
ERROR
,
"%s: LAST VALUE defined twice"
,
caller
);
elog
(
ERROR
,
"%s: LAST VALUE defined twice"
,
caller
);
...
@@ -917,7 +917,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
...
@@ -917,7 +917,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
}
}
/* INCREMENT BY */
/* INCREMENT BY */
if
(
new
->
increment_by
==
NULL
&&
increment_by
==
(
DefElem
*
)
NULL
)
if
(
new
->
increment_by
==
0
&&
increment_by
==
(
DefElem
*
)
NULL
)
new
->
increment_by
=
1
;
new
->
increment_by
=
1
;
else
if
(
increment_by
!=
(
DefElem
*
)
NULL
)
else
if
(
increment_by
!=
(
DefElem
*
)
NULL
)
{
{
...
@@ -928,7 +928,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
...
@@ -928,7 +928,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
}
}
/* MAXVALUE */
/* MAXVALUE */
if
((
new
->
max_value
==
NULL
&&
max_value
==
(
DefElem
*
)
NULL
)
if
((
new
->
max_value
==
0
&&
max_value
==
(
DefElem
*
)
NULL
)
||
(
max_value
!=
(
DefElem
*
)
NULL
&&
!
max_value
->
arg
))
||
(
max_value
!=
(
DefElem
*
)
NULL
&&
!
max_value
->
arg
))
{
{
if
(
new
->
increment_by
>
0
)
if
(
new
->
increment_by
>
0
)
...
@@ -940,7 +940,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
...
@@ -940,7 +940,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
new
->
max_value
=
defGetInt64
(
max_value
);
new
->
max_value
=
defGetInt64
(
max_value
);
/* MINVALUE */
/* MINVALUE */
if
((
new
->
min_value
==
NULL
&&
min_value
==
(
DefElem
*
)
NULL
)
if
((
new
->
min_value
==
0
&&
min_value
==
(
DefElem
*
)
NULL
)
||
(
min_value
!=
(
DefElem
*
)
NULL
&&
!
min_value
->
arg
))
||
(
min_value
!=
(
DefElem
*
)
NULL
&&
!
min_value
->
arg
))
{
{
if
(
new
->
increment_by
>
0
)
if
(
new
->
increment_by
>
0
)
...
@@ -963,7 +963,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
...
@@ -963,7 +963,7 @@ init_params(char *caller, List *options, Form_pg_sequence new)
}
}
/* START WITH */
/* START WITH */
if
(
new
->
last_value
==
NULL
&&
last_value
==
(
DefElem
*
)
NULL
)
if
(
new
->
last_value
==
0
&&
last_value
==
(
DefElem
*
)
NULL
)
{
{
if
(
new
->
increment_by
>
0
)
if
(
new
->
increment_by
>
0
)
new
->
last_value
=
new
->
min_value
;
/* ascending seq */
new
->
last_value
=
new
->
min_value
;
/* ascending seq */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment