summaryrefslogtreecommitdiff
path: root/sql/protocol.cc
diff options
context:
space:
mode:
authorMattias Jonsson <mattiasj@mysql.com>2008-08-11 20:02:03 +0200
committerMattias Jonsson <mattiasj@mysql.com>2008-08-11 20:02:03 +0200
commit07e9a6dc2a4a6839c874204e660d4981a33bad85 (patch)
treec00c7e35f215af74686a611f330d4e857c28faad /sql/protocol.cc
parent44a162597f8107974da7a0ebe33eaf9089fe1a2e (diff)
downloadmariadb-git-07e9a6dc2a4a6839c874204e660d4981a33bad85.tar.gz
Bug#20129: ALTER TABLE ... REPAIR PARTITION ... complains that
partition is corrupt The main problem was that ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION took another code path (over mysql_alter_table instead of mysql_admin_table) which differs in two ways: 1) alter table opens the tables in a different way than admin tables do resulting in returning with error before it tried the command 2) alter table does not start to send any diagnostic rows to the client which the lower admin functions continue to use -> resulting in assertion crash The fix: Remapped ALTER TABLE t ANALYZE/CHECK/OPTIMIZE/REPAIR PARTITION to use the same code path as ANALYZE/CHECK/OPTIMIZE/REPAIR TABLE t. Adding check in mysql_admin_table to setup the partition list for which partitions that should be used. Partitioned tables will still not work with REPAIR TABLE/PARTITION USE_FRM, since that requires moving partitions to tables, REPAIR TABLE t USE_FRM, and check that the data still fulfills the partitioning function and then move the table back to being a partition. NOTE: I have removed the following functions from the handler interface: analyze_partitions, check_partitions, optimize_partitions, repair_partitions Since they are not longer needed. THIS ALTERS THE STORAGE ENGINE API
Diffstat (limited to 'sql/protocol.cc')
-rw-r--r--sql/protocol.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/protocol.cc b/sql/protocol.cc
index 5fe56724d08..4177cd0054d 100644
--- a/sql/protocol.cc
+++ b/sql/protocol.cc
@@ -788,6 +788,9 @@ bool Protocol_text::store(const char *from, size_t length,
{
CHARSET_INFO *tocs= this->thd->variables.character_set_results;
#ifndef DBUG_OFF
+ DBUG_PRINT("info", ("Protocol_text::store field %u (%u): %s", field_pos,
+ field_count, from));
+ DBUG_ASSERT(field_pos < field_count);
DBUG_ASSERT(field_types == 0 ||
field_types[field_pos] == MYSQL_TYPE_DECIMAL ||
field_types[field_pos] == MYSQL_TYPE_BIT ||