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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0d4aeaf6
Commit
0d4aeaf6
authored
Nov 03, 2008
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merged 5.0 bug 33811 -> 5.1 bug 33811 working tree
parents
c82ff582
6af99825
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
3 deletions
+51
-3
mysql-test/r/sp.result
mysql-test/r/sp.result
+18
-0
mysql-test/t/sp.test
mysql-test/t/sp.test
+17
-1
sql/sql_base.cc
sql/sql_base.cc
+4
-0
sql/sql_select.cc
sql/sql_select.cc
+12
-2
No files found.
mysql-test/r/sp.result
View file @
0d4aeaf6
...
...
@@ -6820,6 +6820,24 @@ ttt
2
drop function func30787;
drop table t1;
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
CREATE PROCEDURE test_sp()
SELECT t1.* FROM t1 RIGHT JOIN t1 t2 ON t1.id=t2.id;
CALL test_sp();
id
1
2
3
4
CALL test_sp();
id
1
2
3
4
DROP PROCEDURE test_sp;
DROP TABLE t1;
create table t1(c1 INT);
create function f1(p1 int) returns varchar(32)
return 'aaa';
...
...
mysql-test/t/sp.test
View file @
0d4aeaf6
...
...
@@ -7997,8 +7997,24 @@ select (select func30787(f1)) as ttt from t1;
drop function func30787;
drop table t1;
###########################################################################
#
# Bug #33811: Call to stored procedure with SELECT * / RIGHT JOIN fails
# after the first time
#
CREATE TABLE t1 (id INT);
INSERT INTO t1 VALUES (1),(2),(3),(4);
CREATE PROCEDURE test_sp()
SELECT t1.* FROM t1 RIGHT JOIN t1 t2 ON t1.id=t2.id;
CALL test_sp();
CALL test_sp();
DROP PROCEDURE test_sp;
DROP TABLE t1;
###########################################################################
#
# Bug#38291 memory corruption and server crash with view/sp/function
#
...
...
sql/sql_base.cc
View file @
0d4aeaf6
...
...
@@ -7768,6 +7768,10 @@ insert_fields(THD *thd, Name_resolution_context *context, const char *db_name,
if
(
!
(
item
=
field_iterator
.
create_item
(
thd
)))
DBUG_RETURN
(
TRUE
);
DBUG_ASSERT
(
item
->
fixed
);
/* cache the table for the Item_fields inserted by expanding stars */
if
(
item
->
type
()
==
Item
::
FIELD_ITEM
&&
tables
->
cacheable_table
)
((
Item_field
*
)
item
)
->
cached_table
=
tables
;
if
(
!
found
)
{
...
...
sql/sql_select.cc
View file @
0d4aeaf6
...
...
@@ -8586,6 +8586,8 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
}
/* Flatten nested joins that can be flattened. */
TABLE_LIST
*
right_neighbor
=
NULL
;
bool
fix_name_res
=
FALSE
;
li
.
rewind
();
while
((
table
=
li
++
))
{
...
...
@@ -8598,9 +8600,17 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
{
tbl
->
embedding
=
table
->
embedding
;
tbl
->
join_list
=
table
->
join_list
;
}
}
li
.
replace
(
nested_join
->
join_list
);
}
/* Need to update the name resolution table chain when flattening joins */
fix_name_res
=
TRUE
;
table
=
*
li
.
ref
();
}
if
(
fix_name_res
)
table
->
next_name_resolution_table
=
right_neighbor
?
right_neighbor
->
first_leaf_for_name_resolution
()
:
NULL
;
right_neighbor
=
table
;
}
DBUG_RETURN
(
conds
);
}
...
...
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