Commit d513153f authored by Michael Widenius's avatar Michael Widenius

Merge of compatibility fixes

Fixed failing tests in sys_vars as we have now stricter checking of setting of variables.

mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test:
  One can now only assign 0 or 1 to boolean variables
mysys/my_getsystime.c:
  Merge + fixed bug that __NR_clock_gettime didn't work in 5.5
parents 635598f1 ca28d5fc
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
TODO : Verify if FreeBSD & AIX stores ISO 10646 in wchar_t. */ TODO : Verify if FreeBSD & AIX stores ISO 10646 in wchar_t. */
#if !defined(__NetBSD__) && !defined(__sun) \ #if !defined(__NetBSD__) && !defined(__sun) \
&& !(defined(__APPLE__) && defined(__MACH__)) \ && !(defined(__APPLE__) && defined(__MACH__)) \
&& !defined(__FreeBSD__) && !defined(_AIX) && !defined(__FreeBSD__) && !defined(_AIX) && !defined(__OpenBSD__)
#ifndef __STDC_ISO_10646__ #ifndef __STDC_ISO_10646__
/* In many places it is assumed that the first 127 code points are ASCII /* In many places it is assumed that the first 127 code points are ASCII
* compatible, so ensure wchar_t indeed does ISO 10646 and not some other * compatible, so ensure wchar_t indeed does ISO 10646 and not some other
......
...@@ -64,7 +64,7 @@ static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; ...@@ -64,7 +64,7 @@ static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93";
#include "np/vis.h" #include "np/vis.h"
#ifdef __weak_alias #ifdef __weak_alias
__weak_alias(strnunvisx,_strnunvisx) __weak_alias(strnunvisx,_strnunvisx);
#endif #endif
#if !HAVE_VIS #if !HAVE_VIS
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
#include <stdlib.h> #include <stdlib.h>
#ifdef __weak_alias #ifdef __weak_alias
__weak_alias(strvisx,_strvisx) __weak_alias(strvisx,_strvisx);
#endif #endif
#if !HAVE_VIS || !HAVE_SVIS #if !HAVE_VIS || !HAVE_SVIS
......
...@@ -9,7 +9,9 @@ INSERT INTO bug_61209 VALUES (), (); ...@@ -9,7 +9,9 @@ INSERT INTO bug_61209 VALUES (), ();
# Connection con1 # Connection con1
SET SESSION auto_increment_increment=3; SET SESSION auto_increment_increment=3;
SET SESSION auto_increment_offset=2; SET SESSION auto_increment_offset=2;
SELECT GET_LOCK('a', 10); SELECT GET_LOCK('a', 9);
GET_LOCK('a', 9)
1
# Connection con2 # Connection con2
SET SESSION auto_increment_increment=3; SET SESSION auto_increment_increment=3;
...@@ -17,14 +19,10 @@ SET SESSION auto_increment_offset=2; ...@@ -17,14 +19,10 @@ SET SESSION auto_increment_offset=2;
INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10)); INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10));
# Connection con1 reap # Connection con1 reap
GET_LOCK('a', 10)
1
INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL); INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL);
SELECT RELEASE_LOCK('a'); SELECT RELEASE_LOCK('a');
# Connection con2 reap
# Connection con1 reap
RELEASE_LOCK('a') RELEASE_LOCK('a')
1 1
# Connection con2 reap
DROP TABLE bug_61209; DROP TABLE bug_61209;
...@@ -29,7 +29,7 @@ INSERT INTO bug_61209 VALUES (), (); ...@@ -29,7 +29,7 @@ INSERT INTO bug_61209 VALUES (), ();
--connection con1 --connection con1
SET SESSION auto_increment_increment=3; SET SESSION auto_increment_increment=3;
SET SESSION auto_increment_offset=2; SET SESSION auto_increment_offset=2;
send SELECT GET_LOCK('a', 10); SELECT GET_LOCK('a', 9);
--echo --echo
--echo # Connection con2 --echo # Connection con2
...@@ -41,20 +41,14 @@ send INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10)) ...@@ -41,20 +41,14 @@ send INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10))
--echo --echo
--echo # Connection con1 reap --echo # Connection con1 reap
--connection con1 --connection con1
reap;
INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL); INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL);
send SELECT RELEASE_LOCK('a'); SELECT RELEASE_LOCK('a');
--echo --echo
--echo # Connection con2 reap --echo # Connection con2 reap
--connection con2 --connection con2
reap; reap;
--echo
--echo # Connection con1 reap
--connection con1
reap;
# #
# Clean up # Clean up
# #
......
...@@ -4,17 +4,59 @@ create database mysqltest; ...@@ -4,17 +4,59 @@ create database mysqltest;
use mysqltest; use mysqltest;
create table t1(a int) engine=aria; create table t1(a int) engine=aria;
insert into t1 values(1); insert into t1 values(1);
flush table t1; create table t2 (a int) engine=aria;
INSERT INTO t2 VALUES (1),(2);
create table t3 (a int) engine=aria;
INSERT INTO t3 VALUES (1),(2);
create table t4 (a int) engine=aria;
INSERT INTO t4 VALUES (1),(2);
create table t5 (a int) engine=aria;
INSERT INTO t5 VALUES (1),(2);
flush tables;
create_rename_lsn has non-magic value create_rename_lsn has non-magic value
* shut down mysqld, removed logs, restarted it * shut down mysqld, removed logs, restarted it
select * from t1; select * from t1;
a a
1 1
Warnings: Warnings:
Error 1194 t1' is marked as crashed and should be repaired Note 1194 Zerofilling moved table ./mysqltest/t1
flush table t1; flush table t1;
Status: changed,sorted index pages,zerofilled Status: changed,sorted index pages,zerofilled
insert into t1 values(2); insert into t1 values(2);
flush table t1; flush table t1;
create_rename_lsn has non-magic value create_rename_lsn has non-magic value
check table t2;
Table Op Msg_type Msg_text
mysqltest.t2 check error Table is from another system and must be zerofilled or repaired to be usable on this system
mysqltest.t2 check error Corrupt
check table t2;
Table Op Msg_type Msg_text
mysqltest.t2 check error Table is from another system and must be zerofilled or repaired to be usable on this system
mysqltest.t2 check error Corrupt
repair table t2;
Table Op Msg_type Msg_text
mysqltest.t2 repair status OK
check table t2;
Table Op Msg_type Msg_text
mysqltest.t2 check status OK
optimize table t3;
Table Op Msg_type Msg_text
mysqltest.t3 optimize Note Zerofilling moved table ./mysqltest/t3
mysqltest.t3 optimize status OK
analyze table t4;
Table Op Msg_type Msg_text
mysqltest.t4 analyze Note Zerofilling moved table ./mysqltest/t4
mysqltest.t4 analyze status OK
repair table t5;
Table Op Msg_type Msg_text
mysqltest.t5 repair status OK
check table t5;
Table Op Msg_type Msg_text
mysqltest.t5 check status OK
repair table t5;
Table Op Msg_type Msg_text
mysqltest.t5 repair status OK
check table t5;
Table Op Msg_type Msg_text
mysqltest.t5 check status OK
drop database mysqltest; drop database mysqltest;
...@@ -22,9 +22,19 @@ connection default; ...@@ -22,9 +22,19 @@ connection default;
use mysqltest; use mysqltest;
--enable_reconnect --enable_reconnect
# Create some tables for future tests
create table t1(a int) engine=aria; create table t1(a int) engine=aria;
insert into t1 values(1); insert into t1 values(1);
flush table t1; create table t2 (a int) engine=aria;
INSERT INTO t2 VALUES (1),(2);
create table t3 (a int) engine=aria;
INSERT INTO t3 VALUES (1),(2);
create table t4 (a int) engine=aria;
INSERT INTO t4 VALUES (1),(2);
create table t5 (a int) engine=aria;
INSERT INTO t5 VALUES (1),(2);
flush tables;
# Check that table is not zerofilled, not movable # Check that table is not zerofilled, not movable
let $MYSQLD_DATADIR= `select @@datadir`; let $MYSQLD_DATADIR= `select @@datadir`;
--exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt --exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt
...@@ -46,6 +56,7 @@ EOF ...@@ -46,6 +56,7 @@ EOF
disable_ps_protocol; # see aria-recover.test disable_ps_protocol; # see aria-recover.test
replace_regex /Table.*t1/t1/ ; replace_regex /Table.*t1/t1/ ;
replace_result \\ /;
select * from t1; select * from t1;
enable_ps_protocol; enable_ps_protocol;
flush table t1; flush table t1;
...@@ -80,4 +91,21 @@ perl; ...@@ -80,4 +91,21 @@ perl;
close FILE; close FILE;
EOF EOF
#
# BUG#44422 "mysql_upgrade destroys Maria tables?"
# Check repair and optimize of moved table
#
check table t2;
check table t2;
repair table t2;
check table t2;
replace_result \\ /;
optimize table t3;
replace_result \\ /;
analyze table t4;
repair table t5;
check table t5;
repair table t5;
check table t5;
drop database mysqltest; drop database mysqltest;
...@@ -73,8 +73,8 @@ set global innodb_adaptive_flushing=1e1; ...@@ -73,8 +73,8 @@ set global innodb_adaptive_flushing=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing' ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing'
set global innodb_adaptive_flushing=2; set global innodb_adaptive_flushing=2;
ERROR 42000: Variable 'innodb_adaptive_flushing' can't be set to the value of '2' ERROR 42000: Variable 'innodb_adaptive_flushing' can't be set to the value of '2'
NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_adaptive_flushing=-3; set global innodb_adaptive_flushing=-3;
ERROR 42000: Variable 'innodb_adaptive_flushing' can't be set to the value of '-3'
select @@global.innodb_adaptive_flushing; select @@global.innodb_adaptive_flushing;
@@global.innodb_adaptive_flushing @@global.innodb_adaptive_flushing
1 1
......
...@@ -73,8 +73,8 @@ set global innodb_adaptive_hash_index=1e1; ...@@ -73,8 +73,8 @@ set global innodb_adaptive_hash_index=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_hash_index' ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_hash_index'
set global innodb_adaptive_hash_index=2; set global innodb_adaptive_hash_index=2;
ERROR 42000: Variable 'innodb_adaptive_hash_index' can't be set to the value of '2' ERROR 42000: Variable 'innodb_adaptive_hash_index' can't be set to the value of '2'
NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_adaptive_hash_index=-3; set global innodb_adaptive_hash_index=-3;
ERROR 42000: Variable 'innodb_adaptive_hash_index' can't be set to the value of '-3'
select @@global.innodb_adaptive_hash_index; select @@global.innodb_adaptive_hash_index;
@@global.innodb_adaptive_hash_index @@global.innodb_adaptive_hash_index
1 1
......
...@@ -73,8 +73,8 @@ set global innodb_large_prefix=1e1; ...@@ -73,8 +73,8 @@ set global innodb_large_prefix=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix' ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix'
set global innodb_large_prefix=2; set global innodb_large_prefix=2;
ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '2' ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '2'
NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_large_prefix=-3; set global innodb_large_prefix=-3;
ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '-3'
select @@global.innodb_large_prefix; select @@global.innodb_large_prefix;
@@global.innodb_large_prefix @@global.innodb_large_prefix
1 1
......
...@@ -73,17 +73,17 @@ set global innodb_random_read_ahead=1e1; ...@@ -73,17 +73,17 @@ set global innodb_random_read_ahead=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_random_read_ahead' ERROR 42000: Incorrect argument type to variable 'innodb_random_read_ahead'
set global innodb_random_read_ahead=2; set global innodb_random_read_ahead=2;
ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of '2' ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of '2'
NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_random_read_ahead=-3; set global innodb_random_read_ahead=-3;
ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of '-3'
select @@global.innodb_random_read_ahead; select @@global.innodb_random_read_ahead;
@@global.innodb_random_read_ahead @@global.innodb_random_read_ahead
1 0
select * from information_schema.global_variables where variable_name='innodb_random_read_ahead'; select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
INNODB_RANDOM_READ_AHEAD ON INNODB_RANDOM_READ_AHEAD OFF
select * from information_schema.session_variables where variable_name='innodb_random_read_ahead'; select * from information_schema.session_variables where variable_name='innodb_random_read_ahead';
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
INNODB_RANDOM_READ_AHEAD ON INNODB_RANDOM_READ_AHEAD OFF
set global innodb_random_read_ahead='AUTO'; set global innodb_random_read_ahead='AUTO';
ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of 'AUTO' ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of 'AUTO'
SET @@global.innodb_random_read_ahead = @start_global_value; SET @@global.innodb_random_read_ahead = @start_global_value;
......
...@@ -73,8 +73,8 @@ set global innodb_stats_on_metadata=1e1; ...@@ -73,8 +73,8 @@ set global innodb_stats_on_metadata=1e1;
ERROR 42000: Incorrect argument type to variable 'innodb_stats_on_metadata' ERROR 42000: Incorrect argument type to variable 'innodb_stats_on_metadata'
set global innodb_stats_on_metadata=2; set global innodb_stats_on_metadata=2;
ERROR 42000: Variable 'innodb_stats_on_metadata' can't be set to the value of '2' ERROR 42000: Variable 'innodb_stats_on_metadata' can't be set to the value of '2'
NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_stats_on_metadata=-3; set global innodb_stats_on_metadata=-3;
ERROR 42000: Variable 'innodb_stats_on_metadata' can't be set to the value of '-3'
select @@global.innodb_stats_on_metadata; select @@global.innodb_stats_on_metadata;
@@global.innodb_stats_on_metadata @@global.innodb_stats_on_metadata
1 1
......
...@@ -99,9 +99,10 @@ set global innodb_strict_mode='AUTO'; ...@@ -99,9 +99,10 @@ set global innodb_strict_mode='AUTO';
ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of 'AUTO' ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of 'AUTO'
set session innodb_strict_mode='AUTO'; set session innodb_strict_mode='AUTO';
ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of 'AUTO' ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of 'AUTO'
NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643)
set global innodb_strict_mode=-3; set global innodb_strict_mode=-3;
ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of '-3'
set session innodb_strict_mode=-7; set session innodb_strict_mode=-7;
ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of '-7'
select @@global.innodb_strict_mode; select @@global.innodb_strict_mode;
@@global.innodb_strict_mode @@global.innodb_strict_mode
1 1
......
...@@ -73,6 +73,7 @@ SELECT @@session.innodb_support_xa; ...@@ -73,6 +73,7 @@ SELECT @@session.innodb_support_xa;
SET @@session.innodb_support_xa = FF; SET @@session.innodb_support_xa = FF;
ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'FF' ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'FF'
SET @@global.innodb_support_xa = -1; SET @@global.innodb_support_xa = -1;
ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of '-1'
SELECT @@global.innodb_support_xa; SELECT @@global.innodb_support_xa;
@@global.innodb_support_xa @@global.innodb_support_xa
1 1
......
...@@ -55,6 +55,7 @@ SELECT @@global.innodb_table_locks; ...@@ -55,6 +55,7 @@ SELECT @@global.innodb_table_locks;
1 1
'#--------------------FN_DYNVARS_046_04-------------------------#' '#--------------------FN_DYNVARS_046_04-------------------------#'
SET @@session.innodb_table_locks = -6; SET @@session.innodb_table_locks = -6;
ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of '-6'
SET @@session.innodb_table_locks = 1.6; SET @@session.innodb_table_locks = 1.6;
ERROR 42000: Incorrect argument type to variable 'innodb_table_locks' ERROR 42000: Incorrect argument type to variable 'innodb_table_locks'
SET @@session.innodb_table_locks = "T"; SET @@session.innodb_table_locks = "T";
...@@ -72,6 +73,7 @@ SELECT @@session.innodb_table_locks; ...@@ -72,6 +73,7 @@ SELECT @@session.innodb_table_locks;
SET @@session.innodb_table_locks = FF; SET @@session.innodb_table_locks = FF;
ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'FF' ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'FF'
SET @@global.innodb_table_locks = -1; SET @@global.innodb_table_locks = -1;
ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of '-1'
SET @@global.innodb_table_locks = 2; SET @@global.innodb_table_locks = 2;
ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of '2' ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of '2'
SET @@global.innodb_table_locks = "T"; SET @@global.innodb_table_locks = "T";
......
...@@ -45,7 +45,7 @@ set session rpl_semi_sync_master_enabled=1; ...@@ -45,7 +45,7 @@ set session rpl_semi_sync_master_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable and should be set with SET GLOBAL
select @@global.rpl_semi_sync_master_enabled; select @@global.rpl_semi_sync_master_enabled;
@@global.rpl_semi_sync_master_enabled @@global.rpl_semi_sync_master_enabled
-1 1
select @@session.rpl_semi_sync_master_enabled; select @@session.rpl_semi_sync_master_enabled;
ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable
show global variables like 'rpl_semi_sync_master_enabled'; show global variables like 'rpl_semi_sync_master_enabled';
......
...@@ -45,7 +45,7 @@ set session rpl_semi_sync_slave_enabled=1; ...@@ -45,7 +45,7 @@ set session rpl_semi_sync_slave_enabled=1;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable and should be set with SET GLOBAL
select @@global.rpl_semi_sync_slave_enabled; select @@global.rpl_semi_sync_slave_enabled;
@@global.rpl_semi_sync_slave_enabled @@global.rpl_semi_sync_slave_enabled
-1 1
select @@session.rpl_semi_sync_slave_enabled; select @@session.rpl_semi_sync_slave_enabled;
ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable
show global variables like 'rpl_semi_sync_slave_enabled'; show global variables like 'rpl_semi_sync_slave_enabled';
......
...@@ -54,7 +54,7 @@ set global innodb_adaptive_flushing=1.1; ...@@ -54,7 +54,7 @@ set global innodb_adaptive_flushing=1.1;
set global innodb_adaptive_flushing=1e1; set global innodb_adaptive_flushing=1e1;
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set global innodb_adaptive_flushing=2; set global innodb_adaptive_flushing=2;
--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) --error ER_WRONG_VALUE_FOR_VAR
set global innodb_adaptive_flushing=-3; set global innodb_adaptive_flushing=-3;
select @@global.innodb_adaptive_flushing; select @@global.innodb_adaptive_flushing;
select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing';
......
...@@ -54,7 +54,7 @@ set global innodb_adaptive_hash_index=1.1; ...@@ -54,7 +54,7 @@ set global innodb_adaptive_hash_index=1.1;
set global innodb_adaptive_hash_index=1e1; set global innodb_adaptive_hash_index=1e1;
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set global innodb_adaptive_hash_index=2; set global innodb_adaptive_hash_index=2;
--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) --error ER_WRONG_VALUE_FOR_VAR
set global innodb_adaptive_hash_index=-3; set global innodb_adaptive_hash_index=-3;
select @@global.innodb_adaptive_hash_index; select @@global.innodb_adaptive_hash_index;
select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index';
......
...@@ -54,7 +54,7 @@ set global innodb_large_prefix=1.1; ...@@ -54,7 +54,7 @@ set global innodb_large_prefix=1.1;
set global innodb_large_prefix=1e1; set global innodb_large_prefix=1e1;
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set global innodb_large_prefix=2; set global innodb_large_prefix=2;
--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) --error ER_WRONG_VALUE_FOR_VAR
set global innodb_large_prefix=-3; set global innodb_large_prefix=-3;
select @@global.innodb_large_prefix; select @@global.innodb_large_prefix;
select * from information_schema.global_variables where variable_name='innodb_large_prefix'; select * from information_schema.global_variables where variable_name='innodb_large_prefix';
......
...@@ -54,7 +54,7 @@ set global innodb_random_read_ahead=1.1; ...@@ -54,7 +54,7 @@ set global innodb_random_read_ahead=1.1;
set global innodb_random_read_ahead=1e1; set global innodb_random_read_ahead=1e1;
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set global innodb_random_read_ahead=2; set global innodb_random_read_ahead=2;
--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) --error ER_WRONG_VALUE_FOR_VAR
set global innodb_random_read_ahead=-3; set global innodb_random_read_ahead=-3;
select @@global.innodb_random_read_ahead; select @@global.innodb_random_read_ahead;
select * from information_schema.global_variables where variable_name='innodb_random_read_ahead'; select * from information_schema.global_variables where variable_name='innodb_random_read_ahead';
......
...@@ -54,7 +54,7 @@ set global innodb_stats_on_metadata=1.1; ...@@ -54,7 +54,7 @@ set global innodb_stats_on_metadata=1.1;
set global innodb_stats_on_metadata=1e1; set global innodb_stats_on_metadata=1e1;
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set global innodb_stats_on_metadata=2; set global innodb_stats_on_metadata=2;
--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) --error ER_WRONG_VALUE_FOR_VAR
set global innodb_stats_on_metadata=-3; set global innodb_stats_on_metadata=-3;
select @@global.innodb_stats_on_metadata; select @@global.innodb_stats_on_metadata;
select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata';
......
...@@ -68,8 +68,9 @@ set session innodb_strict_mode=2; ...@@ -68,8 +68,9 @@ set session innodb_strict_mode=2;
set global innodb_strict_mode='AUTO'; set global innodb_strict_mode='AUTO';
--error ER_WRONG_VALUE_FOR_VAR --error ER_WRONG_VALUE_FOR_VAR
set session innodb_strict_mode='AUTO'; set session innodb_strict_mode='AUTO';
--echo NOTE: The following should fail with ER_WRONG_VALUE_FOR_VAR (BUG#50643) --error ER_WRONG_VALUE_FOR_VAR
set global innodb_strict_mode=-3; set global innodb_strict_mode=-3;
--error ER_WRONG_VALUE_FOR_VAR
set session innodb_strict_mode=-7; set session innodb_strict_mode=-7;
select @@global.innodb_strict_mode; select @@global.innodb_strict_mode;
select @@session.innodb_strict_mode; select @@session.innodb_strict_mode;
......
...@@ -127,6 +127,7 @@ SET @@session.innodb_support_xa = ...@@ -127,6 +127,7 @@ SET @@session.innodb_support_xa =
# for global # for global
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_support_xa = -1; SET @@global.innodb_support_xa = -1;
SELECT @@global.innodb_support_xa; SELECT @@global.innodb_support_xa;
......
...@@ -106,6 +106,7 @@ SELECT @@global.innodb_table_locks; ...@@ -106,6 +106,7 @@ SELECT @@global.innodb_table_locks;
# for session # for session
--error ER_WRONG_VALUE_FOR_VAR
SET @@session.innodb_table_locks = -6; SET @@session.innodb_table_locks = -6;
--Error ER_WRONG_TYPE_FOR_VAR --Error ER_WRONG_TYPE_FOR_VAR
SET @@session.innodb_table_locks = 1.6; SET @@session.innodb_table_locks = 1.6;
...@@ -127,6 +128,7 @@ SET @@session.innodb_table_locks = ...@@ -127,6 +128,7 @@ SET @@session.innodb_table_locks =
# for global # for global
--error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_table_locks = -1; SET @@global.innodb_table_locks = -1;
--Error ER_WRONG_VALUE_FOR_VAR --Error ER_WRONG_VALUE_FOR_VAR
SET @@global.innodb_table_locks = 2; SET @@global.innodb_table_locks = 2;
......
...@@ -119,7 +119,6 @@ void my_time_init() ...@@ -119,7 +119,6 @@ void my_time_init()
ulonglong my_getcputime() ulonglong my_getcputime()
{ {
#ifdef CLOCK_THREAD_CPUTIME_ID #ifdef CLOCK_THREAD_CPUTIME_ID
#ifdef HAVE_CLOCK_GETTIME
struct timespec tp; struct timespec tp;
if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)) if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp))
return 0; return 0;
...@@ -129,8 +128,6 @@ ulonglong my_getcputime() ...@@ -129,8 +128,6 @@ ulonglong my_getcputime()
if (syscall(__NR_clock_gettime, CLOCK_THREAD_CPUTIME_ID, &tp)) if (syscall(__NR_clock_gettime, CLOCK_THREAD_CPUTIME_ID, &tp))
return 0; return 0;
return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100; return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100;
#endif /* HAVE_CLOCK_GETTIME */ #endif /* CLOCK_THREAD_CPUTIME_ID */
#else /* HAVE_THREAD_CPUTIME_ID */
return 0; return 0;
#endif
} }
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
*/ */
#include <my_config.h> #include <my_config.h>
#include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <errno.h> #include <errno.h>
#include <poll.h> #include <poll.h>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <syslog.h> #include <syslog.h>
#include <unistd.h>
#include "fatal.hpp" #include "fatal.hpp"
......
...@@ -1259,7 +1259,7 @@ bool ha_partition::check_and_repair(THD *thd) ...@@ -1259,7 +1259,7 @@ bool ha_partition::check_and_repair(THD *thd)
@retval FALSE Cannot be auto repaired @retval FALSE Cannot be auto repaired
*/ */
bool ha_partition::auto_repair() const bool ha_partition::auto_repair(int error) const
{ {
DBUG_ENTER("ha_partition::auto_repair"); DBUG_ENTER("ha_partition::auto_repair");
...@@ -1267,7 +1267,7 @@ bool ha_partition::auto_repair() const ...@@ -1267,7 +1267,7 @@ bool ha_partition::auto_repair() const
As long as we only support one storage engine per table, As long as we only support one storage engine per table,
we can use the first partition for this function. we can use the first partition for this function.
*/ */
DBUG_RETURN(m_file[0]->auto_repair()); DBUG_RETURN(m_file[0]->auto_repair(error));
} }
......
...@@ -1085,7 +1085,7 @@ public: ...@@ -1085,7 +1085,7 @@ public:
virtual int check(THD* thd, HA_CHECK_OPT *check_opt); virtual int check(THD* thd, HA_CHECK_OPT *check_opt);
virtual int repair(THD* thd, HA_CHECK_OPT *check_opt); virtual int repair(THD* thd, HA_CHECK_OPT *check_opt);
virtual bool check_and_repair(THD *thd); virtual bool check_and_repair(THD *thd);
virtual bool auto_repair() const; virtual bool auto_repair(int error) const;
virtual bool is_crashed() const; virtual bool is_crashed() const;
private: private:
......
...@@ -2446,7 +2446,7 @@ public: ...@@ -2446,7 +2446,7 @@ public:
virtual uint checksum() const { return 0; } virtual uint checksum() const { return 0; }
virtual bool is_crashed() const { return 0; } virtual bool is_crashed() const { return 0; }
virtual bool auto_repair() const { return 0; } virtual bool auto_repair(int error) const { return 0; }
void update_global_table_stats(); void update_global_table_stats();
void update_global_index_stats(); void update_global_index_stats();
......
...@@ -2782,6 +2782,7 @@ static void init_signals(void) ...@@ -2782,6 +2782,7 @@ static void init_signals(void)
my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called! my_sigset(THR_SERVER_ALARM,print_signal_warning); // Should never be called!
#ifdef HAVE_STACKTRACE
if (opt_stack_trace || (test_flags & TEST_CORE_ON_SIGNAL)) if (opt_stack_trace || (test_flags & TEST_CORE_ON_SIGNAL))
{ {
sa.sa_flags = SA_RESETHAND | SA_NODEFER; sa.sa_flags = SA_RESETHAND | SA_NODEFER;
...@@ -2804,6 +2805,7 @@ static void init_signals(void) ...@@ -2804,6 +2805,7 @@ static void init_signals(void)
sigaction(SIGILL, &sa, NULL); sigaction(SIGILL, &sa, NULL);
sigaction(SIGFPE, &sa, NULL); sigaction(SIGFPE, &sa, NULL);
} }
#endif
#ifdef HAVE_GETRLIMIT #ifdef HAVE_GETRLIMIT
if (test_flags & TEST_CORE_ON_SIGNAL) if (test_flags & TEST_CORE_ON_SIGNAL)
......
...@@ -2385,11 +2385,11 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, ...@@ -2385,11 +2385,11 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var,
{ {
if (value->val_int(value, &tmp) < 0) if (value->val_int(value, &tmp) < 0)
goto err; goto err;
if (tmp > 1) if (tmp != 0 && tmp != 1)
goto err; goto err;
result= (int) tmp; result= (int) tmp;
} }
*(my_bool *) save= -result; *(my_bool *) save= result ? 1 : 0;
return 0; return 0;
err: err:
return 1; return 1;
...@@ -2579,7 +2579,7 @@ err: ...@@ -2579,7 +2579,7 @@ err:
static void update_func_bool(THD *thd, struct st_mysql_sys_var *var, static void update_func_bool(THD *thd, struct st_mysql_sys_var *var,
void *tgt, const void *save) void *tgt, const void *save)
{ {
*(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE; *(my_bool *) tgt= *(my_bool *) save ? 1 : 0;
} }
......
...@@ -2607,8 +2607,7 @@ partititon_err: ...@@ -2607,8 +2607,7 @@ partititon_err:
HA_OPEN_IGNORE_IF_LOCKED) | ha_open_flags)))) HA_OPEN_IGNORE_IF_LOCKED) | ha_open_flags))))
{ {
/* Set a flag if the table is crashed and it can be auto. repaired */ /* Set a flag if the table is crashed and it can be auto. repaired */
share->crashed= ((ha_err == HA_ERR_CRASHED_ON_USAGE) && share->crashed= (outparam->file->auto_repair(ha_err) &&
outparam->file->auto_repair() &&
!(ha_open_flags & HA_OPEN_FOR_REPAIR)); !(ha_open_flags & HA_OPEN_FOR_REPAIR));
switch (ha_err) switch (ha_err)
......
...@@ -126,7 +126,9 @@ public: ...@@ -126,7 +126,9 @@ public:
int free_share(); int free_share();
int init_archive_writer(); int init_archive_writer();
int init_archive_reader(); int init_archive_reader();
bool auto_repair() const { return 1; } // For the moment we just do this // Always try auto_repair in case of HA_ERR_CRASHED_ON_USAGE
bool auto_repair(int error) const
{ return error == HA_ERR_CRASHED_ON_USAGE; }
int read_data_header(azio_stream *file_to_read); int read_data_header(azio_stream *file_to_read);
void position(const uchar *record); void position(const uchar *record);
int info(uint); int info(uint);
......
...@@ -150,6 +150,8 @@ public: ...@@ -150,6 +150,8 @@ public:
int rnd_end(); int rnd_end();
int repair(THD* thd, HA_CHECK_OPT* check_opt); int repair(THD* thd, HA_CHECK_OPT* check_opt);
/* This is required for SQL layer to know that we support autorepair */ /* This is required for SQL layer to know that we support autorepair */
bool auto_repair(int error) const
{ return error == HA_ERR_CRASHED_ON_USAGE; }
bool auto_repair() const { return 1; } bool auto_repair() const { return 1; }
void position(const uchar *record); void position(const uchar *record);
int info(uint); int info(uint);
......
...@@ -58,6 +58,9 @@ C_MODE_END ...@@ -58,6 +58,9 @@ C_MODE_END
ulong pagecache_division_limit, pagecache_age_threshold; ulong pagecache_division_limit, pagecache_age_threshold;
ulonglong pagecache_buffer_size; ulonglong pagecache_buffer_size;
const char *zerofill_error_msg=
"Table is from another system and must be zerofilled or repaired to be "
"usable on this system";
/** /**
As the auto-repair is initiated when opened from the SQL layer As the auto-repair is initiated when opened from the SQL layer
...@@ -1152,7 +1155,15 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked) ...@@ -1152,7 +1155,15 @@ int ha_maria::open(const char *name, int mode, uint test_if_locked)
} }
if (!(file= maria_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER))) if (!(file= maria_open(name, mode, test_if_locked | HA_OPEN_FROM_SQL_LAYER)))
{
if (my_errno == HA_ERR_OLD_FILE)
{
push_warning(current_thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_CRASHED_ON_USAGE,
zerofill_error_msg);
}
return (my_errno ? my_errno : -1); return (my_errno ? my_errno : -1);
}
file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref; file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref;
/* Set external_ref, mainly for temporary tables */ /* Set external_ref, mainly for temporary tables */
...@@ -1266,6 +1277,14 @@ int ha_maria::check(THD * thd, HA_CHECK_OPT * check_opt) ...@@ -1266,6 +1277,14 @@ int ha_maria::check(THD * thd, HA_CHECK_OPT * check_opt)
return HA_ADMIN_ALREADY_DONE; return HA_ADMIN_ALREADY_DONE;
maria_chk_init_for_check(&param, file); maria_chk_init_for_check(&param, file);
if ((file->s->state.changed & (STATE_CRASHED_FLAGS | STATE_MOVED)) ==
STATE_MOVED)
{
_ma_check_print_error(&param, "%s", zerofill_error_msg);
return HA_ADMIN_CORRUPT;
}
old_proc_info= thd_proc_info(thd, "Checking status"); old_proc_info= thd_proc_info(thd, "Checking status");
thd_progress_init(thd, 3); thd_progress_init(thd, 3);
(void) maria_chk_status(&param, file); // Not fatal (void) maria_chk_status(&param, file); // Not fatal
...@@ -1633,7 +1652,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize) ...@@ -1633,7 +1652,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize)
{ {
DBUG_PRINT("info", ("Reseting crashed state")); DBUG_PRINT("info", ("Reseting crashed state"));
share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED_FLAGS | share->state.changed&= ~(STATE_CHANGED | STATE_CRASHED_FLAGS |
STATE_IN_REPAIR); STATE_IN_REPAIR | STATE_MOVED);
file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED; file->update |= HA_STATE_CHANGED | HA_STATE_ROW_CHANGED;
} }
/* /*
...@@ -2135,6 +2154,11 @@ bool ha_maria::check_and_repair(THD *thd) ...@@ -2135,6 +2154,11 @@ bool ha_maria::check_and_repair(THD *thd)
if ((file->s->state.changed & (STATE_CRASHED_FLAGS | STATE_MOVED)) == if ((file->s->state.changed & (STATE_CRASHED_FLAGS | STATE_MOVED)) ==
STATE_MOVED) STATE_MOVED)
{ {
/* Remove error about crashed table */
thd->warning_info->clear_warning_info(thd->query_id);
push_warning_printf(current_thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_CRASHED_ON_USAGE,
"Zerofilling moved table %s", table->s->path.str);
sql_print_information("Zerofilling moved table: '%s'", sql_print_information("Zerofilling moved table: '%s'",
table->s->path.str); table->s->path.str);
if (!(error= zerofill(thd, &check_opt))) if (!(error= zerofill(thd, &check_opt)))
......
...@@ -152,8 +152,14 @@ public: ...@@ -152,8 +152,14 @@ public:
bool check_and_repair(THD * thd); bool check_and_repair(THD * thd);
bool is_crashed() const; bool is_crashed() const;
bool is_changed() const; bool is_changed() const;
bool auto_repair() const bool auto_repair(int error) const
{ return test(maria_recover_options & HA_RECOVER_ANY); } {
/* Always auto-repair moved tables (error == HA_ERR_OLD_FILE) */
return ((test(maria_recover_options & HA_RECOVER_ANY) &&
error == HA_ERR_CRASHED_ON_USAGE) ||
error == HA_ERR_OLD_FILE);
}
int optimize(THD * thd, HA_CHECK_OPT * check_opt); int optimize(THD * thd, HA_CHECK_OPT * check_opt);
int restore(THD * thd, HA_CHECK_OPT * check_opt); int restore(THD * thd, HA_CHECK_OPT * check_opt);
int backup(THD * thd, HA_CHECK_OPT * check_opt); int backup(THD * thd, HA_CHECK_OPT * check_opt);
......
...@@ -1002,8 +1002,6 @@ err: ...@@ -1002,8 +1002,6 @@ err:
tmp_name.length= strlen(name); tmp_name.length= strlen(name);
_ma_report_error(save_errno, &tmp_name); _ma_report_error(save_errno, &tmp_name);
} }
if (save_errno == HA_ERR_OLD_FILE) /* uuid is different ? */
save_errno= HA_ERR_CRASHED_ON_USAGE; /* the code to trigger auto-repair */
switch (errpos) { switch (errpos) {
case 5: case 5:
if (data_file >= 0) if (data_file >= 0)
......
...@@ -140,7 +140,11 @@ class ha_myisam: public handler ...@@ -140,7 +140,11 @@ class ha_myisam: public handler
int repair(THD* thd, HA_CHECK_OPT* check_opt); int repair(THD* thd, HA_CHECK_OPT* check_opt);
bool check_and_repair(THD *thd); bool check_and_repair(THD *thd);
bool is_crashed() const; bool is_crashed() const;
bool auto_repair() const { return myisam_recover_options != HA_RECOVER_OFF; } bool auto_repair(int error) const
{
return (myisam_recover_options != HA_RECOVER_OFF &&
error == HA_ERR_CRASHED_ON_USAGE);
}
int optimize(THD* thd, HA_CHECK_OPT* check_opt); int optimize(THD* thd, HA_CHECK_OPT* check_opt);
int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt); int assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt);
int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); int preload_keys(THD* thd, HA_CHECK_OPT* check_opt);
......
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