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
2ea370a3
Commit
2ea370a3
authored
Jun 03, 2000
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New warning code about auto-created range table entries.
parent
58785757
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
18 deletions
+33
-18
src/backend/parser/parse_func.c
src/backend/parser/parse_func.c
+3
-11
src/backend/parser/parse_relation.c
src/backend/parser/parse_relation.c
+25
-6
src/include/parser/parse_relation.h
src/include/parser/parse_relation.h
+2
-1
src/test/regress/expected/select_into.out
src/test/regress/expected/select_into.out
+3
-0
No files found.
src/backend/parser/parse_func.c
View file @
2ea370a3
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.8
1 2000/05/30 00:49:50
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_func.c,v 1.8
2 2000/06/03 04:41:32
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -307,11 +307,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
rte
=
addRangeTableEntry
(
pstate
,
refname
,
makeAttr
(
refname
,
NULL
),
FALSE
,
FALSE
,
TRUE
);
#ifdef WARN_FROM
elog
(
NOTICE
,
"Adding missing FROM-clause entry%s for table %s"
,
pstate
->
parentParseState
!=
NULL
?
" in subquery"
:
""
,
refname
);
#endif
warnAutoRange
(
pstate
,
refname
);
}
relname
=
rte
->
relname
;
...
...
@@ -525,11 +521,7 @@ ParseFuncOrColumn(ParseState *pstate, char *funcname, List *fargs,
rte
=
addRangeTableEntry
(
pstate
,
refname
,
makeAttr
(
refname
,
NULL
),
FALSE
,
FALSE
,
TRUE
);
#ifdef WARN_FROM
elog
(
NOTICE
,
"Adding missing FROM-clause entry%s for table %s"
,
pstate
->
parentParseState
!=
NULL
?
" in subquery"
:
""
,
refname
);
#endif
warnAutoRange
(
pstate
,
refname
);
}
relname
=
rte
->
relname
;
...
...
src/backend/parser/parse_relation.c
View file @
2ea370a3
...
...
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.4
0 2000/04/12 17:15:27
momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/parse_relation.c,v 1.4
1 2000/06/03 04:41:32
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -373,11 +373,7 @@ expandAll(ParseState *pstate, char *relname, Attr *ref, int *this_resno)
{
rte
=
addRangeTableEntry
(
pstate
,
relname
,
ref
,
FALSE
,
FALSE
,
TRUE
);
#ifdef WARN_FROM
elog
(
NOTICE
,
"Adding missing FROM-clause entry%s for table %s"
,
pstate
->
parentParseState
!=
NULL
?
" in subquery"
:
""
,
refname
);
#endif
warnAutoRange
(
pstate
,
ref
->
relname
);
}
rel
=
heap_open
(
rte
->
relid
,
AccessShareLock
);
...
...
@@ -526,3 +522,26 @@ attnumTypeId(Relation rd, int attid)
*/
return
rd
->
rd_att
->
attrs
[
attid
-
1
]
->
atttypid
;
}
void
warnAutoRange
(
ParseState
*
pstate
,
char
*
refname
)
{
List
*
temp
;
bool
foundInFromCl
=
false
;
foreach
(
temp
,
pstate
->
p_rtable
)
{
RangeTblEntry
*
rte
=
lfirst
(
temp
);
if
(
rte
->
inFromCl
)
{
foundInFromCl
=
true
;
break
;
}
}
if
(
foundInFromCl
)
elog
(
NOTICE
,
"Adding missing FROM-clause entry%s for table %s"
,
pstate
->
parentParseState
!=
NULL
?
" in subquery"
:
""
,
refname
);
}
src/include/parser/parse_relation.h
View file @
2ea370a3
...
...
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parse_relation.h,v 1.1
6 2000/04/12 17:16:45
momjian Exp $
* $Id: parse_relation.h,v 1.1
7 2000/06/03 04:41:33
momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -35,5 +35,6 @@ extern int specialAttNum(char *a);
extern
bool
attnameIsSet
(
Relation
rd
,
char
*
name
);
extern
int
attnumAttNelems
(
Relation
rd
,
int
attid
);
extern
Oid
attnumTypeId
(
Relation
rd
,
int
attid
);
extern
void
warnAutoRange
(
ParseState
*
pstate
,
char
*
refname
);
#endif
/* PARSE_RELATION_H */
src/test/regress/expected/select_into.out
View file @
2ea370a3
...
...
@@ -5,9 +5,12 @@ SELECT *
INTO TABLE tmp1
FROM tmp
WHERE onek.unique1 < 2;
NOTICE: Adding missing FROM-clause entry for table onek
DROP TABLE tmp1;
SELECT *
INTO TABLE tmp1
FROM tmp
WHERE onek2.unique1 < 2;
DROP TABLE tmp1;
NOTICE: Adding missing FROM-clause entry for table onek
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