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
f8a6ee59
Commit
f8a6ee59
authored
Nov 14, 2013
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug mdev-5288.
This bug was a consequence of the incorrect fix for bug mdev-5091.
parent
41b05451
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
3 deletions
+29
-3
mysql-test/r/derived_view.result
mysql-test/r/derived_view.result
+14
-1
mysql-test/t/derived_view.test
mysql-test/t/derived_view.test
+14
-1
sql/sql_lex.cc
sql/sql_lex.cc
+1
-1
No files found.
mysql-test/r/derived_view.result
View file @
f8a6ee59
...
...
@@ -2224,7 +2224,7 @@ DROP VIEW v;
DROP TABLE t1,t2;
#
# mdev-5105: memory overwrite in multi-table update
# using natu
a
ral join with a view
# using natural join with a view
#
create table t1(a int,b tinyint,c tinyint)engine=myisam;
create table t2(a tinyint,b float,c int, d int, e int, f int, key (b), key(c), key(d), key(e), key(f))engine=myisam;
...
...
@@ -2234,6 +2234,19 @@ update t3 natural join v1 set a:=1;
drop view v1;
drop table t1,t2,t3;
#
# mdev-5288: assertion failure for query over a view with ORDER BY
#
CREATE TABLE t1 (a int, b int) ENGINE=MyISAM;
INSERT INTO t1 VALUES (4,1);
CREATE ALGORITHM=MERGE VIEW v1 AS SELECT * FROM t1;
EXPLAIN EXTENDED SELECT a FROM v1 WHERE a > 100 ORDER BY b;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE NULL NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
Warnings:
Note 1003 select 4 AS `a` from `test`.`t1` where (4 > 100) order by 1
DROP VIEW v1;
DROP TABLE t1;
#
# end of 5.3 tests
#
set optimizer_switch=@exit_optimizer_switch;
...
...
mysql-test/t/derived_view.test
View file @
f8a6ee59
...
...
@@ -1566,7 +1566,7 @@ DROP TABLE t1,t2;
--
echo
#
--
echo
# mdev-5105: memory overwrite in multi-table update
--
echo
# using natu
a
ral join with a view
--
echo
# using natural join with a view
--
echo
#
create
table
t1
(
a
int
,
b
tinyint
,
c
tinyint
)
engine
=
myisam
;
...
...
@@ -1578,6 +1578,19 @@ update t3 natural join v1 set a:=1;
drop
view
v1
;
drop
table
t1
,
t2
,
t3
;
--
echo
#
--
echo
# mdev-5288: assertion failure for query over a view with ORDER BY
--
echo
#
CREATE
TABLE
t1
(
a
int
,
b
int
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
4
,
1
);
CREATE
ALGORITHM
=
MERGE
VIEW
v1
AS
SELECT
*
FROM
t1
;
EXPLAIN
EXTENDED
SELECT
a
FROM
v1
WHERE
a
>
100
ORDER
BY
b
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# end of 5.3 tests
--
echo
#
...
...
sql/sql_lex.cc
View file @
f8a6ee59
...
...
@@ -3534,7 +3534,7 @@ void SELECT_LEX::update_used_tables()
}
for
(
ORDER
*
order
=
group_list
.
first
;
order
;
order
=
order
->
next
)
(
*
order
->
item
)
->
update_used_tables
();
if
(
master_unit
()
->
global_parameters
!=
this
)
if
(
!
master_unit
()
->
is_union
()
||
master_unit
()
->
global_parameters
!=
this
)
{
for
(
ORDER
*
order
=
order_list
.
first
;
order
;
order
=
order
->
next
)
(
*
order
->
item
)
->
update_used_tables
();
...
...
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