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
f202f3df
Commit
f202f3df
authored
Apr 16, 2019
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-19263: Server crashes in mysql_handle_single_derived upon 2nd execution of PS
Fix case of prelocking placeholder
parent
653a56fd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
1 deletion
+46
-1
mysql-test/main/ps.result
mysql-test/main/ps.result
+18
-0
mysql-test/main/ps.test
mysql-test/main/ps.test
+24
-0
sql/sql_derived.cc
sql/sql_derived.cc
+4
-1
No files found.
mysql-test/main/ps.result
View file @
f202f3df
...
...
@@ -5388,3 +5388,21 @@ drop table t1;
#
# End of 10.2 tests
#
#
# MDEV-19263: Server crashes in mysql_handle_single_derived
# upon 2nd execution of PS
#
CREATE TABLE t1 (f INT);
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE TRIGGER tr BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO v1 SELECT * FROM x;
PREPARE stmt FROM "INSERT INTO v1 VALUES (1)";
EXECUTE stmt;
ERROR 42S02: Table 'test.x' doesn't exist
EXECUTE stmt;
ERROR 42S02: Table 'test.x' doesn't exist
DEALLOCATE PREPARE stmt;
DROP VIEW v1;
DROP TABLE t1;
#
# End of 10.4 tests
#
mysql-test/main/ps.test
View file @
f202f3df
...
...
@@ -4825,3 +4825,27 @@ drop table t1;
--
echo
#
--
echo
# End of 10.2 tests
--
echo
#
--
echo
#
--
echo
# MDEV-19263: Server crashes in mysql_handle_single_derived
--
echo
# upon 2nd execution of PS
--
echo
#
CREATE
TABLE
t1
(
f
INT
);
CREATE
VIEW
v1
AS
SELECT
*
FROM
t1
;
CREATE
TRIGGER
tr
BEFORE
INSERT
ON
t1
FOR
EACH
ROW
INSERT
INTO
v1
SELECT
*
FROM
x
;
PREPARE
stmt
FROM
"INSERT INTO v1 VALUES (1)"
;
--
error
ER_NO_SUCH_TABLE
EXECUTE
stmt
;
--
error
ER_NO_SUCH_TABLE
EXECUTE
stmt
;
# Cleanup
DEALLOCATE
PREPARE
stmt
;
DROP
VIEW
v1
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# End of 10.4 tests
--
echo
#
sql/sql_derived.cc
View file @
f202f3df
...
...
@@ -183,7 +183,10 @@ mysql_handle_single_derived(LEX *lex, TABLE_LIST *derived, uint phases)
if
(
!
lex
->
derived_tables
)
DBUG_RETURN
(
FALSE
);
derived
->
select_lex
->
changed_elements
|=
TOUCHED_SEL_DERIVED
;
if
(
derived
->
select_lex
)
derived
->
select_lex
->
changed_elements
|=
TOUCHED_SEL_DERIVED
;
else
DBUG_ASSERT
(
derived
->
prelocking_placeholder
);
lex
->
thd
->
derived_tables_processing
=
TRUE
;
for
(
uint
phase
=
0
;
phase
<
DT_PHASES
;
phase
++
)
...
...
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