List:Commits« Previous MessageNext Message »
From:Ashish Agarwal Date:February 2 2012 9:06am
Subject:bzr push into mysql-trunk branch (ashish.y.agarwal:3820 to 3821) Bug#11756869
View as plain text  
 3821 Ashish Agarwal	2012-02-02 [merge]
      BUG#11756869: Merge from mysql-5.5 to mysql-trunk

    modified:
      mysql-test/r/myisam.result
      mysql-test/t/myisam.test
      storage/myisam/mi_check.c
 3820 Hemant Kumar	2012-02-02
      Adding remaining Engine related tests to daily-trunk run.

    modified:
      mysql-test/collections/default.daily
=== modified file 'mysql-test/r/myisam.result'
--- a/mysql-test/r/myisam.result	2011-10-21 05:42:01 +0000
+++ b/mysql-test/r/myisam.result	2012-02-02 09:03:02 +0000
@@ -2442,6 +2442,19 @@ Table	Op	Msg_type	Msg_text
 test.t1	check	status	OK
 DROP TABLE t1;
 SET GLOBAL myisam_use_mmap=default;
+#
+# BUG 11756869 - 48848: MYISAMCHK DOING SORT RECOVER IN CERTAIN
+#                       CASES RESETS DATA POINTER TO SMAL
+#
+CREATE TABLE t1(a INT, KEY(a));
+ALTER TABLE t1 DISABLE KEYS;
+SET @before:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test');
+FLUSH TABLES;
+SET @after:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test');
+SELECT @before=@after;
+@before=@after
+1
+DROP TABLE t1;
 End of 5.1 tests
 #
 # Bug#43600: Incorrect type conversion caused wrong result.

=== modified file 'mysql-test/t/myisam.test'
--- a/mysql-test/t/myisam.test	2011-10-21 05:42:01 +0000
+++ b/mysql-test/t/myisam.test	2012-02-02 09:03:02 +0000
@@ -1665,6 +1665,20 @@ CHECK TABLE t1;
 DROP TABLE t1;
 SET GLOBAL myisam_use_mmap=default;
 
+--echo #
+--echo # BUG 11756869 - 48848: MYISAMCHK DOING SORT RECOVER IN CERTAIN
+--echo #                       CASES RESETS DATA POINTER TO SMAL
+--echo #
+CREATE TABLE t1(a INT, KEY(a));
+ALTER TABLE t1 DISABLE KEYS;
+let $MYSQLD_DATADIR= `select @@datadir`;
+SET @before:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test');
+FLUSH TABLES;
+--replace_result $MYSQLD_DATADIR MYSQLD_DATADIR
+--exec $MYISAMCHK -sn $MYSQLD_DATADIR/test/t1
+SET @after:= (SELECT MAX_DATA_LENGTH FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME='t1' AND TABLE_SCHEMA='test');
+SELECT @before=@after;
+DROP TABLE t1;
 --echo End of 5.1 tests
 
 --echo #

=== modified file 'storage/myisam/mi_check.c'
--- a/storage/myisam/mi_check.c	2011-09-26 12:42:12 +0000
+++ b/storage/myisam/mi_check.c	2012-02-02 09:03:02 +0000
@@ -4303,14 +4303,6 @@ int recreate_table(MI_CHECK *param, MI_I
     u_ptr->seg=keyseg;
     keyseg+=u_ptr->keysegs+1;
   }
-  if (share.options & HA_OPTION_COMPRESS_RECORD)
-    share.base.records=max_records=info.state->records;
-  else if (share.base.min_pack_length)
-    max_records=(ha_rows) (mysql_file_seek(info.dfile, 0L, MY_SEEK_END,
-                                           MYF(0)) /
-			   (ulong) share.base.min_pack_length);
-  else
-    max_records=0;
   unpack= (share.options & HA_OPTION_COMPRESS_RECORD) &&
     (param->testflag & T_UNPACK);
   share.options&= ~HA_OPTION_TEMP_COMPRESS_RECORD;
@@ -4320,10 +4312,17 @@ int recreate_table(MI_CHECK *param, MI_I
   set_if_bigger(file_length,param->max_data_file_length);
   set_if_bigger(file_length,tmp_length);
   set_if_bigger(file_length,(ulonglong) share.base.max_data_file_length);
+ 
+  if (share.options & HA_OPTION_COMPRESS_RECORD)
+    share.base.records= max_records= info.state->records;
+  else if (!(share.options & HA_OPTION_PACK_RECORD))
+    max_records= (ha_rows) (file_length / share.base.pack_reclength);
+  else
+    max_records= 0;
 
   (void) mi_close(*org_info);
   memset(&create_info, 0, sizeof(create_info));
-  create_info.max_rows= MY_MAX(max_records, share.base.records);
+  create_info.max_rows= max_records;
   create_info.reloc_rows=share.base.reloc;
   create_info.old_options=(share.options |
 			   (unpack ? HA_OPTION_TEMP_COMPRESS_RECORD : 0));

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (ashish.y.agarwal:3820 to 3821) Bug#11756869Ashish Agarwal2 Feb