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
5591295c
Commit
5591295c
authored
Sep 29, 2010
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
292e1af2
b76277fc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
mysql-test/r/ps.result
mysql-test/r/ps.result
+20
-0
mysql-test/t/ps.test
mysql-test/t/ps.test
+10
-1
sql/sql_prepare.cc
sql/sql_prepare.cc
+4
-0
No files found.
mysql-test/r/ps.result
View file @
5591295c
...
@@ -3005,6 +3005,26 @@ EXECUTE stmt;
...
@@ -3005,6 +3005,26 @@ EXECUTE stmt;
1
1
DEALLOCATE PREPARE stmt;
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
DROP TABLE t1;
#
# Bug#54494 crash with explain extended and prepared statements
#
CREATE TABLE t1(a INT);
INSERT INTO t1 VALUES (1),(2);
PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
EXECUTE stmt;
id select_type table type possible_keys key key_len ref rows filtered Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
Warnings:
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests.
End of 5.1 tests.
...
...
mysql-test/t/ps.test
View file @
5591295c
...
@@ -3079,7 +3079,16 @@ EXECUTE stmt;
...
@@ -3079,7 +3079,16 @@ EXECUTE stmt;
DEALLOCATE
PREPARE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
###########################################################################
--
echo
#
--
echo
# Bug#54494 crash with explain extended and prepared statements
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),(
2
);
PREPARE
stmt
FROM
'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1'
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
--
echo
--
echo
--
echo
End
of
5.1
tests
.
--
echo
End
of
5.1
tests
.
...
...
sql/sql_prepare.cc
View file @
5591295c
...
@@ -2420,11 +2420,15 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
...
@@ -2420,11 +2420,15 @@ void reinit_stmt_before_use(THD *thd, LEX *lex)
sl
->
where
=
sl
->
prep_where
->
copy_andor_structure
(
thd
);
sl
->
where
=
sl
->
prep_where
->
copy_andor_structure
(
thd
);
sl
->
where
->
cleanup
();
sl
->
where
->
cleanup
();
}
}
else
sl
->
where
=
NULL
;
if
(
sl
->
prep_having
)
if
(
sl
->
prep_having
)
{
{
sl
->
having
=
sl
->
prep_having
->
copy_andor_structure
(
thd
);
sl
->
having
=
sl
->
prep_having
->
copy_andor_structure
(
thd
);
sl
->
having
->
cleanup
();
sl
->
having
->
cleanup
();
}
}
else
sl
->
having
=
NULL
;
DBUG_ASSERT
(
sl
->
join
==
0
);
DBUG_ASSERT
(
sl
->
join
==
0
);
ORDER
*
order
;
ORDER
*
order
;
/* Fix GROUP list */
/* Fix GROUP list */
...
...
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