Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
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
nexedi
MariaDB
Commits
4f786b3e
Commit
4f786b3e
authored
Mar 14, 2011
by
Kristofer Pettersson
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
abd2e20b
4185869e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
9 deletions
+46
-9
mysql-test/r/sp.result
mysql-test/r/sp.result
+18
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+22
-0
sql/sql_base.cc
sql/sql_base.cc
+6
-9
No files found.
mysql-test/r/sp.result
View file @
4f786b3e
...
...
@@ -7452,4 +7452,22 @@ c1
# Cleanup
drop table t1;
drop procedure p1;
#
# BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW)
# FAILS IN SET_FIELD_ITERATOR
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
CREATE VIEW v1 AS SELECT a FROM t2;
CREATE PROCEDURE proc() SELECT * FROM t1 NATURAL JOIN v1;
ALTER TABLE t2 CHANGE COLUMN a b CHAR;
CALL proc();
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
CALL proc();
ERROR HY000: View 'test.v1' references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them
DROP TABLE t1,t2;
DROP VIEW v1;
DROP PROCEDURE proc;
# End of 5.5 test
mysql-test/t/sp.test
View file @
4f786b3e
...
...
@@ -8713,4 +8713,26 @@ call p1(3, 2);
drop
table
t1
;
drop
procedure
p1
;
--
echo
#
--
echo
# BUG#11766234: 59299: ASSERT (TABLE_REF->TABLE || TABLE_REF->VIEW)
--
echo
# FAILS IN SET_FIELD_ITERATOR
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
INT
);
CREATE
VIEW
v1
AS
SELECT
a
FROM
t2
;
CREATE
PROCEDURE
proc
()
SELECT
*
FROM
t1
NATURAL
JOIN
v1
;
ALTER
TABLE
t2
CHANGE
COLUMN
a
b
CHAR
;
--
echo
--
error
ER_VIEW_INVALID
CALL
proc
();
--
error
ER_VIEW_INVALID
CALL
proc
();
--
echo
DROP
TABLE
t1
,
t2
;
DROP
VIEW
v1
;
DROP
PROCEDURE
proc
;
--
echo
# End of 5.5 test
sql/sql_base.cc
View file @
4f786b3e
...
...
@@ -7594,9 +7594,10 @@ static bool setup_natural_join_row_types(THD *thd,
List
<
TABLE_LIST
>
*
from_clause
,
Name_resolution_context
*
context
)
{
DBUG_ENTER
(
"setup_natural_join_row_types"
);
thd
->
where
=
"from clause"
;
if
(
from_clause
->
elements
==
0
)
return
FALSE
;
/* We come here in the case of UNIONs. */
DBUG_RETURN
(
false
)
;
/* We come here in the case of UNIONs. */
List_iterator_fast
<
TABLE_LIST
>
table_ref_it
(
*
from_clause
);
TABLE_LIST
*
table_ref
;
/* Current table reference. */
...
...
@@ -7604,10 +7605,6 @@ static bool setup_natural_join_row_types(THD *thd,
TABLE_LIST
*
left_neighbor
;
/* Table reference to the right of the current. */
TABLE_LIST
*
right_neighbor
=
NULL
;
bool
save_first_natural_join_processing
=
context
->
select_lex
->
first_natural_join_processing
;
context
->
select_lex
->
first_natural_join_processing
=
FALSE
;
/* Note that tables in the list are in reversed order */
for
(
left_neighbor
=
table_ref_it
++
;
left_neighbor
;
)
...
...
@@ -7619,12 +7616,11 @@ static bool setup_natural_join_row_types(THD *thd,
1) for stored procedures,
2) for multitable update after lock failure and table reopening.
*/
if
(
save_
first_natural_join_processing
)
if
(
context
->
select_lex
->
first_natural_join_processing
)
{
context
->
select_lex
->
first_natural_join_processing
=
FALSE
;
if
(
store_top_level_join_columns
(
thd
,
table_ref
,
left_neighbor
,
right_neighbor
))
return
TRUE
;
DBUG_RETURN
(
true
)
;
if
(
left_neighbor
)
{
TABLE_LIST
*
first_leaf_on_the_right
;
...
...
@@ -7644,8 +7640,9 @@ static bool setup_natural_join_row_types(THD *thd,
DBUG_ASSERT
(
right_neighbor
);
context
->
first_name_resolution_table
=
right_neighbor
->
first_leaf_for_name_resolution
();
context
->
select_lex
->
first_natural_join_processing
=
false
;
return
FALSE
;
DBUG_RETURN
(
false
)
;
}
...
...
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