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
bd251400
Commit
bd251400
authored
Apr 17, 2009
by
Anurag Shekhar
Browse files
Options
Browse Files
Download
Plain Diff
merging with local bugfix branch.
parents
abd3f4cc
0501328a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
0 deletions
+43
-0
mysql-test/r/merge.result
mysql-test/r/merge.result
+12
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+21
-0
sql/sql_base.cc
sql/sql_base.cc
+10
-0
No files found.
mysql-test/r/merge.result
View file @
bd251400
...
...
@@ -2115,4 +2115,16 @@ insert into m1 (col1) values (1);
insert into m1 (col1) values (1);
ERROR 23000: Duplicate entry '' for key '*UNKNOWN*'
drop table m1, t1;
CREATE TABLE t1 (
col1 INT(10)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
CREATE VIEW v1 as SELECT * FROM t1;
CREATE TABLE m1 (
col1 INT(10)
)ENGINE=MRG_MyISAM DEFAULT CHARSET=latin1 INSERT_METHOD=LAST UNION=(v1);
#Select should detect that the child table is a view and fail.
SELECT * FROM m1;
ERROR HY000: Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist
DROP VIEW v1;
DROP TABLE m1, t1;
End of 5.1 tests
mysql-test/t/merge.test
View file @
bd251400
...
...
@@ -1514,4 +1514,25 @@ insert into m1 (col1) values (1);
insert
into
m1
(
col1
)
values
(
1
);
drop
table
m1
,
t1
;
#
#Bug #44040 MySQL allows creating a MERGE table upon VIEWs but crashes
#when using it
#
CREATE
TABLE
t1
(
col1
INT
(
10
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
latin1
;
CREATE
VIEW
v1
as
SELECT
*
FROM
t1
;
CREATE
TABLE
m1
(
col1
INT
(
10
)
)
ENGINE
=
MRG_MyISAM
DEFAULT
CHARSET
=
latin1
INSERT_METHOD
=
LAST
UNION
=
(
v1
);
--
echo
#Select should detect that the child table is a view and fail.
--
error
ER_WRONG_MRG_TABLE
SELECT
*
FROM
m1
;
DROP
VIEW
v1
;
DROP
TABLE
m1
,
t1
;
--
echo
End
of
5.1
tests
sql/sql_base.cc
View file @
bd251400
...
...
@@ -3843,6 +3843,16 @@ retry:
if
(
share
->
is_view
)
{
/*
If parent_l of the table_list is non null then a merge table
has this view as child table, which is not supported.
*/
if
(
table_list
->
parent_l
)
{
my_error
(
ER_WRONG_MRG_TABLE
,
MYF
(
0
));
goto
err
;
}
/*
This table is a view. Validate its metadata version: in particular,
that it was a view when the statement was prepared.
...
...
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