diff options
author | Michael Widenius <monty@askmonty.org> | 2012-04-02 13:33:16 +0300 |
---|---|---|
committer | Michael Widenius <monty@askmonty.org> | 2012-04-02 13:33:16 +0300 |
commit | d513153f77702dec4a20801a0078d57370b8fef6 (patch) | |
tree | 4bbb4f2af59b22f4a8108238925f5c5e4b0926a4 | |
parent | 635598f19c3f9f8c2b03f417bff584e023a09f34 (diff) | |
parent | ca28d5fcf82686f60b0e439e60fbbce5387d8ccd (diff) | |
download | mariadb-git-d513153f77702dec4a20801a0078d57370b8fef6.tar.gz |
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
40 files changed, 164 insertions, 58 deletions
diff --git a/cmd-line-utils/libedit/chartype.h b/cmd-line-utils/libedit/chartype.h index 40012afb47d..576abe13ad5 100644 --- a/cmd-line-utils/libedit/chartype.h +++ b/cmd-line-utils/libedit/chartype.h @@ -49,7 +49,7 @@ TODO : Verify if FreeBSD & AIX stores ISO 10646 in wchar_t. */ #if !defined(__NetBSD__) && !defined(__sun) \ && !(defined(__APPLE__) && defined(__MACH__)) \ - && !defined(__FreeBSD__) && !defined(_AIX) + && !defined(__FreeBSD__) && !defined(_AIX) && !defined(__OpenBSD__) #ifndef __STDC_ISO_10646__ /* 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 diff --git a/cmd-line-utils/libedit/np/unvis.c b/cmd-line-utils/libedit/np/unvis.c index 812d280b2d8..a911720ad35 100644 --- a/cmd-line-utils/libedit/np/unvis.c +++ b/cmd-line-utils/libedit/np/unvis.c @@ -64,7 +64,7 @@ static char sccsid[] = "@(#)unvis.c 8.1 (Berkeley) 6/4/93"; #include "np/vis.h" #ifdef __weak_alias -__weak_alias(strnunvisx,_strnunvisx) +__weak_alias(strnunvisx,_strnunvisx); #endif #if !HAVE_VIS diff --git a/cmd-line-utils/libedit/np/vis.c b/cmd-line-utils/libedit/np/vis.c index d7cc37b4f47..884a7894332 100644 --- a/cmd-line-utils/libedit/np/vis.c +++ b/cmd-line-utils/libedit/np/vis.c @@ -77,7 +77,7 @@ #include <stdlib.h> #ifdef __weak_alias -__weak_alias(strvisx,_strvisx) +__weak_alias(strvisx,_strvisx); #endif #if !HAVE_VIS || !HAVE_SVIS diff --git a/mysql-test/suite/innodb/r/innodb-autoinc-61209.result b/mysql-test/suite/innodb/r/innodb-autoinc-61209.result index daa9d54df4c..2eeef0ffafe 100644 --- a/mysql-test/suite/innodb/r/innodb-autoinc-61209.result +++ b/mysql-test/suite/innodb/r/innodb-autoinc-61209.result @@ -9,7 +9,9 @@ INSERT INTO bug_61209 VALUES (), (); # Connection con1 SET SESSION auto_increment_increment=3; SET SESSION auto_increment_offset=2; -SELECT GET_LOCK('a', 10); +SELECT GET_LOCK('a', 9); +GET_LOCK('a', 9) +1 # Connection con2 SET SESSION auto_increment_increment=3; @@ -17,14 +19,10 @@ SET SESSION auto_increment_offset=2; INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10)); # Connection con1 reap -GET_LOCK('a', 10) -1 INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL); SELECT RELEASE_LOCK('a'); - -# Connection con2 reap - -# Connection con1 reap RELEASE_LOCK('a') 1 + +# Connection con2 reap DROP TABLE bug_61209; diff --git a/mysql-test/suite/innodb/t/innodb-autoinc-61209.test b/mysql-test/suite/innodb/t/innodb-autoinc-61209.test index 12bdc236b90..cf0b7cf2415 100644 --- a/mysql-test/suite/innodb/t/innodb-autoinc-61209.test +++ b/mysql-test/suite/innodb/t/innodb-autoinc-61209.test @@ -29,7 +29,7 @@ INSERT INTO bug_61209 VALUES (), (); --connection con1 SET SESSION auto_increment_increment=3; SET SESSION auto_increment_offset=2; -send SELECT GET_LOCK('a', 10); +SELECT GET_LOCK('a', 9); --echo --echo # Connection con2 @@ -41,20 +41,14 @@ send INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL + GET_LOCK('a', 10)) --echo --echo # Connection con1 reap --connection con1 -reap; INSERT INTO bug_61209 (a) VALUES (NULL), (NULL), (NULL); -send SELECT RELEASE_LOCK('a'); +SELECT RELEASE_LOCK('a'); --echo --echo # Connection con2 reap --connection con2 reap; ---echo ---echo # Connection con1 reap ---connection con1 -reap; - # # Clean up # diff --git a/mysql-test/suite/maria/r/maria-autozerofill.result b/mysql-test/suite/maria/r/maria-autozerofill.result index 81df4cbab90..22856fe54b0 100644 --- a/mysql-test/suite/maria/r/maria-autozerofill.result +++ b/mysql-test/suite/maria/r/maria-autozerofill.result @@ -4,17 +4,59 @@ create database mysqltest; use mysqltest; create table t1(a int) engine=aria; 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 * shut down mysqld, removed logs, restarted it select * from t1; a 1 Warnings: -Error 1194 t1' is marked as crashed and should be repaired +Note 1194 Zerofilling moved table ./mysqltest/t1 flush table t1; Status: changed,sorted index pages,zerofilled insert into t1 values(2); flush table t1; 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; diff --git a/mysql-test/suite/maria/t/maria-autozerofill.test b/mysql-test/suite/maria/t/maria-autozerofill.test index b42b8e177dc..9bb2782105a 100644 --- a/mysql-test/suite/maria/t/maria-autozerofill.test +++ b/mysql-test/suite/maria/t/maria-autozerofill.test @@ -22,9 +22,19 @@ connection default; use mysqltest; --enable_reconnect +# Create some tables for future tests create table t1(a int) engine=aria; 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 let $MYSQLD_DATADIR= `select @@datadir`; --exec $MARIA_CHK -dv $MYSQLD_DATADIR/mysqltest/t1 >$MYSQLTEST_VARDIR/tmp/ariachk.txt @@ -46,6 +56,7 @@ EOF disable_ps_protocol; # see aria-recover.test replace_regex /Table.*t1/t1/ ; +replace_result \\ /; select * from t1; enable_ps_protocol; flush table t1; @@ -80,4 +91,21 @@ perl; close FILE; 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; diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result index 418a693d319..5ca47804794 100644 --- a/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_flushing_basic.result @@ -73,8 +73,8 @@ set global innodb_adaptive_flushing=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_flushing' set global innodb_adaptive_flushing=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; +ERROR 42000: Variable 'innodb_adaptive_flushing' can't be set to the value of '-3' select @@global.innodb_adaptive_flushing; @@global.innodb_adaptive_flushing 1 diff --git a/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result b/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result index bc908090627..1dbd625b52b 100644 --- a/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_adaptive_hash_index_basic.result @@ -73,8 +73,8 @@ set global innodb_adaptive_hash_index=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_adaptive_hash_index' set global innodb_adaptive_hash_index=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; +ERROR 42000: Variable 'innodb_adaptive_hash_index' can't be set to the value of '-3' select @@global.innodb_adaptive_hash_index; @@global.innodb_adaptive_hash_index 1 diff --git a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result index adb56b347cd..3877988bbee 100644 --- a/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_large_prefix_basic.result @@ -73,8 +73,8 @@ set global innodb_large_prefix=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_large_prefix' set global innodb_large_prefix=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; +ERROR 42000: Variable 'innodb_large_prefix' can't be set to the value of '-3' select @@global.innodb_large_prefix; @@global.innodb_large_prefix 1 diff --git a/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result b/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result index d627aa92ba7..80075be6374 100644 --- a/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_random_read_ahead_basic.result @@ -73,17 +73,17 @@ set global innodb_random_read_ahead=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_random_read_ahead' set global innodb_random_read_ahead=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; +ERROR 42000: Variable 'innodb_random_read_ahead' can't be set to the value of '-3' select @@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'; 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'; VARIABLE_NAME VARIABLE_VALUE -INNODB_RANDOM_READ_AHEAD ON +INNODB_RANDOM_READ_AHEAD OFF set global innodb_random_read_ahead='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; diff --git a/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result b/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result index d3410d7b9c1..852ef8a353d 100644 --- a/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_stats_on_metadata_basic.result @@ -73,8 +73,8 @@ set global innodb_stats_on_metadata=1e1; ERROR 42000: Incorrect argument type to variable 'innodb_stats_on_metadata' set global innodb_stats_on_metadata=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; +ERROR 42000: Variable 'innodb_stats_on_metadata' can't be set to the value of '-3' select @@global.innodb_stats_on_metadata; @@global.innodb_stats_on_metadata 1 diff --git a/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result b/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result index 200f9166215..9c5e62d2684 100644 --- a/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_strict_mode_basic.result @@ -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' set session innodb_strict_mode='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; +ERROR 42000: Variable 'innodb_strict_mode' can't be set to the value of '-3' 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; @@global.innodb_strict_mode 1 diff --git a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result index 537fd3e5db1..754b09310bf 100644 --- a/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_support_xa_basic.result @@ -73,6 +73,7 @@ SELECT @@session.innodb_support_xa; SET @@session.innodb_support_xa = ÓFF; ERROR 42000: Variable 'innodb_support_xa' can't be set to the value of 'ÓFF' 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; @@global.innodb_support_xa 1 diff --git a/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result index e77424df871..08dc5d7aaca 100644 --- a/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result +++ b/mysql-test/suite/sys_vars/r/innodb_table_locks_basic.result @@ -55,6 +55,7 @@ SELECT @@global.innodb_table_locks; 1 '#--------------------FN_DYNVARS_046_04-------------------------#' 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; ERROR 42000: Incorrect argument type to variable 'innodb_table_locks' SET @@session.innodb_table_locks = "T"; @@ -72,6 +73,7 @@ SELECT @@session.innodb_table_locks; SET @@session.innodb_table_locks = ÓFF; ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of 'ÓFF' 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; ERROR 42000: Variable 'innodb_table_locks' can't be set to the value of '2' SET @@global.innodb_table_locks = "T"; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result index ad3ca0de0fa..3e444519441 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_master_enabled_basic.result @@ -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 select @@global.rpl_semi_sync_master_enabled; @@global.rpl_semi_sync_master_enabled --1 +1 select @@session.rpl_semi_sync_master_enabled; ERROR HY000: Variable 'rpl_semi_sync_master_enabled' is a GLOBAL variable show global variables like 'rpl_semi_sync_master_enabled'; diff --git a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result index 25688f55ecd..a23b160e6f2 100644 --- a/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result +++ b/mysql-test/suite/sys_vars/r/rpl_semi_sync_slave_enabled_basic.result @@ -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 select @@global.rpl_semi_sync_slave_enabled; @@global.rpl_semi_sync_slave_enabled --1 +1 select @@session.rpl_semi_sync_slave_enabled; ERROR HY000: Variable 'rpl_semi_sync_slave_enabled' is a GLOBAL variable show global variables like 'rpl_semi_sync_slave_enabled'; diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test index 236b652f9c6..051d863b13f 100644 --- a/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_flushing_basic.test @@ -54,7 +54,7 @@ set global innodb_adaptive_flushing=1.1; set global innodb_adaptive_flushing=1e1; --error ER_WRONG_VALUE_FOR_VAR 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; select @@global.innodb_adaptive_flushing; select * from information_schema.global_variables where variable_name='innodb_adaptive_flushing'; diff --git a/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test b/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test index d6d48ab460c..5171c0e1621 100644 --- a/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_adaptive_hash_index_basic.test @@ -54,7 +54,7 @@ set global innodb_adaptive_hash_index=1.1; set global innodb_adaptive_hash_index=1e1; --error ER_WRONG_VALUE_FOR_VAR 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; select @@global.innodb_adaptive_hash_index; select * from information_schema.global_variables where variable_name='innodb_adaptive_hash_index'; diff --git a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test index 582e9ffbee8..8d3f3afa0a9 100644 --- a/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_large_prefix_basic.test @@ -54,7 +54,7 @@ set global innodb_large_prefix=1.1; set global innodb_large_prefix=1e1; --error ER_WRONG_VALUE_FOR_VAR 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; select @@global.innodb_large_prefix; select * from information_schema.global_variables where variable_name='innodb_large_prefix'; diff --git a/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test index f78223bad02..b7ba6f36b15 100644 --- a/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_random_read_ahead_basic.test @@ -54,7 +54,7 @@ set global innodb_random_read_ahead=1.1; set global innodb_random_read_ahead=1e1; --error ER_WRONG_VALUE_FOR_VAR 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; select @@global.innodb_random_read_ahead; select * from information_schema.global_variables where variable_name='innodb_random_read_ahead'; diff --git a/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test b/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test index e6d59997ac6..9028ee7f687 100644 --- a/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_stats_on_metadata_basic.test @@ -54,7 +54,7 @@ set global innodb_stats_on_metadata=1.1; set global innodb_stats_on_metadata=1e1; --error ER_WRONG_VALUE_FOR_VAR 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; select @@global.innodb_stats_on_metadata; select * from information_schema.global_variables where variable_name='innodb_stats_on_metadata'; diff --git a/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test b/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test index 53fbdca2d32..10f8d1ce4e7 100644 --- a/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_strict_mode_basic.test @@ -68,8 +68,9 @@ set session innodb_strict_mode=2; set global innodb_strict_mode='AUTO'; --error ER_WRONG_VALUE_FOR_VAR 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; +--error ER_WRONG_VALUE_FOR_VAR set session innodb_strict_mode=-7; select @@global.innodb_strict_mode; select @@session.innodb_strict_mode; diff --git a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test index 65681c4a544..988b8f01b93 100644 --- a/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_support_xa_basic.test @@ -127,6 +127,7 @@ SET @@session.innodb_support_xa = ÓFF; # for global +--error ER_WRONG_VALUE_FOR_VAR SET @@global.innodb_support_xa = -1; SELECT @@global.innodb_support_xa; diff --git a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test index 7af8f700f39..e7503bd334d 100644 --- a/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test +++ b/mysql-test/suite/sys_vars/t/innodb_table_locks_basic.test @@ -106,6 +106,7 @@ SELECT @@global.innodb_table_locks; # for session +--error ER_WRONG_VALUE_FOR_VAR SET @@session.innodb_table_locks = -6; --Error ER_WRONG_TYPE_FOR_VAR SET @@session.innodb_table_locks = 1.6; @@ -127,6 +128,7 @@ SET @@session.innodb_table_locks = ÓFF; # for global +--error ER_WRONG_VALUE_FOR_VAR SET @@global.innodb_table_locks = -1; --Error ER_WRONG_VALUE_FOR_VAR SET @@global.innodb_table_locks = 2; diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c index f1caea6d21a..2a23a699f69 100644 --- a/mysys/my_getsystime.c +++ b/mysys/my_getsystime.c @@ -119,7 +119,6 @@ void my_time_init() ulonglong my_getcputime() { #ifdef CLOCK_THREAD_CPUTIME_ID -#ifdef HAVE_CLOCK_GETTIME struct timespec tp; if (clock_gettime(CLOCK_THREAD_CPUTIME_ID, &tp)) return 0; @@ -129,8 +128,6 @@ ulonglong my_getcputime() if (syscall(__NR_clock_gettime, CLOCK_THREAD_CPUTIME_ID, &tp)) return 0; return (ulonglong)tp.tv_sec*10000000+(ulonglong)tp.tv_nsec/100; -#endif /* HAVE_CLOCK_GETTIME */ -#else /* HAVE_THREAD_CPUTIME_ID */ +#endif /* CLOCK_THREAD_CPUTIME_ID */ return 0; -#endif } diff --git a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp index 85887d1d55c..c254d17dff5 100644 --- a/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp +++ b/plugin/handler_socket/handlersocket/hstcpsvr_worker.cpp @@ -7,6 +7,7 @@ */ #include <my_config.h> +#include <sys/types.h> #include <netinet/in.h> #include <errno.h> #include <poll.h> diff --git a/plugin/handler_socket/libhsclient/fatal.cpp b/plugin/handler_socket/libhsclient/fatal.cpp index 8f8751da382..5cdd8879ab1 100644 --- a/plugin/handler_socket/libhsclient/fatal.cpp +++ b/plugin/handler_socket/libhsclient/fatal.cpp @@ -9,6 +9,7 @@ #include <stdlib.h> #include <stdio.h> #include <syslog.h> +#include <unistd.h> #include "fatal.hpp" diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 955d8b0fc90..9b94de11cb7 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1259,7 +1259,7 @@ bool ha_partition::check_and_repair(THD *thd) @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"); @@ -1267,7 +1267,7 @@ bool ha_partition::auto_repair() const As long as we only support one storage engine per table, we can use the first partition for this function. */ - DBUG_RETURN(m_file[0]->auto_repair()); + DBUG_RETURN(m_file[0]->auto_repair(error)); } diff --git a/sql/ha_partition.h b/sql/ha_partition.h index 8723682904a..d58bc578180 100644 --- a/sql/ha_partition.h +++ b/sql/ha_partition.h @@ -1085,7 +1085,7 @@ public: virtual int check(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 auto_repair() const; + virtual bool auto_repair(int error) const; virtual bool is_crashed() const; private: diff --git a/sql/handler.h b/sql/handler.h index d56e3242ddd..f118f1d3c5b 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2446,7 +2446,7 @@ public: virtual uint checksum() 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_index_stats(); diff --git a/sql/mysqld.cc b/sql/mysqld.cc index fba92fe424b..18c21db586f 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2782,6 +2782,7 @@ static void init_signals(void) 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)) { sa.sa_flags = SA_RESETHAND | SA_NODEFER; @@ -2804,6 +2805,7 @@ static void init_signals(void) sigaction(SIGILL, &sa, NULL); sigaction(SIGFPE, &sa, NULL); } +#endif #ifdef HAVE_GETRLIMIT if (test_flags & TEST_CORE_ON_SIGNAL) diff --git a/sql/sql_plugin.cc b/sql/sql_plugin.cc index 067690ea06f..0dc71550b73 100644 --- a/sql/sql_plugin.cc +++ b/sql/sql_plugin.cc @@ -2385,11 +2385,11 @@ static int check_func_bool(THD *thd, struct st_mysql_sys_var *var, { if (value->val_int(value, &tmp) < 0) goto err; - if (tmp > 1) + if (tmp != 0 && tmp != 1) goto err; result= (int) tmp; } - *(my_bool *) save= -result; + *(my_bool *) save= result ? 1 : 0; return 0; err: return 1; @@ -2579,7 +2579,7 @@ err: static void update_func_bool(THD *thd, struct st_mysql_sys_var *var, void *tgt, const void *save) { - *(my_bool *) tgt= *(my_bool *) save ? TRUE : FALSE; + *(my_bool *) tgt= *(my_bool *) save ? 1 : 0; } diff --git a/sql/table.cc b/sql/table.cc index 57e1930016e..fa5fff365d7 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -2607,8 +2607,7 @@ partititon_err: HA_OPEN_IGNORE_IF_LOCKED) | ha_open_flags)))) { /* Set a flag if the table is crashed and it can be auto. repaired */ - share->crashed= ((ha_err == HA_ERR_CRASHED_ON_USAGE) && - outparam->file->auto_repair() && + share->crashed= (outparam->file->auto_repair(ha_err) && !(ha_open_flags & HA_OPEN_FOR_REPAIR)); switch (ha_err) diff --git a/storage/archive/ha_archive.h b/storage/archive/ha_archive.h index 7ae6bf57a32..165c7443070 100644 --- a/storage/archive/ha_archive.h +++ b/storage/archive/ha_archive.h @@ -126,7 +126,9 @@ public: int free_share(); int init_archive_writer(); 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); void position(const uchar *record); int info(uint); diff --git a/storage/csv/ha_tina.h b/storage/csv/ha_tina.h index 837da613171..d024b31c127 100644 --- a/storage/csv/ha_tina.h +++ b/storage/csv/ha_tina.h @@ -150,6 +150,8 @@ public: int rnd_end(); int repair(THD* thd, HA_CHECK_OPT* check_opt); /* 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; } void position(const uchar *record); int info(uint); diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc index aeeb994667e..ae7e686d2f0 100644 --- a/storage/maria/ha_maria.cc +++ b/storage/maria/ha_maria.cc @@ -58,6 +58,9 @@ C_MODE_END ulong pagecache_division_limit, pagecache_age_threshold; 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 @@ -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 (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); + } file->s->chst_invalidator= query_cache_invalidate_by_MyISAM_filename_ref; /* Set external_ref, mainly for temporary tables */ @@ -1266,6 +1277,14 @@ int ha_maria::check(THD * thd, HA_CHECK_OPT * check_opt) return HA_ADMIN_ALREADY_DONE; maria_chk_init_for_check(¶m, file); + + if ((file->s->state.changed & (STATE_CRASHED_FLAGS | STATE_MOVED)) == + STATE_MOVED) + { + _ma_check_print_error(¶m, "%s", zerofill_error_msg); + return HA_ADMIN_CORRUPT; + } + old_proc_info= thd_proc_info(thd, "Checking status"); thd_progress_init(thd, 3); (void) maria_chk_status(¶m, file); // Not fatal @@ -1633,7 +1652,7 @@ int ha_maria::repair(THD *thd, HA_CHECK *param, bool do_optimize) { DBUG_PRINT("info", ("Reseting crashed state")); 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; } /* @@ -2135,6 +2154,11 @@ bool ha_maria::check_and_repair(THD *thd) if ((file->s->state.changed & (STATE_CRASHED_FLAGS | 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'", table->s->path.str); if (!(error= zerofill(thd, &check_opt))) diff --git a/storage/maria/ha_maria.h b/storage/maria/ha_maria.h index 6232333a160..35c98cc52d7 100644 --- a/storage/maria/ha_maria.h +++ b/storage/maria/ha_maria.h @@ -152,8 +152,14 @@ public: bool check_and_repair(THD * thd); bool is_crashed() const; bool is_changed() const; - bool auto_repair() const - { return test(maria_recover_options & HA_RECOVER_ANY); } + bool auto_repair(int error) const + { + /* 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 restore(THD * thd, HA_CHECK_OPT * check_opt); int backup(THD * thd, HA_CHECK_OPT * check_opt); diff --git a/storage/maria/ma_open.c b/storage/maria/ma_open.c index ef7d17b5c76..a526c0d4276 100644 --- a/storage/maria/ma_open.c +++ b/storage/maria/ma_open.c @@ -1002,8 +1002,6 @@ err: tmp_name.length= strlen(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) { case 5: if (data_file >= 0) diff --git a/storage/myisam/ha_myisam.h b/storage/myisam/ha_myisam.h index aa00398e7e7..579ef061af4 100644 --- a/storage/myisam/ha_myisam.h +++ b/storage/myisam/ha_myisam.h @@ -140,7 +140,11 @@ class ha_myisam: public handler int repair(THD* thd, HA_CHECK_OPT* check_opt); bool check_and_repair(THD *thd); 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 assign_to_keycache(THD* thd, HA_CHECK_OPT* check_opt); int preload_keys(THD* thd, HA_CHECK_OPT* check_opt); |