Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
c400ef25
Commit
c400ef25
authored
Jul 17, 2020
by
Varun Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Making the stat_tables_innodb test deterministic
parent
1ba8df4c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
21 deletions
+15
-21
mysql-test/r/stat_tables_innodb.result
mysql-test/r/stat_tables_innodb.result
+8
-13
mysql-test/t/stat_tables_innodb.test
mysql-test/t/stat_tables_innodb.test
+7
-8
No files found.
mysql-test/r/stat_tables_innodb.result
View file @
c400ef25
...
...
@@ -773,30 +773,25 @@ set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
#
# MDEV-22851: Engine independent index statistics are incorrect for large tables on Windows.
#
CREATE TABLE t1 AS SELECT TABLE_CATALOG FROM INFORMATION_SCHEMA.COLUMNS;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
INSERT INTO t1 SELECT * FROM t1;
CREATE TABLE t1(a INT) ENGINE=INNODB;
INSERT INTO t1 SELECT 1 FROM seq_1_to_60000;
SET @save_use_stat_tables= @@use_stat_tables;
SET use_stat_tables= preferably;
SELECT count(*) FROM t1;
count(*)
54336
CREATE INDEX idx ON t1(TABLE_CATALOG);
Warnings:
Warning 1071 Specified key was too long; max key length is 767 bytes
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (TABLE_CATALOG) INDEXES (idx);
60000
CREATE INDEX idx ON t1(a);
ANALYZE TABLE t1 PERSISTENT FOR COLUMNS (a) INDEXES (idx);
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status OK
SELECT * FROM mysql.index_stats where table_name='t1';
db_name table_name index_name prefix_arity avg_frequency
test t1 idx 1
NULL
test t1 idx 1
60000.0000
SELECT * FROM mysql.column_stats where 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
TABLE_CATALOG def def 0.0000 3.0000 54336
.0000 0 NULL NULL
test t1
a 1 1 0.0000 4.0000 60000
.0000 0 NULL NULL
SET use_stat_tables= @save_use_stat_tables;
DROP TABLE t1;
# end of 10.1 tests
SET SESSION STORAGE_ENGINE=DEFAULT;
mysql-test/t/stat_tables_innodb.test
View file @
c400ef25
--
source
include
/
have_innodb
.
inc
--
source
include
/
have_sequence
.
inc
SET
SESSION
STORAGE_ENGINE
=
'InnoDB'
;
...
...
@@ -13,21 +14,19 @@ set optimizer_switch=@save_optimizer_switch_for_stat_tables_test;
--
echo
# MDEV-22851: Engine independent index statistics are incorrect for large tables on Windows.
--
echo
#
CREATE
TABLE
t1
AS
SELECT
TABLE_CATALOG
FROM
INFORMATION_SCHEMA
.
COLUMNS
;
INSERT
INTO
t1
SELECT
*
FROM
t1
;
INSERT
INTO
t1
SELECT
*
FROM
t1
;
INSERT
INTO
t1
SELECT
*
FROM
t1
;
INSERT
INTO
t1
SELECT
*
FROM
t1
;
INSERT
INTO
t1
SELECT
*
FROM
t1
;
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
INNODB
;
INSERT
INTO
t1
SELECT
1
FROM
seq_1_to_60000
;
SET
@
save_use_stat_tables
=
@@
use_stat_tables
;
SET
use_stat_tables
=
preferably
;
SELECT
count
(
*
)
FROM
t1
;
CREATE
INDEX
idx
ON
t1
(
TABLE_CATALOG
);
ANALYZE
TABLE
t1
PERSISTENT
FOR
COLUMNS
(
TABLE_CATALOG
)
INDEXES
(
idx
);
CREATE
INDEX
idx
ON
t1
(
a
);
ANALYZE
TABLE
t1
PERSISTENT
FOR
COLUMNS
(
a
)
INDEXES
(
idx
);
SELECT
*
FROM
mysql
.
index_stats
where
table_name
=
't1'
;
SELECT
*
FROM
mysql
.
column_stats
where
table_name
=
't1'
;
SET
use_stat_tables
=
@
save_use_stat_tables
;
DROP
TABLE
t1
;
--
echo
# end of 10.1 tests
SET
SESSION
STORAGE_ENGINE
=
DEFAULT
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment