summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <istruewing@chilla.local>2007-03-28 10:20:46 +0200
committerunknown <istruewing@chilla.local>2007-03-28 10:20:46 +0200
commita7573962e3e5dfb36ae53f6305662ff6e93954b8 (patch)
tree5a415e0aeafeabfb73038e7ef7fb46ffdeac1c82 /sql
parent27f8c357602f6e1ac9a80da9c2645245f43f2f25 (diff)
parentc4b440aaf0838342b05e2ee16079f10ce11ee5e3 (diff)
downloadmariadb-git-a7573962e3e5dfb36ae53f6305662ff6e93954b8.tar.gz
Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into chilla.local:/home/mydev/mysql-5.0-axmrg
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_heap.cc5
-rw-r--r--sql/ha_myisam.cc16
2 files changed, 20 insertions, 1 deletions
diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc
index d1a931b07f2..8838aa99c1a 100644
--- a/sql/ha_heap.cc
+++ b/sql/ha_heap.cc
@@ -604,7 +604,10 @@ int ha_heap::create(const char *name, TABLE *table_arg,
seg->length= (uint) key_part->length;
seg->flag= key_part->key_part_flag;
- seg->charset= field->charset();
+ if (field->flags & (ENUM_FLAG | SET_FLAG))
+ seg->charset= &my_charset_bin;
+ else
+ seg->charset= field->charset();
if (field->null_ptr)
{
seg->null_bit= field->null_bit;
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 10d3dbb2ec5..6d8a770175d 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -976,6 +976,22 @@ int ha_myisam::repair(THD *thd, MI_CHECK &param, bool do_optimize)
ha_rows rows= file->state->records;
DBUG_ENTER("ha_myisam::repair");
+ /*
+ Normally this method is entered with a properly opened table. If the
+ repair fails, it can be repeated with more elaborate options. Under
+ special circumstances it can happen that a repair fails so that it
+ closed the data file and cannot re-open it. In this case file->dfile
+ is set to -1. We must not try another repair without an open data
+ file. (Bug #25289)
+ */
+ if (file->dfile == -1)
+ {
+ sql_print_information("Retrying repair of: '%s' failed. "
+ "Please try REPAIR EXTENDED or myisamchk",
+ table->s->path);
+ DBUG_RETURN(HA_ADMIN_FAILED);
+ }
+
param.db_name= table->s->db;
param.table_name= table->alias;
param.tmpfile_createflag = O_RDWR | O_TRUNC;