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
b1faf362
Commit
b1faf362
authored
Apr 23, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow -2147483648 to be treated as an INT4 rather than INT8 constant.
Per discussion with Paul Edwards.
parent
d79eeef3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
9 deletions
+26
-9
src/backend/parser/parse_node.c
src/backend/parser/parse_node.c
+26
-9
No files found.
src/backend/parser/parse_node.c
View file @
b1faf362
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.8
7 2004/12/31 22:00:27 pgsq
l Exp $
* $PostgreSQL: pgsql/src/backend/parser/parse_node.c,v 1.8
8 2005/04/23 18:35:12 tg
l Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -276,9 +276,9 @@ transformArraySubscripts(ParseState *pstate,
* Explicit "NULL" constants are also typed as UNKNOWN.
*
* For integers and floats we produce int4, int8, or numeric depending
* on the value of the number. XXX
This should includ
e int2 as well,
* but additional cleanup is needed before we can do that;
else cases
*
like "WHERE int4var = 42" will fail to be indexable
.
* on the value of the number. XXX
We should produc
e int2 as well,
* but additional cleanup is needed before we can do that;
there are
*
too many examples that fail if we try
.
*/
Const
*
make_const
(
Value
*
value
)
...
...
@@ -304,11 +304,28 @@ make_const(Value *value)
/* could be an oversize integer as well as a float ... */
if
(
scanint8
(
strVal
(
value
),
true
,
&
val64
))
{
val
=
Int64GetDatum
(
val64
);
typeid
=
INT8OID
;
typelen
=
sizeof
(
int64
);
typebyval
=
false
;
/* XXX might change someday */
/*
* It might actually fit in int32. Probably only INT_MIN can
* occur, but we'll code the test generally just to be sure.
*/
int32
val32
=
(
int32
)
val64
;
if
(
val64
==
(
int64
)
val32
)
{
val
=
Int32GetDatum
(
val32
);
typeid
=
INT4OID
;
typelen
=
sizeof
(
int32
);
typebyval
=
true
;
}
else
{
val
=
Int64GetDatum
(
val64
);
typeid
=
INT8OID
;
typelen
=
sizeof
(
int64
);
typebyval
=
false
;
/* XXX might change someday */
}
}
else
{
...
...
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