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
a3b99778
Commit
a3b99778
authored
Dec 02, 2013
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
5.2 merge
parents
b97b9536
7e431dc3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
19 deletions
+40
-19
mysql-test/r/merge.result
mysql-test/r/merge.result
+7
-0
mysql-test/t/merge.test
mysql-test/t/merge.test
+9
-0
storage/myisammrg/ha_myisammrg.cc
storage/myisammrg/ha_myisammrg.cc
+24
-19
No files found.
mysql-test/r/merge.result
View file @
a3b99778
...
...
@@ -2368,6 +2368,13 @@ FLUSH TABLES;
ERROR HY000: Can't reopen table: 'm1'
UNLOCK TABLES;
DROP TABLE t1, t2, t3, m1;
create temporary table t1_temp(i int);
create temporary table tm_temp_temp (i int) engine=merge union=(t1_temp) insert_method=last;
alter table tm_temp_temp insert_method=first;
check table tm_temp_temp;
Table Op Msg_type Msg_text
test.tm_temp_temp check status OK
drop temporary table t1_temp, tm_temp_temp;
End of 5.1 tests
#
# MDEV-4277: Crash inside mi_killed_in_mariadb() with myisammrg
...
...
mysql-test/t/merge.test
View file @
a3b99778
...
...
@@ -1863,6 +1863,15 @@ FLUSH TABLES;
UNLOCK
TABLES
;
DROP
TABLE
t1
,
t2
,
t3
,
m1
;
#
# MDEV-5266 MySQL:57657 - Temporary MERGE table with temporary underlying is broken by ALTER
#
create
temporary
table
t1_temp
(
i
int
);
create
temporary
table
tm_temp_temp
(
i
int
)
engine
=
merge
union
=
(
t1_temp
)
insert_method
=
last
;
alter
table
tm_temp_temp
insert_method
=
first
;
check
table
tm_temp_temp
;
drop
temporary
table
t1_temp
,
tm_temp_temp
;
--
echo
End
of
5.1
tests
--
echo
#
...
...
storage/myisammrg/ha_myisammrg.cc
View file @
a3b99778
...
...
@@ -1125,31 +1125,36 @@ void ha_myisammrg::update_create_info(HA_CREATE_INFO *create_info)
if
(
!
(
create_info
->
used_fields
&
HA_CREATE_USED_UNION
))
{
MYRG_TABLE
*
open
_table
;
TABLE_LIST
*
child
_table
;
THD
*
thd
=
current_thd
;
create_info
->
merge_list
.
next
=
&
create_info
->
merge_list
.
first
;
create_info
->
merge_list
.
elements
=
0
;
for
(
open_table
=
file
->
open_tables
;
open_table
!=
file
->
end_table
;
open_table
++
)
if
(
table
->
child_l
!=
NULL
)
{
for
(
child_table
=
table
->
child_l
;;
child_table
=
child_table
->
next_global
)
{
TABLE_LIST
*
ptr
;
LEX_STRING
db
,
name
;
LINT_INIT
(
db
.
str
);
if
(
!
(
ptr
=
(
TABLE_LIST
*
)
thd
->
calloc
(
sizeof
(
TABLE_LIST
))))
if
(
!
(
ptr
=
(
TABLE_LIST
*
)
thd
->
calloc
(
sizeof
(
TABLE_LIST
))))
goto
err
;
split_file_name
(
open_table
->
table
->
filename
,
&
db
,
&
name
);
if
(
!
(
ptr
->
table_name
=
thd
->
strmake
(
name
.
str
,
name
.
length
)))
if
(
!
(
ptr
->
table_name
=
thd
->
strmake
(
child_table
->
table_name
,
child_table
->
table_name_length
)))
goto
err
;
if
(
db
.
length
&&
!
(
ptr
->
db
=
thd
->
strmake
(
db
.
str
,
db
.
length
)))
if
(
child_table
->
db
&&
!
(
ptr
->
db
=
thd
->
strmake
(
child_table
->
db
,
child_table
->
db_length
)))
goto
err
;
create_info
->
merge_list
.
elements
++
;
(
*
create_info
->
merge_list
.
next
)
=
ptr
;
(
*
create_info
->
merge_list
.
next
)
=
ptr
;
create_info
->
merge_list
.
next
=
&
ptr
->
next_local
;
if
(
&
child_table
->
next_global
==
table
->
child_last_l
)
break
;
}
}
*
create_info
->
merge_list
.
next
=
0
;
}
...
...
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