Commit f715c9c2 authored by Michael Widenius's avatar Michael Widenius

Move maria_upgrade() out of maria_init() as in standalone programs maria_data_root is not set.

Fixed failing pbxt test


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.
parent 0df17892
...@@ -283,6 +283,7 @@ extern int (*maria_test_invalid_symlink)(const char *filename); ...@@ -283,6 +283,7 @@ extern int (*maria_test_invalid_symlink)(const char *filename);
extern int maria_init(void); extern int maria_init(void);
extern void maria_end(void); extern void maria_end(void);
extern my_bool maria_upgrade(void);
extern int maria_close(MARIA_HA *file); extern int maria_close(MARIA_HA *file);
extern int maria_delete(MARIA_HA *file, const uchar *buff); extern int maria_delete(MARIA_HA *file, const uchar *buff);
extern MARIA_HA *maria_open(const char *name, int mode, extern MARIA_HA *maria_open(const char *name, int mode,
......
...@@ -3453,8 +3453,8 @@ In next EXPLAIN, B.rows must be exactly 10: ...@@ -3453,8 +3453,8 @@ In next EXPLAIN, B.rows must be exactly 10:
explain select * from t2 A, t2 B where A.a=5 and A.b=5 and A.C<5 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); 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 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 A range PRIMARY PRIMARY 12 NULL # Using where
1 SIMPLE B ref PRIMARY PRIMARY 8 const,test.A.e 1 1 SIMPLE B ref PRIMARY PRIMARY 8 const,test.A.e #
drop table t1, t2; drop table t1, t2;
CREATE TABLE t1 (a int PRIMARY KEY, b int, INDEX(b)); 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), INSERT INTO t1 VALUES (1, 3), (9,4), (7,5), (4,5), (6,2),
......
...@@ -2912,6 +2912,7 @@ insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C; ...@@ -2912,6 +2912,7 @@ insert into t2 select A.a, B.a, C.a, C.a from t1 A, t1 B, t1 C;
analyze table t2; analyze table t2;
select 'In next EXPLAIN, B.rows must be exactly 10:' Z; 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 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); 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; drop table t1, t2;
......
...@@ -3291,7 +3291,7 @@ static int ha_maria_init(void *p) ...@@ -3291,7 +3291,7 @@ static int ha_maria_init(void *p)
maria_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES; maria_hton->flags= HTON_CAN_RECREATE | HTON_SUPPORT_LOG_TABLES;
bzero(maria_log_pagecache, sizeof(*maria_log_pagecache)); bzero(maria_log_pagecache, sizeof(*maria_log_pagecache));
maria_tmpdir= &mysql_tmpdir_list; /* For REDO */ 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) && ((force_start_after_recovery_failures != 0) &&
mark_recovery_start(log_dir)) || mark_recovery_start(log_dir)) ||
!init_pagecache(maria_pagecache, !init_pagecache(maria_pagecache,
......
...@@ -22,9 +22,6 @@ ...@@ -22,9 +22,6 @@
#include "ma_checkpoint.h" #include "ma_checkpoint.h"
#include <hash.h> #include <hash.h>
static my_bool maria_upgrade();
void history_state_free(MARIA_STATE_HISTORY_CLOSED *closed_history) void history_state_free(MARIA_STATE_HISTORY_CLOSED *closed_history)
{ {
MARIA_STATE_HISTORY *history, *next; MARIA_STATE_HISTORY *history, *next;
...@@ -68,8 +65,6 @@ int maria_init(void) ...@@ -68,8 +65,6 @@ int maria_init(void)
maria_block_size % MARIA_MIN_KEY_BLOCK_LENGTH == 0); maria_block_size % MARIA_MIN_KEY_BLOCK_LENGTH == 0);
if (!maria_inited) if (!maria_inited)
{ {
if (maria_upgrade())
return 1;
maria_inited= TRUE; maria_inited= TRUE;
pthread_mutex_init(&THR_LOCK_maria,MY_MUTEX_INIT_SLOW); pthread_mutex_init(&THR_LOCK_maria,MY_MUTEX_INIT_SLOW);
_ma_init_block_record_data(); _ma_init_block_record_data();
...@@ -130,7 +125,7 @@ void maria_end(void) ...@@ -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]; char name[FN_REFLEN], new_name[FN_REFLEN];
DBUG_ENTER("maria_upgrade"); DBUG_ENTER("maria_upgrade");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment