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
f127e212
Commit
f127e212
authored
Nov 08, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DB-757 compute cardinality when alter table analyze partition is run
parent
695ce3ad
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
77 additions
and
1 deletion
+77
-1
mysql-test/suite/tokudb.bugs/r/db757_part_alter_analyze.result
...-test/suite/tokudb.bugs/r/db757_part_alter_analyze.result
+50
-0
mysql-test/suite/tokudb.bugs/t/db757_part_alter_analyze.test
mysql-test/suite/tokudb.bugs/t/db757_part_alter_analyze.test
+26
-0
storage/tokudb/ha_tokudb_admin.cc
storage/tokudb/ha_tokudb_admin.cc
+1
-1
No files found.
mysql-test/suite/tokudb.bugs/r/db757_part_alter_analyze.result
0 → 100644
View file @
f127e212
set default_storage_engine='tokudb';
drop table if exists t;
create table t (id int, x int, y int, primary key (id), key (x), key (y))
partition by range(id)
( partition p0 values less than (10), partition p1 values less than maxvalue);
insert into t values (1,1,1),(2,1,2),(3,1,3),(4,1,4);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 5 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
t 1 y 1 y A NULL NULL NULL YES BTREE
alter table t analyze partition p0;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 5 NULL NULL BTREE
t 1 x 1 x A 1 NULL NULL YES BTREE
t 1 y 1 y A 5 NULL NULL YES BTREE
alter table t analyze partition p1;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 5 NULL NULL BTREE
t 1 x 1 x A 1 NULL NULL YES BTREE
t 1 y 1 y A 5 NULL NULL YES BTREE
insert into t values (100,1,1),(200,2,1),(300,3,1),(400,4,1),(500,5,1);
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 9 NULL NULL BTREE
t 1 x 1 x A 2 NULL NULL YES BTREE
t 1 y 1 y A 9 NULL NULL YES BTREE
alter table t analyze partition p0;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 9 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
t 1 y 1 y A NULL NULL NULL YES BTREE
alter table t analyze partition p1;
Table Op Msg_type Msg_text
test.t analyze status OK
show indexes from t;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t 0 PRIMARY 1 id A 9 NULL NULL BTREE
t 1 x 1 x A 9 NULL NULL YES BTREE
t 1 y 1 y A 1 NULL NULL YES BTREE
drop table t;
mysql-test/suite/tokudb.bugs/t/db757_part_alter_analyze.test
0 → 100644
View file @
f127e212
source
include
/
have_tokudb
.
inc
;
source
include
/
have_partition
.
inc
;
set
default_storage_engine
=
'tokudb'
;
disable_warnings
;
drop
table
if
exists
t
;
enable_warnings
;
create
table
t
(
id
int
,
x
int
,
y
int
,
primary
key
(
id
),
key
(
x
),
key
(
y
))
partition
by
range
(
id
)
(
partition
p0
values
less
than
(
10
),
partition
p1
values
less
than
maxvalue
);
insert
into
t
values
(
1
,
1
,
1
),(
2
,
1
,
2
),(
3
,
1
,
3
),(
4
,
1
,
4
);
show
indexes
from
t
;
alter
table
t
analyze
partition
p0
;
show
indexes
from
t
;
alter
table
t
analyze
partition
p1
;
show
indexes
from
t
;
insert
into
t
values
(
100
,
1
,
1
),(
200
,
2
,
1
),(
300
,
3
,
1
),(
400
,
4
,
1
),(
500
,
5
,
1
);
show
indexes
from
t
;
alter
table
t
analyze
partition
p0
;
show
indexes
from
t
;
alter
table
t
analyze
partition
p1
;
show
indexes
from
t
;
drop
table
t
;
storage/tokudb/ha_tokudb_admin.cc
View file @
f127e212
...
...
@@ -133,7 +133,7 @@ int ha_tokudb::analyze(THD *thd, HA_CHECK_OPT *check_opt) {
int
result
=
HA_ADMIN_OK
;
// stub out analyze if optimize is remapped to alter recreate + analyze
if
(
thd_sql_command
(
thd
)
!=
SQLCOM_ANALYZE
)
{
if
(
thd_sql_command
(
thd
)
!=
SQLCOM_ANALYZE
&&
thd_sql_command
(
thd
)
!=
SQLCOM_ALTER_TABLE
)
{
TOKUDB_HANDLER_DBUG_RETURN
(
result
);
}
...
...
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