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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
0e6a4915
Commit
0e6a4915
authored
Nov 08, 2014
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into releases/tokudb-7.5
parents
447a7949
f127e212
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
273 additions
and
27 deletions
+273
-27
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash.result
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash.result
+21
-0
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_1.result
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_1.result
+20
-0
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_1_pick.result
...st/suite/tokudb.bugs/r/db756_card_part_hash_1_pick.result
+21
-0
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_2.result
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_2.result
+20
-0
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_2_pick.result
...st/suite/tokudb.bugs/r/db756_card_part_hash_2_pick.result
+21
-0
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/db756_card_part_hash.test
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash.test
+15
-0
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_1.test
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_1.test
+14
-0
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_1_pick.test
...test/suite/tokudb.bugs/t/db756_card_part_hash_1_pick.test
+15
-0
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_2.test
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_2.test
+14
-0
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_2_pick.test
...test/suite/tokudb.bugs/t/db756_card_part_hash_2_pick.test
+15
-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
scripts/make.mysql.bash
scripts/make.mysql.bash
+1
-2
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+11
-22
storage/tokudb/ha_tokudb.h
storage/tokudb/ha_tokudb.h
+3
-0
storage/tokudb/ha_tokudb_admin.cc
storage/tokudb/ha_tokudb_admin.cc
+1
-1
storage/tokudb/hatoku_defines.h
storage/tokudb/hatoku_defines.h
+4
-1
storage/tokudb/tokudb_card.h
storage/tokudb/tokudb_card.h
+1
-1
No files found.
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash.result
0 → 100644
View file @
0e6a4915
set default_storage_engine='tokudb';
drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
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 2 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
insert into t values (1,1),(3,1),(5,1);
insert into t values (2,1),(4,1),(6,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 6 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
analyze table t;
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 6 NULL NULL BTREE
t 1 x 1 x A 2 NULL NULL YES BTREE
drop table t;
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_1.result
0 → 100644
View file @
0e6a4915
set default_storage_engine='tokudb';
drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
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 2 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
insert into t values (1,1),(3,1),(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 4 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
analyze table t;
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 4 NULL NULL BTREE
t 1 x 1 x A 1 NULL NULL YES BTREE
drop table t;
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_1_pick.result
0 → 100644
View file @
0e6a4915
set default_storage_engine='tokudb';
drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
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 2 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
insert into t values (1,1),(3,2),(5,3);
insert into t values (2,1),(4,1),(6,1),(8,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 7 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
analyze table t;
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 7 NULL NULL BTREE
t 1 x 1 x A 1 NULL NULL YES BTREE
drop table t;
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_2.result
0 → 100644
View file @
0e6a4915
set default_storage_engine='tokudb';
drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
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 2 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
insert into t values (2,1),(4,1),(6,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 4 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
analyze table t;
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 4 NULL NULL BTREE
t 1 x 1 x A 1 NULL NULL YES BTREE
drop table t;
mysql-test/suite/tokudb.bugs/r/db756_card_part_hash_2_pick.result
0 → 100644
View file @
0e6a4915
set default_storage_engine='tokudb';
drop table if exists t;
create table t (id int, x int, primary key (id), key (x)) partition by hash(id) partitions 2;
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 2 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
insert into t values (1,1),(3,2),(5,3),(7,4);
insert into t values (2,1),(4,1),(6,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 7 NULL NULL BTREE
t 1 x 1 x A NULL NULL NULL YES BTREE
analyze table t;
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 7 NULL NULL BTREE
t 1 x 1 x A 7 NULL NULL YES BTREE
drop table t;
mysql-test/suite/tokudb.bugs/r/db757_part_alter_analyze.result
0 → 100644
View file @
0e6a4915
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/db756_card_part_hash.test
0 → 100644
View file @
0e6a4915
# DB-756 verify that cardinality is picked from SOME partition
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
,
primary
key
(
id
),
key
(
x
))
partition
by
hash
(
id
)
partitions
2
;
show
indexes
from
t
;
insert
into
t
values
(
1
,
1
),(
3
,
1
),(
5
,
1
);
insert
into
t
values
(
2
,
1
),(
4
,
1
),(
6
,
1
);
show
indexes
from
t
;
analyze
table
t
;
show
indexes
from
t
;
drop
table
t
;
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_1.test
0 → 100644
View file @
0e6a4915
# DB-756 verify that cardinality is picked from the partition where the rows are mapped. in this case, the last partition.
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
,
primary
key
(
id
),
key
(
x
))
partition
by
hash
(
id
)
partitions
2
;
show
indexes
from
t
;
insert
into
t
values
(
1
,
1
),(
3
,
1
),(
5
,
1
);
show
indexes
from
t
;
analyze
table
t
;
show
indexes
from
t
;
drop
table
t
;
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_1_pick.test
0 → 100644
View file @
0e6a4915
# DB-756 verify that cardinality is chosen from the first partition
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
,
primary
key
(
id
),
key
(
x
))
partition
by
hash
(
id
)
partitions
2
;
show
indexes
from
t
;
insert
into
t
values
(
1
,
1
),(
3
,
2
),(
5
,
3
);
insert
into
t
values
(
2
,
1
),(
4
,
1
),(
6
,
1
),(
8
,
1
);
show
indexes
from
t
;
analyze
table
t
;
show
indexes
from
t
;
drop
table
t
;
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_2.test
0 → 100644
View file @
0e6a4915
# DB-756 verify that cardinality is picked from the partition where the rows are mapped. in this case, the first partition.
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
,
primary
key
(
id
),
key
(
x
))
partition
by
hash
(
id
)
partitions
2
;
show
indexes
from
t
;
insert
into
t
values
(
2
,
1
),(
4
,
1
),(
6
,
1
);
show
indexes
from
t
;
analyze
table
t
;
show
indexes
from
t
;
drop
table
t
;
mysql-test/suite/tokudb.bugs/t/db756_card_part_hash_2_pick.test
0 → 100644
View file @
0e6a4915
# DB-756 verify that cardinality is chosen from the last partition
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
,
primary
key
(
id
),
key
(
x
))
partition
by
hash
(
id
)
partitions
2
;
show
indexes
from
t
;
insert
into
t
values
(
1
,
1
),(
3
,
2
),(
5
,
3
),(
7
,
4
);
insert
into
t
values
(
2
,
1
),(
4
,
1
),(
6
,
1
);
show
indexes
from
t
;
analyze
table
t
;
show
indexes
from
t
;
drop
table
t
;
mysql-test/suite/tokudb.bugs/t/db757_part_alter_analyze.test
0 → 100644
View file @
0e6a4915
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
;
scripts/make.mysql.bash
View file @
0e6a4915
...
@@ -155,6 +155,7 @@ function generate_cmake_cmd () {
...
@@ -155,6 +155,7 @@ function generate_cmake_cmd () {
-D
BUILD_CONFIG
=
mysql_release
\
-D
BUILD_CONFIG
=
mysql_release
\
-D
CMAKE_BUILD_TYPE
=
$cmake_build_type
\
-D
CMAKE_BUILD_TYPE
=
$cmake_build_type
\
-D
CMAKE_TOKUDB_REVISION
=
$ft_revision
\
-D
CMAKE_TOKUDB_REVISION
=
$ft_revision
\
-D
TOKUDB_VERSION
=
tokudb-
${
tokudb_version
}
\
-D
BUILD_TESTING
=
OFF
\
-D
BUILD_TESTING
=
OFF
\
-D
USE_GTAGS
=
OFF
\
-D
USE_GTAGS
=
OFF
\
-D
USE_CTAGS
=
OFF
\
-D
USE_CTAGS
=
OFF
\
...
@@ -212,8 +213,6 @@ if [ $build_tgz != 0 ] ; then
...
@@ -212,8 +213,6 @@ if [ $build_tgz != 0 ] ; then
mkdir
-p
build.
$cmake_build_type
mkdir
-p
build.
$cmake_build_type
pushd
build.
$cmake_build_type
pushd
build.
$cmake_build_type
export
TOKUDB_VERSION
=
$tokudb_version
# actually build
# actually build
cmd
=
$(
generate_cmake_cmd
)
cmd
=
$(
generate_cmake_cmd
)
if
[
$?
!=
0
]
;
then
exit
1
;
fi
if
[
$?
!=
0
]
;
then
exit
1
;
fi
...
...
storage/tokudb/ha_tokudb.cc
View file @
0e6a4915
...
@@ -243,23 +243,20 @@ void TOKUDB_SHARE::destroy(void) {
...
@@ -243,23 +243,20 @@ void TOKUDB_SHARE::destroy(void) {
tokudb_pthread_mutex_destroy
(
&
mutex
);
tokudb_pthread_mutex_destroy
(
&
mutex
);
rwlock_destroy
(
&
num_DBs_lock
);
rwlock_destroy
(
&
num_DBs_lock
);
tokudb_pthread_cond_destroy
(
&
m_openclose_cond
);
tokudb_pthread_cond_destroy
(
&
m_openclose_cond
);
tokudb_my_free
(
rec_per_key
);
rec_per_key
=
NULL
;
}
}
// MUST have tokudb_mutex locked on input
// MUST have tokudb_mutex locked on input
static
TOKUDB_SHARE
*
get_share
(
const
char
*
table_name
,
TABLE_SHARE
*
table_share
)
{
static
TOKUDB_SHARE
*
get_share
(
const
char
*
table_name
,
TABLE_SHARE
*
table_share
)
{
TOKUDB_SHARE
*
share
=
NULL
;
TOKUDB_SHARE
*
share
=
NULL
;
int
error
=
0
;
int
error
=
0
;
uint
length
;
uint
length
=
(
uint
)
strlen
(
table_name
);
length
=
(
uint
)
strlen
(
table_name
);
if
(
!
(
share
=
(
TOKUDB_SHARE
*
)
my_hash_search
(
&
tokudb_open_tables
,
(
uchar
*
)
table_name
,
length
)))
{
if
(
!
(
share
=
(
TOKUDB_SHARE
*
)
my_hash_search
(
&
tokudb_open_tables
,
(
uchar
*
)
table_name
,
length
)))
{
char
*
tmp_name
;
char
*
tmp_name
;
//
// create share and fill it with all zeroes
// create share and fill it with all zeroes
// hence, all pointers are initialized to NULL
// hence, all pointers are initialized to NULL
//
share
=
(
TOKUDB_SHARE
*
)
tokudb_my_multi_malloc
(
MYF
(
MY_WME
|
MY_ZEROFILL
),
share
=
(
TOKUDB_SHARE
*
)
tokudb_my_multi_malloc
(
MYF
(
MY_WME
|
MY_ZEROFILL
),
&
share
,
sizeof
(
*
share
),
&
share
,
sizeof
(
*
share
),
&
tmp_name
,
length
+
1
,
&
tmp_name
,
length
+
1
,
...
@@ -1596,11 +1593,7 @@ exit:
...
@@ -1596,11 +1593,7 @@ exit:
return
ret_val
;
return
ret_val
;
}
}
int
ha_tokudb
::
initialize_share
(
int
ha_tokudb
::
initialize_share
(
const
char
*
name
,
int
mode
)
{
const
char
*
name
,
int
mode
)
{
int
error
=
0
;
int
error
=
0
;
uint64_t
num_rows
=
0
;
uint64_t
num_rows
=
0
;
DB_TXN
*
txn
=
NULL
;
DB_TXN
*
txn
=
NULL
;
...
@@ -1737,17 +1730,12 @@ int ha_tokudb::initialize_share(
...
@@ -1737,17 +1730,12 @@ int ha_tokudb::initialize_share(
init_hidden_prim_key_info
(
txn
);
init_hidden_prim_key_info
(
txn
);
// initialize cardinality info from the status dictionary
// initialize cardinality info from the status dictionary
{
share
->
n_rec_per_key
=
tokudb
::
compute_total_key_parts
(
table_share
);
uint
total_key_parts
=
tokudb
::
compute_total_key_parts
(
table_share
);
share
->
rec_per_key
=
(
uint64_t
*
)
tokudb_my_realloc
(
share
->
rec_per_key
,
share
->
n_rec_per_key
*
sizeof
(
uint64_t
),
MYF
(
MY_FAE
));
uint64_t
rec_per_key
[
total_key_parts
];
error
=
tokudb
::
get_card_from_status
(
share
->
status_block
,
txn
,
share
->
n_rec_per_key
,
share
->
rec_per_key
);
error
=
tokudb
::
get_card_from_status
(
share
->
status_block
,
txn
,
total_key_parts
,
rec_per_key
);
if
(
error
)
{
if
(
error
==
0
)
{
for
(
uint
i
=
0
;
i
<
share
->
n_rec_per_key
;
i
++
)
tokudb
::
set_card_in_key_info
(
table
,
total_key_parts
,
rec_per_key
);
share
->
rec_per_key
[
i
]
=
0
;
}
else
{
for
(
uint
i
=
0
;
i
<
total_key_parts
;
i
++
)
rec_per_key
[
i
]
=
0
;
tokudb
::
set_card_in_key_info
(
table
,
total_key_parts
,
rec_per_key
);
}
}
}
error
=
0
;
error
=
0
;
...
@@ -5943,6 +5931,7 @@ int ha_tokudb::info(uint flag) {
...
@@ -5943,6 +5931,7 @@ int ha_tokudb::info(uint flag) {
}
}
if
((
flag
&
HA_STATUS_CONST
))
{
if
((
flag
&
HA_STATUS_CONST
))
{
stats
.
max_data_file_length
=
9223372036854775807ULL
;
stats
.
max_data_file_length
=
9223372036854775807ULL
;
tokudb
::
set_card_in_key_info
(
table
,
share
->
n_rec_per_key
,
share
->
rec_per_key
);
}
}
/* Don't return key if we got an error for the internal primary key */
/* Don't return key if we got an error for the internal primary key */
...
...
storage/tokudb/ha_tokudb.h
View file @
0e6a4915
...
@@ -184,6 +184,9 @@ public:
...
@@ -184,6 +184,9 @@ public:
enum
{
CLOSED
,
OPENING
,
OPENED
,
CLOSING
,
ERROR
}
m_state
;
enum
{
CLOSED
,
OPENING
,
OPENED
,
CLOSING
,
ERROR
}
m_state
;
int
m_error
;
int
m_error
;
int
m_initialize_count
;
int
m_initialize_count
;
uint
n_rec_per_key
;
uint64_t
*
rec_per_key
;
};
};
typedef
struct
st_filter_key_part_info
{
typedef
struct
st_filter_key_part_info
{
...
...
storage/tokudb/ha_tokudb_admin.cc
View file @
0e6a4915
...
@@ -133,7 +133,7 @@ int ha_tokudb::analyze(THD *thd, HA_CHECK_OPT *check_opt) {
...
@@ -133,7 +133,7 @@ int ha_tokudb::analyze(THD *thd, HA_CHECK_OPT *check_opt) {
int
result
=
HA_ADMIN_OK
;
int
result
=
HA_ADMIN_OK
;
// stub out analyze if optimize is remapped to alter recreate + analyze
// 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
);
TOKUDB_HANDLER_DBUG_RETURN
(
result
);
}
}
...
...
storage/tokudb/hatoku_defines.h
View file @
0e6a4915
...
@@ -441,6 +441,8 @@ static inline void *tokudb_my_malloc(size_t s, myf flags) {
...
@@ -441,6 +441,8 @@ static inline void *tokudb_my_malloc(size_t s, myf flags) {
}
}
static
inline
void
*
tokudb_my_realloc
(
void
*
p
,
size_t
s
,
myf
flags
)
{
static
inline
void
*
tokudb_my_realloc
(
void
*
p
,
size_t
s
,
myf
flags
)
{
if
(
s
==
0
)
return
p
;
#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799
#if 50700 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 50799
return
my_realloc
(
0
,
p
,
s
,
flags
);
return
my_realloc
(
0
,
p
,
s
,
flags
);
#else
#else
...
@@ -449,7 +451,8 @@ static inline void *tokudb_my_realloc(void *p, size_t s, myf flags) {
...
@@ -449,7 +451,8 @@ static inline void *tokudb_my_realloc(void *p, size_t s, myf flags) {
}
}
static
inline
void
tokudb_my_free
(
void
*
ptr
)
{
static
inline
void
tokudb_my_free
(
void
*
ptr
)
{
my_free
(
ptr
);
if
(
ptr
)
my_free
(
ptr
);
}
}
static
inline
char
*
tokudb_my_strdup
(
const
char
*
p
,
myf
flags
)
{
static
inline
char
*
tokudb_my_strdup
(
const
char
*
p
,
myf
flags
)
{
...
...
storage/tokudb/tokudb_card.h
View file @
0e6a4915
...
@@ -217,7 +217,7 @@ namespace tokudb {
...
@@ -217,7 +217,7 @@ namespace tokudb {
// For each key part, put records per key part in *rec_per_key_part[key_part_index].
// For each key part, put records per key part in *rec_per_key_part[key_part_index].
// Returns 0 if success, otherwise an error number.
// Returns 0 if success, otherwise an error number.
// TODO statistical dives into the FT
// TODO statistical dives into the FT
int
analyze_card
(
DB
*
db
,
DB_TXN
*
txn
,
bool
is_unique
__attribute__
((
unused
))
,
uint64_t
num_key_parts
,
uint64_t
*
rec_per_key_part
,
int
analyze_card
(
DB
*
db
,
DB_TXN
*
txn
,
bool
is_unique
,
uint64_t
num_key_parts
,
uint64_t
*
rec_per_key_part
,
int
(
*
key_compare
)(
DB
*
,
const
DBT
*
,
const
DBT
*
,
uint
),
int
(
*
key_compare
)(
DB
*
,
const
DBT
*
,
const
DBT
*
,
uint
),
int
(
*
analyze_progress
)(
void
*
extra
,
uint64_t
rows
),
void
*
progress_extra
)
{
int
(
*
analyze_progress
)(
void
*
extra
,
uint64_t
rows
),
void
*
progress_extra
)
{
int
error
=
0
;
int
error
=
0
;
...
...
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