1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Added support for ANALYZE TABLE to S3 tables

Other things
- Cleaned up error messages for CHECK, REPAIR and OPTIMIZE
This commit is contained in:
Monty
2021-08-31 18:02:38 +03:00
parent 6bdc03ebcc
commit 49ae199604
7 changed files with 121 additions and 30 deletions

View File

@@ -55,6 +55,36 @@ update t1 set b=100 where a=1;
ERROR HY000: Table 't1' is read only
delete from t1 where a>10;
ERROR HY000: Table 't1' is read only
#
# Analyze, repair, optimize and check table
#
set @@use_stat_tables='never';
truncate mysql.table_stats;
check table t1;
Table Op Msg_type Msg_text
database.t1 check status Table 'database.t1' is read only
analyze table t1;
Table Op Msg_type Msg_text
database.t1 analyze status Table 'database.t1' is read only
analyze table t1 persistent for all;
Table Op Msg_type Msg_text
database.t1 analyze status Table 'database.t1' is read only
database.t1 analyze status Engine-independent statistics collected
database.t1 analyze status OK
repair table t1;
Table Op Msg_type Msg_text
database.t1 repair Error Table 't1' is read only
database.t1 repair status Operation failed
optimize table t1;
Table Op Msg_type Msg_text
database.t1 optimize Error Table 't1' is read only
database.t1 optimize status Operation failed
select * from mysql.table_stats;
db_name table_name cardinality
database t1 10000
#
# Converting table back to Aria
#
alter table t1 engine=aria;
show create table t1;
Table Create Table

View File

@@ -34,6 +34,31 @@ insert into t1 values (1,1);
update t1 set b=100 where a=1;
--error ER_OPEN_AS_READONLY
delete from t1 where a>10;
--echo #
--echo # Analyze, repair, optimize and check table
--echo #
set @@use_stat_tables='never';
truncate mysql.table_stats;
--replace_result $database database
check table t1;
--replace_result $database database
analyze table t1;
--replace_result $database database
analyze table t1 persistent for all;
--replace_result $database database
repair table t1;
--replace_result $database database
optimize table t1;
--replace_result $database database
select * from mysql.table_stats;
--echo #
--echo # Converting table back to Aria
--echo #
alter table t1 engine=aria;
show create table t1;
select * from t1 limit 10;

View File

@@ -56,14 +56,15 @@ ALTER TABLE t2 TRUNCATE PARTITION p3;
ERROR HY000: Table 't2' is read only
ALTER TABLE t2 ANALYZE PARTITION p3;
Table Op Msg_type Msg_text
s3.t2 analyze error Table 's3.t2' is read only
s3.t2 analyze status Table 's3.t2' is read only
s3.t2 analyze status Engine-independent statistics collected
s3.t2 analyze status OK
SELECT count(*) FROM t2;
count(*)
6
ALTER TABLE t2 CHECK PARTITION p3;
Table Op Msg_type Msg_text
s3.t2 check error Subpartition p3sp0 returned error
s3.t2 check error Unknown - internal error 165 during operation
s3.t2 check status Table 's3.t2' is read only
SELECT count(*) FROM t2;
count(*)
6