Commit 39049add authored by Guilhem Bichot's avatar Guilhem Bichot

Making maria-recover.test work the same with debug and non-debug builds: one...

Making maria-recover.test work the same with debug and non-debug builds: one error message was specific of
debug builds and is now removed, left only in non-ha-maria programs.

mysql-test/r/maria-recover.result:
  This warning is not thrown anymore when used in ha_maria
mysql-test/t/maria-recover.test:
  In this patch, corruption warnings are unified between debug and non-debug builds, so test can run on both
storage/maria/ha_maria.cc:
  declare that Maria is used from ha_maria
storage/maria/ma_static.c:
  new variable to tell if Maria is used from ha_maria
storage/maria/maria_def.h:
  Comment describing what maria_print_error() does. And change of this macro: it now does nothing when Maria
  is used from ha_maria.
parent 97189b02
...@@ -27,7 +27,6 @@ Warnings: ...@@ -27,7 +27,6 @@ Warnings:
Error 145 Table './mysqltest/t_corrupted2' is marked as crashed and should be repaired Error 145 Table './mysqltest/t_corrupted2' is marked as crashed and should be repaired
Error 1194 Table 't_corrupted2' is marked as crashed and should be repaired Error 1194 Table 't_corrupted2' is marked as crashed and should be repaired
Error 1034 1 client is using or hasn't closed the table properly Error 1034 1 client is using or hasn't closed the table properly
Error 126 Incorrect key file for table './mysqltest/t_corrupted2.MAI'; try to repair it
Error 1034 Wrong base information on indexpage at page: 1 Error 1034 Wrong base information on indexpage at page: 1
select * from t_corrupted2; select * from t_corrupted2;
a a
......
# Test of the --maria-recover option. # Test of the --maria-recover option.
--source include/have_maria.inc --source include/have_maria.inc
# line below will be removed
--source include/have_debug.inc
select @@global.maria_recover; select @@global.maria_recover;
set global maria_recover=off; set global maria_recover=off;
......
...@@ -2941,7 +2941,7 @@ static int ha_maria_init(void *p) ...@@ -2941,7 +2941,7 @@ static int ha_maria_init(void *p)
maria_recovery_from_log() || maria_recovery_from_log() ||
((force_start_after_recovery_failures != 0) && mark_recovery_success()) || ((force_start_after_recovery_failures != 0) && mark_recovery_success()) ||
ma_checkpoint_init(checkpoint_interval); ma_checkpoint_init(checkpoint_interval);
maria_multi_threaded= TRUE; maria_multi_threaded= maria_in_ha_maria= TRUE;
return res ? HA_ERR_INITIALIZATION : 0; return res ? HA_ERR_INITIALIZATION : 0;
} }
......
...@@ -35,6 +35,7 @@ ulong maria_block_size= MARIA_KEY_BLOCK_LENGTH; ...@@ -35,6 +35,7 @@ ulong maria_block_size= MARIA_KEY_BLOCK_LENGTH;
my_bool maria_flush= 0, maria_single_user= 0; my_bool maria_flush= 0, maria_single_user= 0;
my_bool maria_delay_key_write= 0, maria_page_checksums= 1; my_bool maria_delay_key_write= 0, maria_page_checksums= 1;
my_bool maria_inited= FALSE; my_bool maria_inited= FALSE;
my_bool maria_in_ha_maria= FALSE; /* If used from ha_maria or not */
pthread_mutex_t THR_LOCK_maria; pthread_mutex_t THR_LOCK_maria;
#if defined(THREAD) && !defined(DONT_USE_RW_LOCKS) #if defined(THREAD) && !defined(DONT_USE_RW_LOCKS)
ulong maria_concurrent_insert= 2; ulong maria_concurrent_insert= 2;
......
...@@ -634,8 +634,16 @@ struct st_maria_handler ...@@ -634,8 +634,16 @@ struct st_maria_handler
#define maria_is_crashed(x) ((x)->s->state.changed & STATE_CRASHED) #define maria_is_crashed(x) ((x)->s->state.changed & STATE_CRASHED)
#define maria_is_crashed_on_repair(x) ((x)->s->state.changed & STATE_CRASHED_ON_REPAIR) #define maria_is_crashed_on_repair(x) ((x)->s->state.changed & STATE_CRASHED_ON_REPAIR)
#ifdef EXTRA_DEBUG #ifdef EXTRA_DEBUG
/**
Brings additional information in certain debug builds and in standalone
(non-ha_maria) programs. To help debugging. Not in ha_maria, to not spam the
user (some messages can be produced many times per statement, or even
wrongly during some repair operations).
*/
#define maria_print_error(SHARE, ERRNO) \ #define maria_print_error(SHARE, ERRNO) \
_ma_report_error((ERRNO), (SHARE)->index_file_name) do{ if (!maria_in_ha_maria) \
_ma_report_error((ERRNO), (SHARE)->index_file_name); } \
while(0)
#else #else
#define maria_print_error(SHARE, ERRNO) while (0) #define maria_print_error(SHARE, ERRNO) while (0)
#endif #endif
...@@ -728,7 +736,7 @@ extern uint maria_read_vec[], maria_readnext_vec[]; ...@@ -728,7 +736,7 @@ extern uint maria_read_vec[], maria_readnext_vec[];
extern uint maria_quick_table_bits; extern uint maria_quick_table_bits;
extern char *maria_data_root; extern char *maria_data_root;
extern uchar maria_zero_string[]; extern uchar maria_zero_string[];
extern my_bool maria_inited; extern my_bool maria_inited, maria_in_ha_maria;
extern HASH maria_stored_state; extern HASH maria_stored_state;
/* This is used by _ma_calc_xxx_key_length och _ma_store_key */ /* This is used by _ma_calc_xxx_key_length och _ma_store_key */
......
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