[Commits] Rev 2907: merge with 5.1 in lp:maria/5.2

Michael Widenius monty at askmonty.org
Fri Jan 7 18:07:30 EET 2011


At lp:maria/5.2

------------------------------------------------------------
revno: 2907 [merge]
revision-id: monty at askmonty.org-20110107160722-sip4hgzk0092drd8
parent: monty at askmonty.org-20110107114559-6fvrq3vyu9qjq6jg
parent: monty at askmonty.org-20110107155812-hqg2lq79ay4gskfb
committer: Michael Widenius <monty at askmonty.org>
branch nick: maria-5.2
timestamp: Fri 2011-01-07 18:07:22 +0200
message:
  merge with 5.1
modified:
  scripts/mysql_convert_table_format.sh sp1f-mysql_convert_table_-19700101030959-zspxf5zlxepnb55bflai7zse73yph2zh
  storage/maria/ha_maria.cc      sp1f-ha_maria.cc-20060411134405-dmngb4v5x5fxlxhff527ud3etiutxuxk
  storage/maria/ma_check.c       sp1f-ma_check.c-20060411134408-m5d5jao4sr32xsjjkig2uhdndqm5cgba
  storage/maria/ma_sort.c        sp1f-ma_sort.c-20060411134442-cgxklkm2tqazbdc57w5xhs3qxbdcjpmh
