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
10a7660f
Commit
10a7660f
authored
May 27, 2006
by
mikael@c-870ae253.1238-1-64736c10.cust.bredbandsbolaget.se
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG#19305: COALESCE partition left partition files undropped
parent
e9056d85
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
5 deletions
+54
-5
mysql-test/r/partition_mgm.result
mysql-test/r/partition_mgm.result
+26
-0
mysql-test/t/partition_mgm.test
mysql-test/t/partition_mgm.test
+15
-0
sql/ha_partition.cc
sql/ha_partition.cc
+6
-0
sql/mysql_priv.h
sql/mysql_priv.h
+1
-0
sql/sql_partition.cc
sql/sql_partition.cc
+6
-5
No files found.
mysql-test/r/partition_mgm.result
0 → 100644
View file @
10a7660f
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (f_date DATE, f_varchar VARCHAR(30))
PARTITION BY HASH(CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 2
/home/pappa/bug19305/mysql-test/var/master-data/test/t1#P#p0.MYD
/home/pappa/bug19305/mysql-test/var/master-data/test/t1#P#p0.MYI
/home/pappa/bug19305/mysql-test/var/master-data/test/t1#P#p1.MYD
/home/pappa/bug19305/mysql-test/var/master-data/test/t1#P#p1.MYI
/home/pappa/bug19305/mysql-test/var/master-data/test/t1.frm
/home/pappa/bug19305/mysql-test/var/master-data/test/t1.par
ALTER TABLE t1 COALESCE PARTITION 1;
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`f_date` date DEFAULT NULL,
`f_varchar` varchar(30) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY HASH (CAST(YEAR(f_date) AS SIGNED INTEGER)) PARTITIONS 1
/home/pappa/bug19305/mysql-test/var/master-data/test/t1#P#p0.MYD
/home/pappa/bug19305/mysql-test/var/master-data/test/t1#P#p0.MYI
/home/pappa/bug19305/mysql-test/var/master-data/test/t1.frm
/home/pappa/bug19305/mysql-test/var/master-data/test/t1.par
mysql-test/t/partition_mgm.test
0 → 100644
View file @
10a7660f
--
disable_warnings
DROP
TABLE
IF
EXISTS
t1
;
--
enable_warnings
CREATE
TABLE
t1
(
f_date
DATE
,
f_varchar
VARCHAR
(
30
))
PARTITION
BY
HASH
(
CAST
(
YEAR
(
f_date
)
AS
SIGNED
INTEGER
))
PARTITIONS
2
;
SHOW
CREATE
TABLE
t1
;
--
exec
ls
$MYSQLTEST_VARDIR
/
master
-
data
/
test
/
t1
*
ALTER
TABLE
t1
COALESCE
PARTITION
1
;
SHOW
CREATE
TABLE
t1
;
--
exec
ls
$MYSQLTEST_VARDIR
/
master
-
data
/
test
/
t1
*
sql/ha_partition.cc
View file @
10a7660f
...
@@ -634,6 +634,8 @@ int ha_partition::drop_partitions(const char *path)
...
@@ -634,6 +634,8 @@ int ha_partition::drop_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Drop subpartition %s"
,
part_name_buff
));
DBUG_PRINT
(
"info"
,
(
"Drop subpartition %s"
,
part_name_buff
));
if
((
ret_error
=
file
->
delete_table
((
const
char
*
)
part_name_buff
)))
if
((
ret_error
=
file
->
delete_table
((
const
char
*
)
part_name_buff
)))
error
=
ret_error
;
error
=
ret_error
;
if
(
deactivate_ddl_log_entry
(
sub_elem
->
log_entry
->
entry_pos
))
error
=
1
;
}
while
(
++
j
<
no_subparts
);
}
while
(
++
j
<
no_subparts
);
}
}
else
else
...
@@ -645,6 +647,8 @@ int ha_partition::drop_partitions(const char *path)
...
@@ -645,6 +647,8 @@ int ha_partition::drop_partitions(const char *path)
DBUG_PRINT
(
"info"
,
(
"Drop partition %s"
,
part_name_buff
));
DBUG_PRINT
(
"info"
,
(
"Drop partition %s"
,
part_name_buff
));
if
((
ret_error
=
file
->
delete_table
((
const
char
*
)
part_name_buff
)))
if
((
ret_error
=
file
->
delete_table
((
const
char
*
)
part_name_buff
)))
error
=
ret_error
;
error
=
ret_error
;
if
(
deactivate_ddl_log_entry
(
part_elem
->
log_entry
->
entry_pos
))
error
=
1
;
}
}
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
)
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
)
part_elem
->
part_state
=
PART_NORMAL
;
part_elem
->
part_state
=
PART_NORMAL
;
...
@@ -652,6 +656,7 @@ int ha_partition::drop_partitions(const char *path)
...
@@ -652,6 +656,7 @@ int ha_partition::drop_partitions(const char *path)
part_elem
->
part_state
=
PART_IS_DROPPED
;
part_elem
->
part_state
=
PART_IS_DROPPED
;
}
}
}
while
(
++
i
<
no_parts
);
}
while
(
++
i
<
no_parts
);
VOID
(
sync_ddl_log
());
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
...
@@ -768,6 +773,7 @@ int ha_partition::rename_partitions(const char *path)
...
@@ -768,6 +773,7 @@ int ha_partition::rename_partitions(const char *path)
*/
*/
part_elem
=
part_it
++
;
part_elem
=
part_it
++
;
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
||
if
(
part_elem
->
part_state
==
PART_IS_CHANGED
||
part_elem
->
part_state
==
PART_TO_BE_DROPPED
||
(
part_elem
->
part_state
==
PART_IS_ADDED
&&
temp_partitions
))
(
part_elem
->
part_state
==
PART_IS_ADDED
&&
temp_partitions
))
{
{
if
(
m_is_sub_partitioned
)
if
(
m_is_sub_partitioned
)
...
...
sql/mysql_priv.h
View file @
10a7660f
...
@@ -1203,6 +1203,7 @@ typedef struct st_lock_param_type
...
@@ -1203,6 +1203,7 @@ typedef struct st_lock_param_type
ulonglong
deleted
;
ulonglong
deleted
;
THD
*
thd
;
THD
*
thd
;
HA_CREATE_INFO
*
create_info
;
HA_CREATE_INFO
*
create_info
;
ALTER_INFO
*
alter_info
;
List
<
create_field
>
*
create_list
;
List
<
create_field
>
*
create_list
;
List
<
create_field
>
new_create_list
;
List
<
create_field
>
new_create_list
;
List
<
Key
>
*
key_list
;
List
<
Key
>
*
key_list
;
...
...
sql/sql_partition.cc
View file @
10a7660f
...
@@ -4968,8 +4968,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
...
@@ -4968,8 +4968,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
*
next_entry
=
log_entry
->
entry_pos
;
*
next_entry
=
log_entry
->
entry_pos
;
if
(
temp_list
)
sub_elem
->
log_entry
=
log_entry
;
sub_elem
->
log_entry
=
log_entry
;
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
}
while
(
++
j
<
no_subparts
);
}
while
(
++
j
<
no_subparts
);
}
}
...
@@ -4987,8 +4986,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
...
@@ -4987,8 +4986,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt,
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
*
next_entry
=
log_entry
->
entry_pos
;
*
next_entry
=
log_entry
->
entry_pos
;
if
(
temp_list
)
part_elem
->
log_entry
=
log_entry
;
part_elem
->
log_entry
=
log_entry
;
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
insert_part_info_log_entry_list
(
part_info
,
log_entry
);
}
}
}
}
...
@@ -5262,7 +5260,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
...
@@ -5262,7 +5260,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt)
lpt
->
table_name
,
"#"
);
lpt
->
table_name
,
"#"
);
pthread_mutex_lock
(
&
LOCK_gdl
);
pthread_mutex_lock
(
&
LOCK_gdl
);
if
(
write_log_dropped_partitions
(
lpt
,
&
next_entry
,
(
const
char
*
)
path
,
if
(
write_log_dropped_partitions
(
lpt
,
&
next_entry
,
(
const
char
*
)
path
,
TRUE
))
lpt
->
alter_info
->
flags
&
ALTER_REORGANIZE_PARTITION
))
goto
error
;
goto
error
;
if
(
write_log_changed_partitions
(
lpt
,
&
next_entry
,
(
const
char
*
)
path
))
if
(
write_log_changed_partitions
(
lpt
,
&
next_entry
,
(
const
char
*
)
path
))
goto
error
;
goto
error
;
...
@@ -5516,6 +5514,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
...
@@ -5516,6 +5514,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
lpt
->
thd
=
thd
;
lpt
->
thd
=
thd
;
lpt
->
part_info
=
part_info
;
lpt
->
part_info
=
part_info
;
lpt
->
alter_info
=
alter_info
;
lpt
->
create_info
=
create_info
;
lpt
->
create_info
=
create_info
;
lpt
->
create_list
=
create_list
;
lpt
->
create_list
=
create_list
;
lpt
->
key_list
=
key_list
;
lpt
->
key_list
=
key_list
;
...
@@ -5818,6 +5817,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
...
@@ -5818,6 +5817,8 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
ERROR_INJECT_CRASH
(
"crash_change_partition_5"
)
||
ERROR_INJECT_CRASH
(
"crash_change_partition_5"
)
||
(
table
->
file
->
extra
(
HA_EXTRA_PREPARE_FOR_DELETE
),
FALSE
)
||
(
table
->
file
->
extra
(
HA_EXTRA_PREPARE_FOR_DELETE
),
FALSE
)
||
ERROR_INJECT_CRASH
(
"crash_change_partition_6"
)
||
ERROR_INJECT_CRASH
(
"crash_change_partition_6"
)
||
mysql_drop_partitions
(
lpt
)
||
ERROR_INJECT_CRASH
(
"crash_change_partition_61"
)
||
mysql_rename_partitions
(
lpt
)
||
mysql_rename_partitions
(
lpt
)
||
((
frm_install
=
TRUE
),
FALSE
)
||
((
frm_install
=
TRUE
),
FALSE
)
||
ERROR_INJECT_CRASH
(
"crash_change_partition_7"
)
||
ERROR_INJECT_CRASH
(
"crash_change_partition_7"
)
||
...
...
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