[Commits] bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2924)

Michael Widenius monty at askmonty.org
Tue Sep 7 19:58:42 EEST 2010


#At lp:maria based on revid:monty at askmonty.org-20100907105934-acgge7jjznwnqcz5

 2924 Michael Widenius	2010-09-07
      Fixed recovery bug where bitmap pages would not be correctly updated after processing UNDO rows.
      Fixed test failures in buildbot
      Don't write errors when failing to send ok packet
      modified:
        mysql-test/suite/pbxt/r/range.result
        mysql-test/suite/pbxt/t/range.test
        sql/mysqld.cc
        storage/maria/ma_bitmap.c
        storage/maria/ma_blockrec.c

per-file messages:
  mysql-test/suite/pbxt/r/range.result
    Don't write number of rows as it varies.
  mysql-test/suite/pbxt/t/range.test
    Don't write number of rows as it varies.
  sql/mysqld.cc
    Don't write errors when failing to send ok packet
  storage/maria/ma_bitmap.c
    Added DBUG_ASSERT to detect wrong bitmap pages
  storage/maria/ma_blockrec.c
    Don't reset BLOCKUSED_USE_ORG_BITMAP flag. This fixed a bug where bitmap could be wrong after UNDO of row with blobs
=== modified file 'mysql-test/suite/pbxt/r/range.result'
--- a/mysql-test/suite/pbxt/r/range.result	2010-08-10 16:06:34 +0000
+++ b/mysql-test/suite/pbxt/r/range.result	2010-09-07 16:58:39 +0000
@@ -422,20 +422,20 @@ test.t1	analyze	status	OK
 test.t2	analyze	status	OK
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t1.uid > 0;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	1	Using where
-1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	1	
+1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	#	Using where
+1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	#	
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t2.uid > 0;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	1	Using where
-1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	1	
+1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	#	Using where
+1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	#	
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t1.uid != 0;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	2	Using where
-1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	1	
+1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	#	Using where
+1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	#	
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t2.uid != 0;
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	2	Using where
-1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	1	
+1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	#	Using where
+1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	#	
 select * from t1, t2  where t1.uid=t2.uid AND t1.uid > 0;
 id	name	uid	id	name	uid
 1001	A	1	1001	A	1

=== modified file 'mysql-test/suite/pbxt/t/range.test'
--- a/mysql-test/suite/pbxt/t/range.test	2010-08-10 16:06:34 +0000
+++ b/mysql-test/suite/pbxt/t/range.test	2010-09-07 16:58:39 +0000
@@ -383,9 +383,14 @@ analyze table t1,t2;
 # This part doesn't make sense for pbxt as the result may vary becasue
 # records_in_range() gives same results for t1 and t2.
 # Added straight_join to get predictable results
+
+--replace_column 9 #
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t1.uid > 0;
+--replace_column 9 #
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t2.uid > 0;
+--replace_column 9 #
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t1.uid != 0;
+--replace_column 9 #
 explain select straight_join * from t1, t2  where t1.uid=t2.uid AND t2.uid != 0;
 
 select * from t1, t2  where t1.uid=t2.uid AND t1.uid > 0;

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2010-09-05 23:25:44 +0000
+++ b/sql/mysqld.cc	2010-09-07 16:58:39 +0000
@@ -3070,10 +3070,11 @@ int my_message_sql(uint error, const cha
     }
     else
     {
-      if (thd->main_da.is_ok())
+      if (thd->main_da.is_ok() && !thd->main_da.can_overwrite_status)
       {
         /*
-          Client has already got ok packet; Write message to error log.
+          Client has already got ok packet and we are not in net_flush(), so
+          we write a message to error log.
           This could happen if we get an error in implicit commit.
           This should never happen in normal operation, so lets
           assert here in debug builds.

=== modified file 'storage/maria/ma_bitmap.c'
--- a/storage/maria/ma_bitmap.c	2010-08-23 09:52:57 +0000
+++ b/storage/maria/ma_bitmap.c	2010-09-07 16:58:39 +0000
@@ -1875,6 +1875,7 @@ static my_bool set_page_bits(MARIA_HA *i
   uint offset_page, offset, tmp, org_tmp;
   uchar *data;
   DBUG_ENTER("set_page_bits");
+  DBUG_ASSERT(fill_pattern <= 7);
 
   bitmap_page= page - page % bitmap->pages_covered;
   if (bitmap_page != bitmap->page &&
@@ -2296,9 +2297,16 @@ my_bool _ma_bitmap_release_unused(MARIA_
         The page has all bits set; The following test is an optimization
         to not set the bits to the same value as before.
       */
-      if (bits != current_bitmap_value &&
-          set_page_bits(info, bitmap, block->page, bits))
-        goto err;
+      if (bits != current_bitmap_value)
+      {
+        if (set_page_bits(info, bitmap, block->page, bits))
+          goto err;
+      }
+      else
+      {
+        DBUG_ASSERT(current_bitmap_value ==
+                    _ma_bitmap_get_page_bits(info, bitmap, block->page));
+      }
     }
     else if (!(block->used & BLOCKUSED_USED) &&
              _ma_bitmap_reset_full_page_bits(info, bitmap,

=== modified file 'storage/maria/ma_blockrec.c'
--- a/storage/maria/ma_blockrec.c	2010-08-24 17:17:17 +0000
+++ b/storage/maria/ma_blockrec.c	2010-09-07 16:58:39 +0000
@@ -1990,7 +1990,8 @@ static my_bool write_tail(MARIA_HA *info
   block->empty_space= (enough_free_entries(row_pos.buff, share->block_size,
                                            1 + share->base.blobs) ?
                        empty_space : 0);
-  block->used= BLOCKUSED_USED | BLOCKUSED_TAIL;
+  /* Keep BLOCKUSED_USE_ORG_BITMAP */
+  block->used|= BLOCKUSED_USED | BLOCKUSED_TAIL;
 
   /* Increase data file size, if extended */
   position= (my_off_t) block->page * block_size;



More information about the commits mailing list