Commit 0cc7c608 authored by Monty's avatar Monty

Enable mysqlcheck and flush_read_lock tests

- Updated results
- Run mysqlcheck without --user-stat-tables=PREFERABLY to keep results
  consistent
- Don't allow one to run analyze table under FTWRL as analyze table
  nowadays has to update status tables.
parent 2b7e080f
......@@ -19,6 +19,4 @@ innodb_bug12902967 : broken upstream
file_contents : MDEV-6526 these files are not installed anymore
max_statement_time : cannot possibly work, depends on timing
partition_open_files_limit : open_files_limit check broken by MDEV-18360
mysqlcheck : special tables like proxy , host specific to a system are shown
flush_read_lock : special tables like proxy , host specific to a system are shown
join_cache : enable after MDEV-17752 is fixed
......@@ -159,11 +159,10 @@ Success: FTWRL is blocked when 'alter event e1 comment 'test'' is active in anot
#
# 2) ANALYZE TABLE statement is compatible with FTWRL.
# See Bug#43336 ANALYZE and OPTIMIZE do not honour
# --read-only for a discussion why.
# --read-only as they update status tables.
#
Success: Was able to run 'analyze table t1_base' under FTWRL.
Success: Was able to run 'analyze table t1_base' with FTWRL active in another connection.
Success: Was able to run FTWRL while 'analyze table t1_base' was active in another connection.
Success: Was not able to run 'analyze table t1_base' under FTWRL.
Success: 'analyze table t1_base' is blocked by FTWRL active in another connection.
#
# 3) BEGIN, ROLLBACK and COMMIT statements.
# BEGIN and ROLLBACK are compatible with FTWRL.
......@@ -1409,10 +1408,8 @@ set autocommit= 1;
# 39.1.a) ANALYZE TABLE for transactional table is incompatible with
# FTWRL.
flush tables with read lock;
# Implicit commits are allowed under FTWRL.
analyze table t3_trans;
Table Op Msg_type Msg_text
test.t3_trans analyze status OK
ERROR HY000: Can't execute the query because you have a conflicting read lock
unlock tables;
#
connection con1;
......@@ -1425,6 +1422,7 @@ unlock tables;
connection default;
# Reap ANALYZE TABLE
Table Op Msg_type Msg_text
test.t3_trans analyze status Engine-independent statistics collected
test.t3_trans analyze status OK
#
# 39.1.b) CHECK TABLE for transactional table is compatible with FTWRL.
......@@ -1460,7 +1458,7 @@ Success: Was able to run 'repair table t3_temp_trans' with FTWRL active in anoth
Success: Was able to run FTWRL while 'repair table t3_temp_trans' was active in another connection.
#
# And ANALYZE TABLE:
Success: Was able to run 'analyze table t3_temp_trans' under FTWRL.
Error: Wasn't able to run 'analyze table t3_temp_trans' under FTWRL!
Success: Was able to run 'analyze table t3_temp_trans' with FTWRL active in another connection.
Success: Was able to run FTWRL while 'analyze table t3_temp_trans' was active in another connection.
#
......
......@@ -199,11 +199,13 @@ let $cleanup_stmt1= alter event e1 comment '';
--echo #
--echo # 2) ANALYZE TABLE statement is compatible with FTWRL.
--echo # See Bug#43336 ANALYZE and OPTIMIZE do not honour
--echo # --read-only for a discussion why.
--echo # --read-only as they update status tables.
--echo #
let $skip_3rd_check= 1;
let $statement= analyze table t1_base;
let $cleanup_stmt= ;
--source include/check_ftwrl_compatible.inc
--source include/check_ftwrl_incompatible.inc
let $skip_3rd_check= ;
--echo #
--echo # 3) BEGIN, ROLLBACK and COMMIT statements.
......@@ -1712,7 +1714,7 @@ set autocommit= 1;
--echo # 39.1.a) ANALYZE TABLE for transactional table is incompatible with
--echo # FTWRL.
flush tables with read lock;
--echo # Implicit commits are allowed under FTWRL.
--error ER_CANT_UPDATE_WITH_READLOCK
analyze table t3_trans;
unlock tables;
--echo #
......
......@@ -468,11 +468,11 @@ drop database mysqltest1;
#
create table t1(a int);
insert into t1 (a) values (1), (2), (3);
select * from mysql.column_stats;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
select db_name,table_name,column_name,min_value,max_value,nulls_ratio,avg_length,avg_frequency,hist_size,hist_type from mysql.column_stats order by db_name,table_name;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type
test.t1 Engine-independent statistics collected
status : OK
select * from mysql.column_stats where db_name = 'test' and table_name = 't1';
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram
test t1 a 1 3 0.0000 4.0000 1.0000 0 NULL NULL
select db_name,table_name,column_name,min_value,max_value,nulls_ratio,avg_length,avg_frequency,hist_size,hist_type from mysql.column_stats where db_name = 'test' and table_name = 't1' order by db_name,table_name;
db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type
test t1 a 1 3 0.0000 4.0000 1.0000 254 DOUBLE_PREC_HB
drop table t1;
......@@ -403,7 +403,7 @@ drop database mysqltest1;
--echo #
create table t1(a int);
insert into t1 (a) values (1), (2), (3);
select * from mysql.column_stats;
select db_name,table_name,column_name,min_value,max_value,nulls_ratio,avg_length,avg_frequency,hist_size,hist_type from mysql.column_stats order by db_name,table_name;
--exec $MYSQL_CHECK --analyze test t1 --persistent
select * from mysql.column_stats where db_name = 'test' and table_name = 't1';
select db_name,table_name,column_name,min_value,max_value,nulls_ratio,avg_length,avg_frequency,hist_size,hist_type from mysql.column_stats where db_name = 'test' and table_name = 't1' order by db_name,table_name;
drop table t1;
......@@ -1305,6 +1305,9 @@ bool Sql_cmd_analyze_table::execute(THD *thd)
if (check_table_access(thd, SELECT_ACL | INSERT_ACL, first_table,
FALSE, UINT_MAX, FALSE))
goto error;
if (thd->has_read_only_protection())
goto error;
WSREP_TO_ISOLATION_BEGIN_WRTCHK(NULL, NULL, first_table);
res= mysql_admin_table(thd, first_table, &m_lex->check_opt,
"analyze", lock_type, 1, 0, 0, 0,
......
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