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
cc86a0bd
Commit
cc86a0bd
authored
Jul 11, 2019
by
Oleksandr Byelkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-15572: view.test, server crash with --big-tables=1
Check that table is really opened before cleanup using handler.
parent
1a79a29c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
mysql-test/r/view.result
mysql-test/r/view.result
+15
-0
mysql-test/t/view.test
mysql-test/t/view.test
+20
-0
sql/sql_insert.cc
sql/sql_insert.cc
+5
-1
No files found.
mysql-test/r/view.result
View file @
cc86a0bd
...
...
@@ -5732,6 +5732,21 @@ t37, t38, t39, t40, t41, t42, t43, t44, t45,
t46, t47, t48, t49, t50, t51, t52, t53, t54,
t55, t56, t57, t58, t59,t60;
drop view v60;
#
# MDEV-15572: view.test, server crash with --big-tables=1
#
set @save_big_tables=@@big_tables;
set big_tables=ON;
CREATE TABLE t1 ( f1 int , f2 int , f3 int , f4 int);
CREATE TABLE t2 ( f1 int , f2 int , f3 int , f4 int);
CREATE VIEW v1 AS
SELECT t2.f1, t1.f2, t2.f3, t2.f4 FROM (t1 JOIN t2);
REPLACE INTO v1 (f1, f2, f3, f4)
SELECT f1, f2, f3, f4 FROM t1;
ERROR HY000: Can not modify more than one base table through a join view 'test.v1'
drop view v1;
drop table t1, t2;
set big_tables=@save_big_tables;
# -----------------------------------------------------------------
# -- End of 5.5 tests.
# -----------------------------------------------------------------
...
...
mysql-test/t/view.test
View file @
cc86a0bd
...
...
@@ -5674,6 +5674,26 @@ t46, t47, t48, t49, t50, t51, t52, t53, t54,
t55
,
t56
,
t57
,
t58
,
t59
,
t60
;
drop
view
v60
;
--
echo
#
--
echo
# MDEV-15572: view.test, server crash with --big-tables=1
--
echo
#
set
@
save_big_tables
=@@
big_tables
;
set
big_tables
=
ON
;
CREATE
TABLE
t1
(
f1
int
,
f2
int
,
f3
int
,
f4
int
);
CREATE
TABLE
t2
(
f1
int
,
f2
int
,
f3
int
,
f4
int
);
CREATE
VIEW
v1
AS
SELECT
t2
.
f1
,
t1
.
f2
,
t2
.
f3
,
t2
.
f4
FROM
(
t1
JOIN
t2
);
--
error
ER_VIEW_MULTIUPDATE
REPLACE
INTO
v1
(
f1
,
f2
,
f3
,
f4
)
SELECT
f1
,
f2
,
f3
,
f4
FROM
t1
;
drop
view
v1
;
drop
table
t1
,
t2
;
set
big_tables
=@
save_big_tables
;
--
echo
# -----------------------------------------------------------------
--
echo
# -- End of 5.5 tests.
--
echo
# -----------------------------------------------------------------
...
...
sql/sql_insert.cc
View file @
cc86a0bd
...
...
@@ -3743,8 +3743,12 @@ void select_insert::abort_result_set() {
example), no table will have been opened and therefore 'table'
will be NULL. In that case, we still need to execute the rollback
and the end of the function.
If it fail due to inability to insert in multi-table view for example,
table will be assigned with view table structure, but that table will
not be opened really (it is dummy to check fields types & Co).
*/
if
(
table
)
if
(
table
&&
table
->
file
->
get_table
()
)
{
bool
changed
,
transactional_table
;
/*
...
...
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