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
303e089d
Commit
303e089d
authored
Sep 24, 2005
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up possibly-uninitialized-variable warnings reported by gcc 4.x.
parent
5d9c6b18
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
167 additions
and
126 deletions
+167
-126
src/backend/access/nbtree/nbtinsert.c
src/backend/access/nbtree/nbtinsert.c
+18
-20
src/backend/catalog/pg_proc.c
src/backend/catalog/pg_proc.c
+11
-5
src/backend/commands/copy.c
src/backend/commands/copy.c
+7
-1
src/backend/commands/functioncmds.c
src/backend/commands/functioncmds.c
+9
-2
src/backend/commands/tablecmds.c
src/backend/commands/tablecmds.c
+4
-3
src/backend/optimizer/path/indxpath.c
src/backend/optimizer/path/indxpath.c
+19
-25
src/backend/optimizer/plan/createplan.c
src/backend/optimizer/plan/createplan.c
+3
-2
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/planner.c
+3
-3
src/backend/regex/rege_dfa.c
src/backend/regex/rege_dfa.c
+3
-2
src/backend/regex/regexec.c
src/backend/regex/regexec.c
+2
-1
src/backend/utils/adt/inet_net_ntop.c
src/backend/utils/adt/inet_net_ntop.c
+3
-1
src/backend/utils/adt/nabstime.c
src/backend/utils/adt/nabstime.c
+51
-42
src/backend/utils/adt/selfuncs.c
src/backend/utils/adt/selfuncs.c
+2
-1
src/backend/utils/cache/catcache.c
src/backend/utils/cache/catcache.c
+3
-1
src/backend/utils/misc/guc.c
src/backend/utils/misc/guc.c
+13
-1
src/interfaces/ecpg/pgtypeslib/datetime.c
src/interfaces/ecpg/pgtypeslib/datetime.c
+2
-0
src/pl/plpgsql/src/pl_comp.c
src/pl/plpgsql/src/pl_comp.c
+14
-16
No files found.
src/backend/access/nbtree/nbtinsert.c
View file @
303e089d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.12
4 2005/08/11 13:22:33 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtinsert.c,v 1.12
5 2005/09/24 22:54:35 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -49,8 +49,7 @@ static void _bt_insertonpg(Relation rel, Buffer buf,
...
@@ -49,8 +49,7 @@ static void _bt_insertonpg(Relation rel, Buffer buf,
bool
split_only_page
);
bool
split_only_page
);
static
Buffer
_bt_split
(
Relation
rel
,
Buffer
buf
,
OffsetNumber
firstright
,
static
Buffer
_bt_split
(
Relation
rel
,
Buffer
buf
,
OffsetNumber
firstright
,
OffsetNumber
newitemoff
,
Size
newitemsz
,
OffsetNumber
newitemoff
,
Size
newitemsz
,
BTItem
newitem
,
bool
newitemonleft
,
BTItem
newitem
,
bool
newitemonleft
);
OffsetNumber
*
itup_off
,
BlockNumber
*
itup_blkno
);
static
OffsetNumber
_bt_findsplitloc
(
Relation
rel
,
Page
page
,
static
OffsetNumber
_bt_findsplitloc
(
Relation
rel
,
Page
page
,
OffsetNumber
newitemoff
,
OffsetNumber
newitemoff
,
Size
newitemsz
,
Size
newitemsz
,
...
@@ -365,8 +364,6 @@ _bt_insertonpg(Relation rel,
...
@@ -365,8 +364,6 @@ _bt_insertonpg(Relation rel,
{
{
Page
page
;
Page
page
;
BTPageOpaque
lpageop
;
BTPageOpaque
lpageop
;
OffsetNumber
itup_off
;
BlockNumber
itup_blkno
;
OffsetNumber
newitemoff
;
OffsetNumber
newitemoff
;
OffsetNumber
firstright
=
InvalidOffsetNumber
;
OffsetNumber
firstright
=
InvalidOffsetNumber
;
Size
itemsz
;
Size
itemsz
;
...
@@ -490,8 +487,7 @@ _bt_insertonpg(Relation rel,
...
@@ -490,8 +487,7 @@ _bt_insertonpg(Relation rel,
/* split the buffer into left and right halves */
/* split the buffer into left and right halves */
rbuf
=
_bt_split
(
rel
,
buf
,
firstright
,
rbuf
=
_bt_split
(
rel
,
buf
,
firstright
,
newitemoff
,
itemsz
,
btitem
,
newitemonleft
,
newitemoff
,
itemsz
,
btitem
,
newitemonleft
);
&
itup_off
,
&
itup_blkno
);
/*----------
/*----------
* By here,
* By here,
...
@@ -516,6 +512,8 @@ _bt_insertonpg(Relation rel,
...
@@ -516,6 +512,8 @@ _bt_insertonpg(Relation rel,
Buffer
metabuf
=
InvalidBuffer
;
Buffer
metabuf
=
InvalidBuffer
;
Page
metapg
=
NULL
;
Page
metapg
=
NULL
;
BTMetaPageData
*
metad
=
NULL
;
BTMetaPageData
*
metad
=
NULL
;
OffsetNumber
itup_off
;
BlockNumber
itup_blkno
;
itup_off
=
newitemoff
;
itup_off
=
newitemoff
;
itup_blkno
=
BufferGetBlockNumber
(
buf
);
itup_blkno
=
BufferGetBlockNumber
(
buf
);
...
@@ -640,14 +638,12 @@ _bt_insertonpg(Relation rel,
...
@@ -640,14 +638,12 @@ _bt_insertonpg(Relation rel,
* must be inserted along with the data from the old page.
* must be inserted along with the data from the old page.
*
*
* Returns the new right sibling of buf, pinned and write-locked.
* Returns the new right sibling of buf, pinned and write-locked.
* The pin and lock on buf are maintained. *itup_off and *itup_blkno
* The pin and lock on buf are maintained.
* are set to the exact location where newitem was inserted.
*/
*/
static
Buffer
static
Buffer
_bt_split
(
Relation
rel
,
Buffer
buf
,
OffsetNumber
firstright
,
_bt_split
(
Relation
rel
,
Buffer
buf
,
OffsetNumber
firstright
,
OffsetNumber
newitemoff
,
Size
newitemsz
,
BTItem
newitem
,
OffsetNumber
newitemoff
,
Size
newitemsz
,
BTItem
newitem
,
bool
newitemonleft
,
bool
newitemonleft
)
OffsetNumber
*
itup_off
,
BlockNumber
*
itup_blkno
)
{
{
Buffer
rbuf
;
Buffer
rbuf
;
Page
origpage
;
Page
origpage
;
...
@@ -659,6 +655,8 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
...
@@ -659,6 +655,8 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
Buffer
sbuf
=
InvalidBuffer
;
Buffer
sbuf
=
InvalidBuffer
;
Page
spage
=
NULL
;
Page
spage
=
NULL
;
BTPageOpaque
sopaque
=
NULL
;
BTPageOpaque
sopaque
=
NULL
;
OffsetNumber
itup_off
=
0
;
BlockNumber
itup_blkno
=
0
;
Size
itemsz
;
Size
itemsz
;
ItemId
itemid
;
ItemId
itemid
;
BTItem
item
;
BTItem
item
;
...
@@ -752,16 +750,16 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
...
@@ -752,16 +750,16 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
{
{
_bt_pgaddtup
(
rel
,
leftpage
,
newitemsz
,
newitem
,
leftoff
,
_bt_pgaddtup
(
rel
,
leftpage
,
newitemsz
,
newitem
,
leftoff
,
"left sibling"
);
"left sibling"
);
*
itup_off
=
leftoff
;
itup_off
=
leftoff
;
*
itup_blkno
=
BufferGetBlockNumber
(
buf
);
itup_blkno
=
BufferGetBlockNumber
(
buf
);
leftoff
=
OffsetNumberNext
(
leftoff
);
leftoff
=
OffsetNumberNext
(
leftoff
);
}
}
else
else
{
{
_bt_pgaddtup
(
rel
,
rightpage
,
newitemsz
,
newitem
,
rightoff
,
_bt_pgaddtup
(
rel
,
rightpage
,
newitemsz
,
newitem
,
rightoff
,
"right sibling"
);
"right sibling"
);
*
itup_off
=
rightoff
;
itup_off
=
rightoff
;
*
itup_blkno
=
BufferGetBlockNumber
(
rbuf
);
itup_blkno
=
BufferGetBlockNumber
(
rbuf
);
rightoff
=
OffsetNumberNext
(
rightoff
);
rightoff
=
OffsetNumberNext
(
rightoff
);
}
}
}
}
...
@@ -788,16 +786,16 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
...
@@ -788,16 +786,16 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
{
{
_bt_pgaddtup
(
rel
,
leftpage
,
newitemsz
,
newitem
,
leftoff
,
_bt_pgaddtup
(
rel
,
leftpage
,
newitemsz
,
newitem
,
leftoff
,
"left sibling"
);
"left sibling"
);
*
itup_off
=
leftoff
;
itup_off
=
leftoff
;
*
itup_blkno
=
BufferGetBlockNumber
(
buf
);
itup_blkno
=
BufferGetBlockNumber
(
buf
);
leftoff
=
OffsetNumberNext
(
leftoff
);
leftoff
=
OffsetNumberNext
(
leftoff
);
}
}
else
else
{
{
_bt_pgaddtup
(
rel
,
rightpage
,
newitemsz
,
newitem
,
rightoff
,
_bt_pgaddtup
(
rel
,
rightpage
,
newitemsz
,
newitem
,
rightoff
,
"right sibling"
);
"right sibling"
);
*
itup_off
=
rightoff
;
itup_off
=
rightoff
;
*
itup_blkno
=
BufferGetBlockNumber
(
rbuf
);
itup_blkno
=
BufferGetBlockNumber
(
rbuf
);
rightoff
=
OffsetNumberNext
(
rightoff
);
rightoff
=
OffsetNumberNext
(
rightoff
);
}
}
}
}
...
@@ -839,7 +837,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
...
@@ -839,7 +837,7 @@ _bt_split(Relation rel, Buffer buf, OffsetNumber firstright,
XLogRecData
rdata
[
4
];
XLogRecData
rdata
[
4
];
xlrec
.
target
.
node
=
rel
->
rd_node
;
xlrec
.
target
.
node
=
rel
->
rd_node
;
ItemPointerSet
(
&
(
xlrec
.
target
.
tid
),
*
itup_blkno
,
*
itup_off
);
ItemPointerSet
(
&
(
xlrec
.
target
.
tid
),
itup_blkno
,
itup_off
);
if
(
newitemonleft
)
if
(
newitemonleft
)
xlrec
.
otherblk
=
BufferGetBlockNumber
(
rbuf
);
xlrec
.
otherblk
=
BufferGetBlockNumber
(
rbuf
);
else
else
...
...
src/backend/catalog/pg_proc.c
View file @
303e089d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.13
2 2005/07/07 20:39:57
tgl Exp $
* $PostgreSQL: pgsql/src/backend/catalog/pg_proc.c,v 1.13
3 2005/09/24 22:54:35
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -789,21 +789,27 @@ match_prosrc_to_literal(const char *prosrc, const char *literal,
...
@@ -789,21 +789,27 @@ match_prosrc_to_literal(const char *prosrc, const char *literal,
else
if
(
*
literal
==
'\''
)
else
if
(
*
literal
==
'\''
)
{
{
if
(
literal
[
1
]
!=
'\''
)
if
(
literal
[
1
]
!=
'\''
)
return
false
;
goto
fail
;
literal
++
;
literal
++
;
if
(
cursorpos
>
0
)
if
(
cursorpos
>
0
)
newcp
++
;
newcp
++
;
}
}
chlen
=
pg_mblen
(
prosrc
);
chlen
=
pg_mblen
(
prosrc
);
if
(
strncmp
(
prosrc
,
literal
,
chlen
)
!=
0
)
if
(
strncmp
(
prosrc
,
literal
,
chlen
)
!=
0
)
return
false
;
goto
fail
;
prosrc
+=
chlen
;
prosrc
+=
chlen
;
literal
+=
chlen
;
literal
+=
chlen
;
}
}
*
newcursorpos
=
newcp
;
if
(
*
literal
==
'\''
&&
literal
[
1
]
!=
'\''
)
if
(
*
literal
==
'\''
&&
literal
[
1
]
!=
'\''
)
{
/* success */
*
newcursorpos
=
newcp
;
return
true
;
return
true
;
}
fail:
/* Must set *newcursorpos to suppress compiler warning */
*
newcursorpos
=
newcp
;
return
false
;
return
false
;
}
}
src/backend/commands/copy.c
View file @
303e089d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.25
0 2005/09/24 17:53:12
tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/copy.c,v 1.25
1 2005/09/24 22:54:36
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -542,7 +542,10 @@ CopyGetInt32(CopyState cstate, int32 *val)
...
@@ -542,7 +542,10 @@ CopyGetInt32(CopyState cstate, int32 *val)
uint32
buf
;
uint32
buf
;
if
(
CopyGetData
(
cstate
,
&
buf
,
sizeof
(
buf
),
sizeof
(
buf
))
!=
sizeof
(
buf
))
if
(
CopyGetData
(
cstate
,
&
buf
,
sizeof
(
buf
),
sizeof
(
buf
))
!=
sizeof
(
buf
))
{
*
val
=
0
;
/* suppress compiler warning */
return
false
;
return
false
;
}
*
val
=
(
int32
)
ntohl
(
buf
);
*
val
=
(
int32
)
ntohl
(
buf
);
return
true
;
return
true
;
}
}
...
@@ -568,7 +571,10 @@ CopyGetInt16(CopyState cstate, int16 *val)
...
@@ -568,7 +571,10 @@ CopyGetInt16(CopyState cstate, int16 *val)
uint16
buf
;
uint16
buf
;
if
(
CopyGetData
(
cstate
,
&
buf
,
sizeof
(
buf
),
sizeof
(
buf
))
!=
sizeof
(
buf
))
if
(
CopyGetData
(
cstate
,
&
buf
,
sizeof
(
buf
),
sizeof
(
buf
))
!=
sizeof
(
buf
))
{
*
val
=
0
;
/* suppress compiler warning */
return
false
;
return
false
;
}
*
val
=
(
int16
)
ntohs
(
buf
);
*
val
=
(
int16
)
ntohs
(
buf
);
return
true
;
return
true
;
}
}
...
...
src/backend/commands/functioncmds.c
View file @
303e089d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.6
7 2005/09/08 20:07:41
tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/functioncmds.c,v 1.6
8 2005/09/24 22:54:36
tgl Exp $
*
*
* DESCRIPTION
* DESCRIPTION
* These routines take the parse tree and pick out the
* These routines take the parse tree and pick out the
...
@@ -158,6 +158,8 @@ examine_parameter_list(List *parameters, Oid languageOid,
...
@@ -158,6 +158,8 @@ examine_parameter_list(List *parameters, Oid languageOid,
ListCell
*
x
;
ListCell
*
x
;
int
i
;
int
i
;
*
requiredResultType
=
InvalidOid
;
/* default result */
inTypes
=
(
Oid
*
)
palloc
(
parameterCount
*
sizeof
(
Oid
));
inTypes
=
(
Oid
*
)
palloc
(
parameterCount
*
sizeof
(
Oid
));
allTypes
=
(
Datum
*
)
palloc
(
parameterCount
*
sizeof
(
Datum
));
allTypes
=
(
Datum
*
)
palloc
(
parameterCount
*
sizeof
(
Datum
));
paramModes
=
(
Datum
*
)
palloc
(
parameterCount
*
sizeof
(
Datum
));
paramModes
=
(
Datum
*
)
palloc
(
parameterCount
*
sizeof
(
Datum
));
...
@@ -243,7 +245,6 @@ examine_parameter_list(List *parameters, Oid languageOid,
...
@@ -243,7 +245,6 @@ examine_parameter_list(List *parameters, Oid languageOid,
{
{
*
allParameterTypes
=
NULL
;
*
allParameterTypes
=
NULL
;
*
parameterModes
=
NULL
;
*
parameterModes
=
NULL
;
*
requiredResultType
=
InvalidOid
;
}
}
if
(
have_names
)
if
(
have_names
)
...
@@ -383,16 +384,22 @@ compute_attributes_sql_style(List *options,
...
@@ -383,16 +384,22 @@ compute_attributes_sql_style(List *options,
if
(
as_item
)
if
(
as_item
)
*
as
=
(
List
*
)
as_item
->
arg
;
*
as
=
(
List
*
)
as_item
->
arg
;
else
else
{
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_FUNCTION_DEFINITION
),
(
errcode
(
ERRCODE_INVALID_FUNCTION_DEFINITION
),
errmsg
(
"no function body specified"
)));
errmsg
(
"no function body specified"
)));
*
as
=
NIL
;
/* keep compiler quiet */
}
if
(
language_item
)
if
(
language_item
)
*
language
=
strVal
(
language_item
->
arg
);
*
language
=
strVal
(
language_item
->
arg
);
else
else
{
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_FUNCTION_DEFINITION
),
(
errcode
(
ERRCODE_INVALID_FUNCTION_DEFINITION
),
errmsg
(
"no language specified"
)));
errmsg
(
"no language specified"
)));
*
language
=
NULL
;
/* keep compiler quiet */
}
/* process optional items */
/* process optional items */
if
(
volatility_item
)
if
(
volatility_item
)
...
...
src/backend/commands/tablecmds.c
View file @
303e089d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.17
0 2005/08/26 03:07:1
6 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.17
1 2005/09/24 22:54:3
6 tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -4109,6 +4109,8 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
...
@@ -4109,6 +4109,8 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
* look up each one in the pg_index syscache until we find one marked
* look up each one in the pg_index syscache until we find one marked
* primary key (hopefully there isn't more than one such).
* primary key (hopefully there isn't more than one such).
*/
*/
*
indexOid
=
InvalidOid
;
indexoidlist
=
RelationGetIndexList
(
pkrel
);
indexoidlist
=
RelationGetIndexList
(
pkrel
);
foreach
(
indexoidscan
,
indexoidlist
)
foreach
(
indexoidscan
,
indexoidlist
)
...
@@ -4127,7 +4129,6 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
...
@@ -4127,7 +4129,6 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
break
;
break
;
}
}
ReleaseSysCache
(
indexTuple
);
ReleaseSysCache
(
indexTuple
);
indexStruct
=
NULL
;
}
}
list_free
(
indexoidlist
);
list_free
(
indexoidlist
);
...
@@ -4135,7 +4136,7 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
...
@@ -4135,7 +4136,7 @@ transformFkeyGetPrimaryKey(Relation pkrel, Oid *indexOid,
/*
/*
* Check that we found it
* Check that we found it
*/
*/
if
(
indexStruct
==
NULL
)
if
(
!
OidIsValid
(
*
indexOid
)
)
ereport
(
ERROR
,
ereport
(
ERROR
,
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
(
errcode
(
ERRCODE_UNDEFINED_OBJECT
),
errmsg
(
"there is no primary key for referenced table
\"
%s
\"
"
,
errmsg
(
"there is no primary key for referenced table
\"
%s
\"
"
,
...
...
src/backend/optimizer/path/indxpath.c
View file @
303e089d
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.1
89 2005/09/22 23:25:07
tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.1
90 2005/09/24 22:54:36
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -65,10 +65,9 @@ static bool matches_any_index(RestrictInfo *rinfo, RelOptInfo *rel,
...
@@ -65,10 +65,9 @@ static bool matches_any_index(RestrictInfo *rinfo, RelOptInfo *rel,
Relids
outer_relids
);
Relids
outer_relids
);
static
List
*
find_clauses_for_join
(
PlannerInfo
*
root
,
RelOptInfo
*
rel
,
static
List
*
find_clauses_for_join
(
PlannerInfo
*
root
,
RelOptInfo
*
rel
,
Relids
outer_relids
,
bool
isouterjoin
);
Relids
outer_relids
,
bool
isouterjoin
);
static
bool
match_variant_ordering
(
PlannerInfo
*
root
,
static
ScanDirection
match_variant_ordering
(
PlannerInfo
*
root
,
IndexOptInfo
*
index
,
IndexOptInfo
*
index
,
List
*
restrictclauses
,
List
*
restrictclauses
);
ScanDirection
*
indexscandir
);
static
List
*
identify_ignorable_ordering_cols
(
PlannerInfo
*
root
,
static
List
*
identify_ignorable_ordering_cols
(
PlannerInfo
*
root
,
IndexOptInfo
*
index
,
IndexOptInfo
*
index
,
List
*
restrictclauses
);
List
*
restrictclauses
);
...
@@ -362,15 +361,15 @@ find_usable_indexes(PlannerInfo *root, RelOptInfo *rel,
...
@@ -362,15 +361,15 @@ find_usable_indexes(PlannerInfo *root, RelOptInfo *rel,
root
->
query_pathkeys
!=
NIL
&&
root
->
query_pathkeys
!=
NIL
&&
pathkeys_useful_for_ordering
(
root
,
useful_pathkeys
)
==
0
)
pathkeys_useful_for_ordering
(
root
,
useful_pathkeys
)
==
0
)
{
{
ScanDirection
index
scandir
;
ScanDirection
scandir
;
if
(
match_variant_ordering
(
root
,
index
,
restrictclauses
,
scandir
=
match_variant_ordering
(
root
,
index
,
restrictclauses
);
&
index
scandir
))
if
(
!
ScanDirectionIsNoMovement
(
scandir
))
{
{
ipath
=
create_index_path
(
root
,
index
,
ipath
=
create_index_path
(
root
,
index
,
restrictclauses
,
restrictclauses
,
root
->
query_pathkeys
,
root
->
query_pathkeys
,
index
scandir
,
scandir
,
false
);
false
);
result
=
lappend
(
result
,
ipath
);
result
=
lappend
(
result
,
ipath
);
}
}
...
@@ -1304,15 +1303,14 @@ find_clauses_for_join(PlannerInfo *root, RelOptInfo *rel,
...
@@ -1304,15 +1303,14 @@ find_clauses_for_join(PlannerInfo *root, RelOptInfo *rel,
* 'restrictclauses' is the list of sublists of restriction clauses
* 'restrictclauses' is the list of sublists of restriction clauses
* matching the columns of the index (NIL if none)
* matching the columns of the index (NIL if none)
*
*
*
Returns TRUE if able to match the requested query pathkeys, FALSE if not.
*
If able to match the requested query pathkeys, returns either
*
In the TRUE case, sets '*indexscandir' to either ForwardScanDirection or
*
ForwardScanDirection or BackwardScanDirection to indicate the proper index
*
BackwardScanDirection to indicate the proper scan d
irection.
*
scan direction. If no match, returns NoMovementScanD
irection.
*/
*/
static
bool
static
ScanDirection
match_variant_ordering
(
PlannerInfo
*
root
,
match_variant_ordering
(
PlannerInfo
*
root
,
IndexOptInfo
*
index
,
IndexOptInfo
*
index
,
List
*
restrictclauses
,
List
*
restrictclauses
)
ScanDirection
*
indexscandir
)
{
{
List
*
ignorables
;
List
*
ignorables
;
...
@@ -1328,7 +1326,7 @@ match_variant_ordering(PlannerInfo *root,
...
@@ -1328,7 +1326,7 @@ match_variant_ordering(PlannerInfo *root,
* won't cope.
* won't cope.
*/
*/
if
(
index
->
relam
!=
BTREE_AM_OID
)
if
(
index
->
relam
!=
BTREE_AM_OID
)
return
false
;
return
NoMovementScanDirection
;
/*
/*
* Figure out which index columns can be optionally ignored because
* Figure out which index columns can be optionally ignored because
* they have an equality constraint. This is the same set for either
* they have an equality constraint. This is the same set for either
...
@@ -1344,17 +1342,13 @@ match_variant_ordering(PlannerInfo *root,
...
@@ -1344,17 +1342,13 @@ match_variant_ordering(PlannerInfo *root,
if
(
ignorables
&&
if
(
ignorables
&&
match_index_to_query_keys
(
root
,
index
,
ForwardScanDirection
,
match_index_to_query_keys
(
root
,
index
,
ForwardScanDirection
,
ignorables
))
ignorables
))
{
return
ForwardScanDirection
;
*
indexscandir
=
ForwardScanDirection
;
return
true
;
}
if
(
match_index_to_query_keys
(
root
,
index
,
BackwardScanDirection
,
if
(
match_index_to_query_keys
(
root
,
index
,
BackwardScanDirection
,
ignorables
))
ignorables
))
{
return
BackwardScanDirection
;
*
indexscandir
=
BackwardScanDirection
;
return
true
;
return
NoMovementScanDirection
;
}
return
false
;
}
}
/*
/*
...
...
src/backend/optimizer/plan/createplan.c
View file @
303e089d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.19
7 2005/08/18 17:51:11
tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.19
8 2005/09/24 22:54:37
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -1634,7 +1634,8 @@ fix_indexqual_operand(Node *node, IndexOptInfo *index, Oid *opclass)
...
@@ -1634,7 +1634,8 @@ fix_indexqual_operand(Node *node, IndexOptInfo *index, Oid *opclass)
/* Ooops... */
/* Ooops... */
elog
(
ERROR
,
"node is not an index attribute"
);
elog
(
ERROR
,
"node is not an index attribute"
);
return
NULL
;
/* keep compiler quiet */
*
opclass
=
InvalidOid
;
/* keep compiler quiet */
return
NULL
;
}
}
/*
/*
...
...
src/backend/optimizer/plan/planner.c
View file @
303e089d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.19
2 2005/08/27 22:13:43
tgl Exp $
* $PostgreSQL: pgsql/src/backend/optimizer/plan/planner.c,v 1.19
3 2005/09/24 22:54:37
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -649,8 +649,8 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
...
@@ -649,8 +649,8 @@ grouping_planner(PlannerInfo *root, double tuple_fraction)
{
{
Query
*
parse
=
root
->
parse
;
Query
*
parse
=
root
->
parse
;
List
*
tlist
=
parse
->
targetList
;
List
*
tlist
=
parse
->
targetList
;
int
offset_est
;
int
offset_est
=
0
;
int
count_est
;
int
count_est
=
0
;
Plan
*
result_plan
;
Plan
*
result_plan
;
List
*
current_pathkeys
;
List
*
current_pathkeys
;
List
*
sort_pathkeys
;
List
*
sort_pathkeys
;
...
...
src/backend/regex/rege_dfa.c
View file @
303e089d
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* $PostgreSQL: pgsql/src/backend/regex/rege_dfa.c,v 1.
4 2003/11/29 19:51:55 pgsq
l Exp $
* $PostgreSQL: pgsql/src/backend/regex/rege_dfa.c,v 1.
5 2005/09/24 22:54:38 tg
l Exp $
*
*
*/
*/
...
@@ -578,7 +578,6 @@ getvacant(struct vars * v, /* used only for debug flags */
...
@@ -578,7 +578,6 @@ getvacant(struct vars * v, /* used only for debug flags */
struct
sset
*
ss
;
struct
sset
*
ss
;
struct
sset
*
p
;
struct
sset
*
p
;
struct
arcp
ap
;
struct
arcp
ap
;
struct
arcp
lastap
;
color
co
;
color
co
;
ss
=
pickss
(
v
,
d
,
cp
,
start
);
ss
=
pickss
(
v
,
d
,
cp
,
start
);
...
@@ -608,6 +607,8 @@ getvacant(struct vars * v, /* used only for debug flags */
...
@@ -608,6 +607,8 @@ getvacant(struct vars * v, /* used only for debug flags */
p
->
ins
=
ss
->
inchain
[
i
];
p
->
ins
=
ss
->
inchain
[
i
];
else
else
{
{
struct
arcp
lastap
=
{
NULL
,
0
};
assert
(
p
->
ins
.
ss
!=
NULL
);
assert
(
p
->
ins
.
ss
!=
NULL
);
for
(
ap
=
p
->
ins
;
ap
.
ss
!=
NULL
&&
for
(
ap
=
p
->
ins
;
ap
.
ss
!=
NULL
&&
!
(
ap
.
ss
==
ss
&&
ap
.
co
==
i
);
!
(
ap
.
ss
==
ss
&&
ap
.
co
==
i
);
...
...
src/backend/regex/regexec.c
View file @
303e089d
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* $PostgreSQL: pgsql/src/backend/regex/regexec.c,v 1.2
5 2005/07/10 04:54:30 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/regex/regexec.c,v 1.2
6 2005/09/24 22:54:38 tgl
Exp $
*
*
*/
*/
...
@@ -464,6 +464,7 @@ cfindloop(struct vars * v,
...
@@ -464,6 +464,7 @@ cfindloop(struct vars * v,
if
(
er
!=
REG_NOMATCH
)
if
(
er
!=
REG_NOMATCH
)
{
{
ERR
(
er
);
ERR
(
er
);
*
coldp
=
cold
;
return
er
;
return
er
;
}
}
if
((
shorter
)
?
end
==
estop
:
end
==
begin
)
if
((
shorter
)
?
end
==
estop
:
end
==
begin
)
...
...
src/backend/utils/adt/inet_net_ntop.c
View file @
303e089d
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
* OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*
* $PostgreSQL: pgsql/src/backend/utils/adt/inet_net_ntop.c,v 1.
19 2005/02/01 00:59:09
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/inet_net_ntop.c,v 1.
20 2005/09/24 22:54:38
tgl Exp $
*/
*/
#if defined(LIBC_SCCS) && !defined(lint)
#if defined(LIBC_SCCS) && !defined(lint)
...
@@ -443,6 +443,8 @@ inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
...
@@ -443,6 +443,8 @@ inet_net_ntop_ipv6(const u_char *src, int bits, char *dst, size_t size)
words
[
i
/
2
]
|=
(
src
[
i
]
<<
((
1
-
(
i
%
2
))
<<
3
));
words
[
i
/
2
]
|=
(
src
[
i
]
<<
((
1
-
(
i
%
2
))
<<
3
));
best
.
base
=
-
1
;
best
.
base
=
-
1
;
cur
.
base
=
-
1
;
cur
.
base
=
-
1
;
best
.
len
=
0
;
cur
.
len
=
0
;
for
(
i
=
0
;
i
<
(
NS_IN6ADDRSZ
/
NS_INT16SZ
);
i
++
)
for
(
i
=
0
;
i
<
(
NS_IN6ADDRSZ
/
NS_INT16SZ
);
i
++
)
{
{
if
(
words
[
i
]
==
0
)
if
(
words
[
i
]
==
0
)
...
...
src/backend/utils/adt/nabstime.c
View file @
303e089d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.14
2 2005/07/23 14:25:33 momjian
Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/nabstime.c,v 1.14
3 2005/09/24 22:54:38 tgl
Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -79,9 +79,9 @@
...
@@ -79,9 +79,9 @@
static
AbsoluteTime
tm2abstime
(
struct
pg_tm
*
tm
,
int
tz
);
static
AbsoluteTime
tm2abstime
(
struct
pg_tm
*
tm
,
int
tz
);
static
void
reltime2tm
(
RelativeTime
time
,
struct
pg_tm
*
tm
);
static
void
reltime2tm
(
RelativeTime
time
,
struct
pg_tm
*
tm
);
static
int
is
tinterval
(
char
*
i_string
,
static
void
parse
tinterval
(
char
*
i_string
,
AbsoluteTime
*
i_start
,
AbsoluteTime
*
i_start
,
AbsoluteTime
*
i_end
);
AbsoluteTime
*
i_end
);
/*
/*
...
@@ -727,24 +727,19 @@ tintervalin(PG_FUNCTION_ARGS)
...
@@ -727,24 +727,19 @@ tintervalin(PG_FUNCTION_ARGS)
t1
,
t1
,
t2
;
t2
;
tinterval
=
(
TimeInterval
)
palloc
(
sizeof
(
TimeIntervalData
)
);
parsetinterval
(
tintervalstr
,
&
t1
,
&
t2
);
if
(
istinterval
(
tintervalstr
,
&
t1
,
&
t2
)
==
0
)
tinterval
=
(
TimeInterval
)
palloc
(
sizeof
(
TimeIntervalData
));
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_DATETIME_FORMAT
),
errmsg
(
"invalid input syntax for type tinterval:
\"
%s
\"
"
,
tintervalstr
)));
if
(
t1
==
INVALID_ABSTIME
||
t2
==
INVALID_ABSTIME
)
if
(
t1
==
INVALID_ABSTIME
||
t2
==
INVALID_ABSTIME
)
tinterval
->
status
=
T_INTERVAL_INVAL
;
/* undefined */
tinterval
->
status
=
T_INTERVAL_INVAL
;
/* undefined */
else
else
tinterval
->
status
=
T_INTERVAL_VALID
;
tinterval
->
status
=
T_INTERVAL_VALID
;
i_start
=
ABSTIMEMIN
(
t1
,
t2
);
i_start
=
ABSTIMEMIN
(
t1
,
t2
);
i_end
=
ABSTIMEMAX
(
t1
,
t2
);
i_end
=
ABSTIMEMAX
(
t1
,
t2
);
tinterval
->
data
[
0
]
=
i_start
;
tinterval
->
data
[
0
]
=
i_start
;
tinterval
->
data
[
1
]
=
i_end
;
tinterval
->
data
[
1
]
=
i_end
;
PG_RETURN_TIMEINTERVAL
(
tinterval
);
PG_RETURN_TIMEINTERVAL
(
tinterval
);
}
}
...
@@ -1444,11 +1439,9 @@ tintervalend(PG_FUNCTION_ARGS)
...
@@ -1444,11 +1439,9 @@ tintervalend(PG_FUNCTION_ARGS)
*****************************************************************************/
*****************************************************************************/
/*
/*
* istinterval - returns 1, iff i_string is a valid tinterval descr.
* parsetinterval -- parse a tinterval string
* 0, iff i_string is NOT a valid tinterval desc.
* 2, iff any time is INVALID_ABSTIME
*
*
* output parameter:
* output parameter
s
:
* i_start, i_end: tinterval margins
* i_start, i_end: tinterval margins
*
*
* Time interval:
* Time interval:
...
@@ -1460,10 +1453,10 @@ tintervalend(PG_FUNCTION_ARGS)
...
@@ -1460,10 +1453,10 @@ tintervalend(PG_FUNCTION_ARGS)
*
*
* e.g. [ ' Jan 18 1902' 'Jan 1 00:00:00 1970']
* e.g. [ ' Jan 18 1902' 'Jan 1 00:00:00 1970']
*/
*/
static
int
static
void
is
tinterval
(
char
*
i_string
,
parse
tinterval
(
char
*
i_string
,
AbsoluteTime
*
i_start
,
AbsoluteTime
*
i_start
,
AbsoluteTime
*
i_end
)
AbsoluteTime
*
i_end
)
{
{
char
*
p
,
char
*
p
,
*
p1
;
*
p1
;
...
@@ -1476,10 +1469,12 @@ istinterval(char *i_string,
...
@@ -1476,10 +1469,12 @@ istinterval(char *i_string,
if
(
IsSpace
(
c
))
if
(
IsSpace
(
c
))
p
++
;
p
++
;
else
if
(
c
!=
'['
)
else
if
(
c
!=
'['
)
return
0
;
/* syntax error */
goto
bogus
;
/* syntax error */
else
else
break
;
break
;
}
}
if
(
c
==
'\0'
)
goto
bogus
;
/* syntax error */
p
++
;
p
++
;
/* skip leading blanks up to '"' */
/* skip leading blanks up to '"' */
while
((
c
=
*
p
)
!=
'\0'
)
while
((
c
=
*
p
)
!=
'\0'
)
...
@@ -1487,30 +1482,32 @@ istinterval(char *i_string,
...
@@ -1487,30 +1482,32 @@ istinterval(char *i_string,
if
(
IsSpace
(
c
))
if
(
IsSpace
(
c
))
p
++
;
p
++
;
else
if
(
c
!=
'"'
)
else
if
(
c
!=
'"'
)
return
0
;
/* syntax error */
goto
bogus
;
/* syntax error */
else
else
break
;
break
;
}
}
if
(
c
==
'\0'
)
goto
bogus
;
/* syntax error */
p
++
;
p
++
;
if
(
strncmp
(
INVALID_INTERVAL_STR
,
p
,
strlen
(
INVALID_INTERVAL_STR
))
==
0
)
if
(
strncmp
(
INVALID_INTERVAL_STR
,
p
,
strlen
(
INVALID_INTERVAL_STR
))
==
0
)
return
0
;
/* undefined range, handled like a syntax
goto
bogus
;
/* undefined range, handled like a syntax
* err. */
* err. */
/* search for the end of the first date and change it to a
NULL
*/
/* search for the end of the first date and change it to a
\0
*/
p1
=
p
;
p1
=
p
;
while
((
c
=
*
p1
)
!=
'\0'
)
while
((
c
=
*
p1
)
!=
'\0'
)
{
{
if
(
c
==
'"'
)
if
(
c
==
'"'
)
{
*
p1
=
'\0'
;
break
;
break
;
}
p1
++
;
p1
++
;
}
}
if
(
c
==
'\0'
)
goto
bogus
;
/* syntax error */
*
p1
=
'\0'
;
/* get the first date */
/* get the first date */
*
i_start
=
DatumGetAbsoluteTime
(
DirectFunctionCall1
(
abstimein
,
*
i_start
=
DatumGetAbsoluteTime
(
DirectFunctionCall1
(
abstimein
,
CStringGetDatum
(
p
)));
CStringGetDatum
(
p
)));
/*
rechange NULL at the end of the first date to a '"'
*/
/*
undo change to \0
*/
*
p1
=
'"'
;
*
p1
=
c
;
p
=
++
p1
;
p
=
++
p1
;
/* skip blanks up to '"', beginning of second date */
/* skip blanks up to '"', beginning of second date */
while
((
c
=
*
p
)
!=
'\0'
)
while
((
c
=
*
p
)
!=
'\0'
)
...
@@ -1518,27 +1515,29 @@ istinterval(char *i_string,
...
@@ -1518,27 +1515,29 @@ istinterval(char *i_string,
if
(
IsSpace
(
c
))
if
(
IsSpace
(
c
))
p
++
;
p
++
;
else
if
(
c
!=
'"'
)
else
if
(
c
!=
'"'
)
return
0
;
/* syntax error */
goto
bogus
;
/* syntax error */
else
else
break
;
break
;
}
}
if
(
c
==
'\0'
)
goto
bogus
;
/* syntax error */
p
++
;
p
++
;
/* search for the end of the second date and change it to a
NULL
*/
/* search for the end of the second date and change it to a
\0
*/
p1
=
p
;
p1
=
p
;
while
((
c
=
*
p1
)
!=
'\0'
)
while
((
c
=
*
p1
)
!=
'\0'
)
{
{
if
(
c
==
'"'
)
if
(
c
==
'"'
)
{
*
p1
=
'\0'
;
break
;
break
;
}
p1
++
;
p1
++
;
}
}
if
(
c
==
'\0'
)
goto
bogus
;
/* syntax error */
*
p1
=
'\0'
;
/* get the second date */
/* get the second date */
*
i_end
=
DatumGetAbsoluteTime
(
DirectFunctionCall1
(
abstimein
,
*
i_end
=
DatumGetAbsoluteTime
(
DirectFunctionCall1
(
abstimein
,
CStringGetDatum
(
p
)));
CStringGetDatum
(
p
)));
/*
rechange NULL at the end of the first date to a '"'
*/
/*
undo change to \0
*/
*
p1
=
'"'
;
*
p1
=
c
;
p
=
++
p1
;
p
=
++
p1
;
/* skip blanks up to ']' */
/* skip blanks up to ']' */
while
((
c
=
*
p
)
!=
'\0'
)
while
((
c
=
*
p
)
!=
'\0'
)
...
@@ -1546,16 +1545,26 @@ istinterval(char *i_string,
...
@@ -1546,16 +1545,26 @@ istinterval(char *i_string,
if
(
IsSpace
(
c
))
if
(
IsSpace
(
c
))
p
++
;
p
++
;
else
if
(
c
!=
']'
)
else
if
(
c
!=
']'
)
return
0
;
/* syntax error */
goto
bogus
;
/* syntax error */
else
else
break
;
break
;
}
}
if
(
c
==
'\0'
)
goto
bogus
;
/* syntax error */
p
++
;
p
++
;
c
=
*
p
;
c
=
*
p
;
if
(
c
!=
'\0'
)
if
(
c
!=
'\0'
)
return
0
;
/* syntax error */
goto
bogus
;
/* syntax error */
/* it seems to be a valid tinterval */
/* it seems to be a valid tinterval */
return
1
;
return
;
bogus:
ereport
(
ERROR
,
(
errcode
(
ERRCODE_INVALID_DATETIME_FORMAT
),
errmsg
(
"invalid input syntax for type tinterval:
\"
%s
\"
"
,
i_string
)));
*
i_start
=
*
i_end
=
INVALID_ABSTIME
;
/* keep compiler quiet */
}
}
...
...
src/backend/utils/adt/selfuncs.c
View file @
303e089d
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.18
8 2005/09/24 17:53:16
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/adt/selfuncs.c,v 1.18
9 2005/09/24 22:54:38
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -2403,6 +2403,7 @@ convert_to_scalar(Datum value, Oid valuetypid, double *scaledvalue,
...
@@ -2403,6 +2403,7 @@ convert_to_scalar(Datum value, Oid valuetypid, double *scaledvalue,
return
true
;
return
true
;
}
}
/* Don't know how to convert */
/* Don't know how to convert */
*
scaledvalue
=
*
scaledlobound
=
*
scaledhibound
=
0
;
return
false
;
return
false
;
}
}
...
...
src/backend/utils/cache/catcache.c
View file @
303e089d
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.12
3 2005/08/13 22:18:07
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/catcache.c,v 1.12
4 2005/09/24 22:54:39
tgl Exp $
*
*
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*/
*/
...
@@ -161,6 +161,8 @@ GetCCHashEqFuncs(Oid keytype, PGFunction *hashfunc, RegProcedure *eqfunc)
...
@@ -161,6 +161,8 @@ GetCCHashEqFuncs(Oid keytype, PGFunction *hashfunc, RegProcedure *eqfunc)
break
;
break
;
default:
default:
elog
(
FATAL
,
"type %u not supported as catcache key"
,
keytype
);
elog
(
FATAL
,
"type %u not supported as catcache key"
,
keytype
);
*
hashfunc
=
NULL
;
/* keep compiler quiet */
*
eqfunc
=
InvalidOid
;
break
;
break
;
}
}
}
}
...
...
src/backend/utils/misc/guc.c
View file @
303e089d
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
* Written by Peter Eisentraut <peter_e@gmx.net>.
* Written by Peter Eisentraut <peter_e@gmx.net>.
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.28
8 2005/09/12 02:26:32
tgl Exp $
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.28
9 2005/09/24 22:54:39
tgl Exp $
*
*
*--------------------------------------------------------------------
*--------------------------------------------------------------------
*/
*/
...
@@ -3401,7 +3401,11 @@ parse_bool(const char *value, bool *result)
...
@@ -3401,7 +3401,11 @@ parse_bool(const char *value, bool *result)
}
}
else
else
{
if
(
result
)
*
result
=
false
;
/* suppress compiler warning */
return
false
;
return
false
;
}
return
true
;
return
true
;
}
}
...
@@ -3427,7 +3431,11 @@ parse_int(const char *value, int *result)
...
@@ -3427,7 +3431,11 @@ parse_int(const char *value, int *result)
||
val
!=
(
long
)
((
int32
)
val
)
||
val
!=
(
long
)
((
int32
)
val
)
#endif
#endif
)
)
{
if
(
result
)
*
result
=
0
;
/* suppress compiler warning */
return
false
;
return
false
;
}
if
(
result
)
if
(
result
)
*
result
=
(
int
)
val
;
*
result
=
(
int
)
val
;
return
true
;
return
true
;
...
@@ -3449,7 +3457,11 @@ parse_real(const char *value, double *result)
...
@@ -3449,7 +3457,11 @@ parse_real(const char *value, double *result)
errno
=
0
;
errno
=
0
;
val
=
strtod
(
value
,
&
endptr
);
val
=
strtod
(
value
,
&
endptr
);
if
(
endptr
==
value
||
*
endptr
!=
'\0'
||
errno
==
ERANGE
)
if
(
endptr
==
value
||
*
endptr
!=
'\0'
||
errno
==
ERANGE
)
{
if
(
result
)
*
result
=
0
;
/* suppress compiler warning */
return
false
;
return
false
;
}
if
(
result
)
if
(
result
)
*
result
=
val
;
*
result
=
val
;
return
true
;
return
true
;
...
...
src/interfaces/ecpg/pgtypeslib/datetime.c
View file @
303e089d
...
@@ -334,6 +334,8 @@ PGTYPESdate_defmt_asc(date *d, char *fmt, char *str)
...
@@ -334,6 +334,8 @@ PGTYPESdate_defmt_asc(date *d, char *fmt, char *str)
char
*
str_copy
;
char
*
str_copy
;
struct
tm
tm
;
struct
tm
tm
;
tm
.
tm_year
=
tm
.
tm_mon
=
tm
.
tm_mday
=
0
;
/* keep compiler quiet */
if
(
!
d
||
!
str
||
!
fmt
)
if
(
!
d
||
!
str
||
!
fmt
)
{
{
errno
=
PGTYPES_DATE_ERR_EARGS
;
errno
=
PGTYPES_DATE_ERR_EARGS
;
...
...
src/pl/plpgsql/src/pl_comp.c
View file @
303e089d
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* procedural language
* procedural language
*
*
* IDENTIFICATION
* IDENTIFICATION
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.9
2 2005/07/06 16:42:10
tgl Exp $
* $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.9
3 2005/09/24 22:54:44
tgl Exp $
*
*
* This software is copyrighted by Jan Wieck - Hamburg.
* This software is copyrighted by Jan Wieck - Hamburg.
*
*
...
@@ -1395,24 +1395,22 @@ plpgsql_parse_tripwordtype(char *word)
...
@@ -1395,24 +1395,22 @@ plpgsql_parse_tripwordtype(char *word)
for
(
i
=
0
;
i
<
qualified_att_len
;
i
++
)
for
(
i
=
0
;
i
<
qualified_att_len
;
i
++
)
{
{
if
(
word
[
i
]
==
'.'
&&
++
numdots
==
2
)
if
(
word
[
i
]
==
'.'
&&
++
numdots
==
2
)
{
cp
[
0
]
=
(
char
*
)
palloc
((
i
+
1
)
*
sizeof
(
char
));
memset
(
cp
[
0
],
0
,
(
i
+
1
)
*
sizeof
(
char
));
memcpy
(
cp
[
0
],
word
,
i
*
sizeof
(
char
));
/*
* qualified_att_len - one based position + 1 (null
* terminator)
*/
cp
[
1
]
=
(
char
*
)
palloc
((
qualified_att_len
-
i
)
*
sizeof
(
char
));
memset
(
cp
[
1
],
0
,
(
qualified_att_len
-
i
)
*
sizeof
(
char
));
memcpy
(
cp
[
1
],
&
word
[
i
+
1
],
(
qualified_att_len
-
i
-
1
)
*
sizeof
(
char
));
break
;
break
;
}
}
}
relvar
=
makeRangeVarFromNameList
(
stringToQualifiedNameList
(
cp
[
0
],
"plpgsql_parse_tripwordtype"
));
cp
[
0
]
=
(
char
*
)
palloc
((
i
+
1
)
*
sizeof
(
char
));
memcpy
(
cp
[
0
],
word
,
i
*
sizeof
(
char
));
cp
[
0
][
i
]
=
'\0'
;
/*
* qualified_att_len - one based position + 1 (null terminator)
*/
cp
[
1
]
=
(
char
*
)
palloc
((
qualified_att_len
-
i
)
*
sizeof
(
char
));
memcpy
(
cp
[
1
],
&
word
[
i
+
1
],
(
qualified_att_len
-
i
-
1
)
*
sizeof
(
char
));
cp
[
1
][
qualified_att_len
-
i
-
1
]
=
'\0'
;
relvar
=
makeRangeVarFromNameList
(
stringToQualifiedNameList
(
cp
[
0
],
"plpgsql_parse_tripwordtype"
));
classOid
=
RangeVarGetRelid
(
relvar
,
true
);
classOid
=
RangeVarGetRelid
(
relvar
,
true
);
if
(
!
OidIsValid
(
classOid
))
if
(
!
OidIsValid
(
classOid
))
goto
done
;
goto
done
;
...
...
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