-------------- next part --------------
=== modified file 'scripts/mysql_convert_table_format.sh'
--- a/scripts/mysql_convert_table_format.sh	2009-04-28 18:47:34 +0000
+++ b/scripts/mysql_convert_table_format.sh	2011-01-07 15:58:12 +0000
@@ -28,7 +28,7 @@ $opt_port=0;
 $exit_status=0;
 
 GetOptions(
-  "e|engine|type=s"       => \$opt_type,
+  "e|engine|type=s"       => \$opt_engine,
   "f|force"               => \$opt_force,
   "help|?"               => \$opt_help,
   "h|host=s"              => \$opt_host,

=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc	2011-01-07 10:17:34 +0000
+++ b/storage/maria/ha_maria.cc	2011-01-07 16:07:22 +0000
@@ -2058,6 +2058,7 @@ bool ha_maria::check_and_repair(THD *thd
   DBUG_ENTER("ha_maria::check_and_repair");
 
   check_opt.init();
+  check_opt.flags= T_MEDIUM | T_AUTO_REPAIR;
 
   error= 1;
   if ((file->s->state.changed &
@@ -2078,7 +2079,6 @@ bool ha_maria::check_and_repair(THD *thd
     DBUG_RETURN(error);
 
   error= 0;
-  check_opt.flags= T_MEDIUM | T_AUTO_REPAIR;
   // Don't use quick if deleted rows
   if (!file->state->del && (maria_recover_options & HA_RECOVER_QUICK))
     check_opt.flags |= T_QUICK;

=== modified file 'storage/maria/ma_check.c'
--- a/storage/maria/ma_check.c	2011-01-07 10:05:46 +0000
+++ b/storage/maria/ma_check.c	2011-01-07 16:07:22 +0000
@@ -2630,6 +2630,7 @@ int maria_repair(HA_CHECK *param, regist
 
   maria_lock_memory(param);                     /* Everything is alloced */
 
+  sort_param.sort_info->info->in_check_table= 1;
   /* Re-create all keys, which are set in key_map. */
   while (!(error=sort_get_next_record(&sort_param)))
   {
@@ -2797,6 +2798,7 @@ int maria_repair(HA_CHECK *param, regist
   VOID(end_io_cache(&sort_info.new_info->rec_cache));
   info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
   sort_info.new_info->opt_flag&= ~(READ_CACHE_USED | WRITE_CACHE_USED);
+  sort_param.sort_info->info->in_check_table= 0;
   /* this below could fail, shouldn't we detect error? */
   if (got_error)
   {
@@ -3247,6 +3249,7 @@ static my_bool maria_zerofill_index(HA_C
   uint block_size= share->block_size;
   my_bool zero_lsn= (share->base.born_transactional &&
                      !(param->testflag & T_ZEROFILL_KEEP_LSN));
+  int error= 1;
   DBUG_ENTER("maria_zerofill_index");
 
   if (!(param->testflag & T_SILENT))
@@ -3271,7 +3274,7 @@ static my_bool maria_zerofill_index(HA_C
       _ma_check_print_error(param,
                             "Page %9s: Got error %d when reading index file",
                             llstr(pos, llbuff), my_errno);
-      DBUG_RETURN(1);
+      goto end;
     }
     if (zero_lsn)
       bzero(buff, LSN_SIZE);
@@ -3279,7 +3282,7 @@ static my_bool maria_zerofill_index(HA_C
     if (share->base.born_transactional)
     {
       uint keynr= _ma_get_keynr(share, buff);
-      if (keynr != MARIA_DELETE_KEY_NR)
+      if (keynr < share->base.keys)
       {
         MARIA_PAGE page;
         DBUG_ASSERT(keynr < share->base.keys);
@@ -3291,7 +3294,7 @@ static my_bool maria_zerofill_index(HA_C
                                 "Page %9s: Got error %d when reading index "
                                 "file",
                                 llstr(pos, llbuff), my_errno);
-          DBUG_RETURN(1);
+          goto end;
         }
       }
     }
@@ -3305,10 +3308,13 @@ static my_bool maria_zerofill_index(HA_C
                              PAGECACHE_UNPIN, LSN_IMPOSSIBLE,
                              LSN_IMPOSSIBLE, 1, FALSE);
   }
+  error= 0;                                     /* ok */
+
+end:
   if (flush_pagecache_blocks(share->pagecache, &share->kfile,
                              FLUSH_FORCE_WRITE))
     DBUG_RETURN(1);
-  DBUG_RETURN(0);
+  DBUG_RETURN(error);
 }
 
 
@@ -4768,7 +4774,7 @@ static int sort_get_next_record(MARIA_SO
         DBUG_RETURN(-1);
       }
       /* Retry only if wrong record, not if disk error */
-      if (flag != HA_ERR_WRONG_IN_RECORD)
+      if (flag != HA_ERR_WRONG_IN_RECORD && flag != HA_ERR_WRONG_CRC)
       {
         retry_if_quick(sort_param, flag);
         DBUG_RETURN(flag);
@@ -6458,6 +6464,9 @@ static void change_data_file_descriptor(
 
 static void unuse_data_file_descriptor(MARIA_HA *info)
 {
+  (void) flush_pagecache_blocks(info->s->pagecache,
+                                &info->s->bitmap.file,
+                                FLUSH_IGNORE_CHANGED);
   info->dfile.file= info->s->bitmap.file.file= -1;
   _ma_bitmap_reset_cache(info->s);
 }

=== modified file 'storage/maria/ma_sort.c'
--- a/storage/maria/ma_sort.c	2010-09-12 16:40:01 +0000
+++ b/storage/maria/ma_sort.c	2011-01-07 16:07:22 +0000
@@ -275,12 +275,13 @@ static ha_rows find_all_keys(MARIA_SORT_
   idx=error=0;
   sort_keys[0]= (uchar*) (sort_keys+keys);
 
+  info->sort_info->info->in_check_table= 1;
   while (!(error=(*info->key_read)(info,sort_keys[idx])))
   {
     if (info->real_key_length > info->key_length)
     {
       if (write_key(info,sort_keys[idx],tempfile_for_exceptions))
-        DBUG_RETURN(HA_POS_ERROR);              /* purecov: inspected */
+        goto err;                             /* purecov: inspected */
       continue;
     }
 
@@ -289,7 +290,7 @@ static ha_rows find_all_keys(MARIA_SORT_
       if (info->write_keys(info,sort_keys,idx-1,
                            (BUFFPEK *)alloc_dynamic(buffpek),
                            tempfile))
-      DBUG_RETURN(HA_POS_ERROR);                /* purecov: inspected */
+        goto err;                             /* purecov: inspected */
 
       sort_keys[0]=(uchar*) (sort_keys+keys);
       memcpy(sort_keys[0],sort_keys[idx-1],(size_t) info->key_length);
@@ -298,18 +299,23 @@ static ha_rows find_all_keys(MARIA_SORT_
     sort_keys[idx]=sort_keys[idx-1]+info->key_length;
   }
   if (error > 0)
-    DBUG_RETURN(HA_POS_ERROR);          /* Aborted by get_key */ /* purecov: inspected */
+    goto err;                             /* purecov: inspected */
   if (buffpek->elements)
   {
     if (info->write_keys(info,sort_keys,idx,(BUFFPEK *)alloc_dynamic(buffpek),
                          tempfile))
-      DBUG_RETURN(HA_POS_ERROR);                /* purecov: inspected */
+      goto err;                         /* purecov: inspected */      
     *maxbuffer=buffpek->elements-1;
   }
   else
     *maxbuffer=0;
 
+  info->sort_info->info->in_check_table= 0;
   DBUG_RETURN((*maxbuffer)*(keys-1)+idx);
+
+err:
+  info->sort_info->info->in_check_table= 0;   /* purecov: inspected */
+  DBUG_RETURN(HA_POS_ERROR);                  /* purecov: inspected */
 } /* find_all_keys */
 
 



More information about the commits mailing list