[Commits] bzr commit into Mariadb 5.2, with Maria 2.0:maria/5.2 branch (monty:2870)

Michael Widenius monty at askmonty.org
Tue Sep 28 01:18:08 EEST 2010


#At lp:maria/5.2 based on revid:monty at askmonty.org-20100927184810-dakigonp9jtljyis

 2870 Michael Widenius	2010-09-28
      Move maria_upgrade() out of maria_init() as in standalone programs maria_data_root is not set.
      Fixed failing pbxt test
      modified:
        include/maria.h
        mysql-test/suite/pbxt/r/select.result
        mysql-test/suite/pbxt/t/select.test
        storage/maria/ha_maria.cc
        storage/maria/ma_init.c

per-file messages:
  include/maria.h
    Added maria_upgrade()
  mysql-test/suite/pbxt/r/select.result
    Don't print number of rows as this is not constant over different runs
  mysql-test/suite/pbxt/t/select.test
    Don't print number of rows as this is not constant over different runs
  storage/maria/ha_maria.cc
    Run maria_upgrade() before maria_init()
  storage/maria/ma_init.c
    Move maria_upgrade() out of maria_init() as in standalone programs maria_data_root is not set.
=== modified file 'include/maria.h'
--- a/include/maria.h	2010-09-14 21:06:54 +0000
+++ b/include/maria.h	2010-09-27 22:18:06 +0000
@@ -283,6 +283,7 @@ extern int (*maria_test_invalid_symlink)
 
 extern int maria_init(void);
 extern void maria_end(void);
+extern my_bool maria_upgrade(void);
 extern int maria_close(MARIA_HA *file);
 extern int maria_delete(MARIA_HA *file, const uchar *buff);
 extern MARIA_HA *maria_open(const char *name, int mode,

=== modified file 'mysql-test/suite/pbxt/r/select.result'
--- a/mysql-test/suite/pbxt/r/select.result	2010-05-06 12:43:19 +0000
+++ b/mysql-test/suite/pbxt/r/select.result	2010-09-27 22:18:06 +0000
@@ -3453,8 +3453,8 @@ In next EXPLAIN, B.rows must be exactly
 explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5
 and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);
 id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	A	range	PRIMARY	PRIMARY	12	NULL	1	Using where
-1	SIMPLE	B	ref	PRIMARY	PRIMARY	8	const,test.A.e	1	
+1	SIMPLE	A	range	PRIMARY	PRIMARY	12	NULL	#	Using where
+1	SIMPLE	B	ref	PRIMARY	PRIMARY	8	const,test.A.e	#	
 drop table t1, t2;
 CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b));
 INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2),

=== modified file 'mysql-test/suite/pbxt/t/select.test'
--- a/mysql-test/suite/pbxt/t/select.test	2009-04-02 10:03:14 +0000
+++ b/mysql-test/suite/pbxt/t/select.test	2010-09-27 22:18:06 +0000
@@ -2912,6 +2912,7 @@ insert into t2 select A.a, B.a, C.a, C.a
 analyze table t2;
 select 'In next EXPLAIN, B.rows must be exactly 10:' Z;
 
+--replace_column 9 #
 explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5
           and B.a=5 and B.b=A.e and (B.b =1 or B.b = 3 or B.b=5);
 drop table t1, t2;

=== modified file 'storage/maria/ha_maria.cc'
--- a/storage/maria/ha_maria.cc	2010-09-16 07:58:57 +0000
+++ b/storage/maria/ha_maria.cc	2010-09-27 22:18:06 +0000
@@ -3291,7 +3291,7 @@ static int ha_maria_init(void *p)
   maria_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;
   bzero(maria_log_pagecache, sizeof(*maria_log_pagecache));
   maria_tmpdir= &mysql_tmpdir_list;             /* For REDO */
-  res= maria_init() || ma_control_file_open(TRUE, TRUE) ||
+  res= maria_upgrade() || maria_init() || ma_control_file_open(TRUE, TRUE) ||
     ((force_start_after_recovery_failures != 0) &&
      mark_recovery_start(log_dir)) ||
     !init_pagecache(maria_pagecache,

=== modified file 'storage/maria/ma_init.c'
--- a/storage/maria/ma_init.c	2010-09-27 18:48:10 +0000
+++ b/storage/maria/ma_init.c	2010-09-27 22:18:06 +0000
@@ -22,9 +22,6 @@
 #include "ma_checkpoint.h"
 #include <hash.h>
 
-static my_bool maria_upgrade();
-
-
 void history_state_free(MARIA_STATE_HISTORY_CLOSED *closed_history)
 {
   MARIA_STATE_HISTORY *history, *next;
@@ -68,8 +65,6 @@ int maria_init(void)
               maria_block_size % MARIA_MIN_KEY_BLOCK_LENGTH == 0);
   if (!maria_inited)
   {
-    if (maria_upgrade())
-      return 1;
     maria_inited= TRUE;
     pthread_mutex_init(&THR_LOCK_maria,MY_MUTEX_INIT_SLOW);
     _ma_init_block_record_data();
@@ -130,7 +125,7 @@ void maria_end(void)
 
 */
 
-static my_bool maria_upgrade()
+my_bool maria_upgrade()
 {
   char name[FN_REFLEN], new_name[FN_REFLEN];
   DBUG_ENTER("maria_upgrade");



More information about the commits mailing list