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
7b05650c
Commit
7b05650c
authored
Jun 03, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Plain Diff
Merge tag 'tokudb-engine/tokudb-7.5.7' into 5.5
parents
e500c471
b6089fb3
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
262 additions
and
74 deletions
+262
-74
.gitignore
.gitignore
+1
-0
mysql-test/suite/tokudb.bugs/r/db805.result
mysql-test/suite/tokudb.bugs/r/db805.result
+18
-0
mysql-test/suite/tokudb.bugs/r/db806.result
mysql-test/suite/tokudb.bugs/r/db806.result
+9
-0
mysql-test/suite/tokudb.bugs/r/db811.result
mysql-test/suite/tokudb.bugs/r/db811.result
+14
-0
mysql-test/suite/tokudb.bugs/r/db811s.result
mysql-test/suite/tokudb.bugs/r/db811s.result
+14
-0
mysql-test/suite/tokudb.bugs/r/db823.result
mysql-test/suite/tokudb.bugs/r/db823.result
+11
-0
mysql-test/suite/tokudb.bugs/t/db805.test
mysql-test/suite/tokudb.bugs/t/db805.test
+17
-0
mysql-test/suite/tokudb.bugs/t/db806.test
mysql-test/suite/tokudb.bugs/t/db806.test
+13
-0
mysql-test/suite/tokudb.bugs/t/db811.test
mysql-test/suite/tokudb.bugs/t/db811.test
+22
-0
mysql-test/suite/tokudb.bugs/t/db811s.test
mysql-test/suite/tokudb.bugs/t/db811s.test
+22
-0
mysql-test/suite/tokudb.bugs/t/db823.test
mysql-test/suite/tokudb.bugs/t/db823.test
+16
-0
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+37
-30
storage/tokudb/ha_tokudb_admin.cc
storage/tokudb/ha_tokudb_admin.cc
+13
-5
storage/tokudb/ha_tokudb_alter_56.cc
storage/tokudb/ha_tokudb_alter_56.cc
+9
-6
storage/tokudb/hatoku_defines.h
storage/tokudb/hatoku_defines.h
+1
-0
storage/tokudb/hatoku_hton.cc
storage/tokudb/hatoku_hton.cc
+15
-3
storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result
...mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result
+5
-5
storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result
.../mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result
+3
-3
storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result
storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result
+5
-5
storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test
...b/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test
+5
-5
storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test
...db/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test
+3
-3
storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test
storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test
+5
-5
storage/tokudb/mysql-test/tokudb_bugs/r/tokudb718.result
storage/tokudb/mysql-test/tokudb_bugs/r/tokudb718.result
+3
-2
storage/tokudb/mysql-test/tokudb_bugs/t/tokudb718.test
storage/tokudb/mysql-test/tokudb_bugs/t/tokudb718.test
+1
-2
No files found.
.gitignore
View file @
7b05650c
...
...
@@ -193,6 +193,7 @@ storage/tokudb/ft-index/tools/tokudb_dump
storage/tokudb/ft-index/tools/tokudb_gen
storage/tokudb/ft-index/tools/tokudb_load
storage/tokudb/ft-index/tools/tokuftdump
storage/tokudb/ft-index/tools/tokuft_logprint
storage/tokudb/ft-index/ft/ftverify
storage/tokudb/ft-index/ft/tdb-recover
storage/tokudb/ft-index/ft/tdb_logprint
...
...
mysql-test/suite/tokudb.bugs/r/db805.result
0 → 100644
View file @
7b05650c
drop table if exists t1,t3;
create table t3(a3 int,b3 decimal(0,0),c3 int,d3 int,primary key(a3,b3)) engine=TOKUDB;
LOCK TABLES t3 WRITE;
create temporary table t1(f1 int,index(f1)) engine=innodb;
INSERT INTO t1 VALUES(1),(1),(1);
select * from t1;
f1
1
1
1
ALTER TABLE t1 engine=TOKUDB;
select * from t1;
f1
1
1
1
unlock tables;
drop table t1,t3;
mysql-test/suite/tokudb.bugs/r/db806.result
0 → 100644
View file @
7b05650c
drop table if exists t1,t3;
CREATE TABLE t3(a int,c int,d int)engine=TOKUDB;
lock table t3 read;
create temporary table t1 engine=tokudb as SELECT 1;
select * from t1;
1
1
unlock tables;
drop table t1,t3;
mysql-test/suite/tokudb.bugs/r/db811.result
0 → 100644
View file @
7b05650c
drop table if exists t2,t3,t4;
CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB;
CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb;
CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 13;
LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE;
INSERT INTO t2(a)VALUES (REPEAT(0,1));
ALTER TABLE t2 ADD COLUMN(c INT);
alter table t4 add column c int;
UPDATE t2 SET a=1;
select * from t2;
a b c
1 NULL NULL
unlock tables;
drop table t2,t3,t4;
mysql-test/suite/tokudb.bugs/r/db811s.result
0 → 100644
View file @
7b05650c
drop table if exists t2,t3,t4;
CREATE TABLE t3(a INT,b INT,UNIQUE KEY (a,b)) engine=TOKUDB;
CREATE TABLE t4(c1 FLOAT ZEROFILL) engine=innodb;
CREATE TABLE t2(a int KEY,b CHAR (1)) engine=TOKUDB PARTITION BY HASH (a) PARTITIONS 1;
LOCK TABLES t4 WRITE,t3 WRITE,t2 WRITE;
INSERT INTO t2(a)VALUES (REPEAT(0,1));
ALTER TABLE t2 ADD COLUMN(c INT);
alter table t4 add column c int;
UPDATE t2 SET a=1;
select * from t2;
a b c
1 NULL NULL
unlock tables;
drop table t2,t3,t4;
mysql-test/suite/tokudb.bugs/r/db823.result
0 → 100644
View file @
7b05650c
drop table if exists s,t;
create table s (id int) engine=tokudb;
lock tables s write;
create temporary table t (id int, key(id)) engine=innodb;
insert into t values (1);
alter table t engine=tokudb;
select * from t;
id
1
unlock tables;
drop table s, t;
mysql-test/suite/tokudb.bugs/t/db805.test
0 → 100644
View file @
7b05650c
# DB-805 test that conversion of t1 from innodb to tokudb can write rows
source
include
/
have_tokudb
.
inc
;
source
include
/
have_innodb
.
inc
;
disable_warnings
;
drop
table
if
exists
t1
,
t3
;
enable_warnings
;
create
table
t3
(
a3
int
,
b3
decimal
(
0
,
0
),
c3
int
,
d3
int
,
primary
key
(
a3
,
b3
))
engine
=
TOKUDB
;
LOCK
TABLES
t3
WRITE
;
create
temporary
table
t1
(
f1
int
,
index
(
f1
))
engine
=
innodb
;
INSERT
INTO
t1
VALUES
(
1
),(
1
),(
1
);
select
*
from
t1
;
ALTER
TABLE
t1
engine
=
TOKUDB
;
select
*
from
t1
;
unlock
tables
;
drop
table
t1
,
t3
;
mysql-test/suite/tokudb.bugs/t/db806.test
0 → 100644
View file @
7b05650c
# DB-806 test that lock tables and create select can write rows to the new table
source
include
/
have_tokudb
.
inc
;
disable_warnings
;
drop
table
if
exists
t1
,
t3
;
enable_warnings
;
CREATE
TABLE
t3
(
a
int
,
c
int
,
d
int
)
engine
=
TOKUDB
;
lock
table
t3
read
;
create
temporary
table
t1
engine
=
tokudb
as
SELECT
1
;
select
*
from
t1
;
unlock
tables
;
drop
table
t1
,
t3
;
\ No newline at end of file
mysql-test/suite/tokudb.bugs/t/db811.test
0 → 100644
View file @
7b05650c
# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files)
source
include
/
have_tokudb
.
inc
;
source
include
/
have_innodb
.
inc
;
source
include
/
have_partition
.
inc
;
disable_warnings
;
drop
table
if
exists
t2
,
t3
,
t4
;
enable_warnings
;
CREATE
TABLE
t3
(
a
INT
,
b
INT
,
UNIQUE
KEY
(
a
,
b
))
engine
=
TOKUDB
;
CREATE
TABLE
t4
(
c1
FLOAT
ZEROFILL
)
engine
=
innodb
;
CREATE
TABLE
t2
(
a
int
KEY
,
b
CHAR
(
1
))
engine
=
TOKUDB
PARTITION
BY
HASH
(
a
)
PARTITIONS
13
;
LOCK
TABLES
t4
WRITE
,
t3
WRITE
,
t2
WRITE
;
INSERT
INTO
t2
(
a
)
VALUES
(
REPEAT
(
0
,
1
));
ALTER
TABLE
t2
ADD
COLUMN
(
c
INT
);
alter
table
t4
add
column
c
int
;
UPDATE
t2
SET
a
=
1
;
select
*
from
t2
;
unlock
tables
;
drop
table
t2
,
t3
,
t4
;
mysql-test/suite/tokudb.bugs/t/db811s.test
0 → 100644
View file @
7b05650c
# DB-811 test that alter table t2 updates both the schema (FRM) and the data (tokudb files)
source
include
/
have_tokudb
.
inc
;
source
include
/
have_innodb
.
inc
;
source
include
/
have_partition
.
inc
;
disable_warnings
;
drop
table
if
exists
t2
,
t3
,
t4
;
enable_warnings
;
CREATE
TABLE
t3
(
a
INT
,
b
INT
,
UNIQUE
KEY
(
a
,
b
))
engine
=
TOKUDB
;
CREATE
TABLE
t4
(
c1
FLOAT
ZEROFILL
)
engine
=
innodb
;
CREATE
TABLE
t2
(
a
int
KEY
,
b
CHAR
(
1
))
engine
=
TOKUDB
PARTITION
BY
HASH
(
a
)
PARTITIONS
1
;
LOCK
TABLES
t4
WRITE
,
t3
WRITE
,
t2
WRITE
;
INSERT
INTO
t2
(
a
)
VALUES
(
REPEAT
(
0
,
1
));
ALTER
TABLE
t2
ADD
COLUMN
(
c
INT
);
alter
table
t4
add
column
c
int
;
UPDATE
t2
SET
a
=
1
;
select
*
from
t2
;
unlock
tables
;
drop
table
t2
,
t3
,
t4
;
mysql-test/suite/tokudb.bugs/t/db823.test
0 → 100644
View file @
7b05650c
# test DB-823
# test that the conversion of table t from innodb to tokudb succeeds.
source
include
/
have_tokudb
.
inc
;
source
include
/
have_innodb
.
inc
;
disable_warnings
;
drop
table
if
exists
s
,
t
;
enable_warnings
;
create
table
s
(
id
int
)
engine
=
tokudb
;
lock
tables
s
write
;
create
temporary
table
t
(
id
int
,
key
(
id
))
engine
=
innodb
;
insert
into
t
values
(
1
);
alter
table
t
engine
=
tokudb
;
select
*
from
t
;
unlock
tables
;
drop
table
s
,
t
;
storage/tokudb/ha_tokudb.cc
View file @
7b05650c
...
...
@@ -6207,6 +6207,12 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) {
if
(
error
)
{
goto
cleanup
;
}
thd_set_ha_data
(
thd
,
tokudb_hton
,
trx
);
}
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
{
TOKUDB_HANDLER_TRACE
(
"trx %p %p %p %p %u %u"
,
trx
->
all
,
trx
->
stmt
,
trx
->
sp_level
,
trx
->
sub_sp_level
,
trx
->
tokudb_lock_count
,
trx
->
create_lock_count
);
}
if
(
trx
->
all
==
NULL
)
{
trx
->
sp_level
=
NULL
;
}
...
...
@@ -6215,22 +6221,16 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) {
if
(
lock_type
==
F_WRLCK
)
{
use_write_locks
=
true
;
}
if
(
!
trx
->
tokudb_lock_count
++
)
{
if
(
trx
->
stmt
)
{
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
{
TOKUDB_HANDLER_TRACE
(
"stmt already set %p %p %p %p"
,
trx
->
all
,
trx
->
stmt
,
trx
->
sp_level
,
trx
->
sub_sp_level
);
}
}
else
{
assert
(
trx
->
stmt
==
0
);
transaction
=
NULL
;
// Safety
error
=
create_txn
(
thd
,
trx
);
if
(
error
)
{
trx
->
tokudb_lock_count
--
;
// We didn't get the lock
goto
cleanup
;
}
if
(
!
trx
->
stmt
)
{
transaction
=
NULL
;
// Safety
error
=
create_txn
(
thd
,
trx
);
if
(
error
)
{
goto
cleanup
;
}
trx
->
create_lock_count
=
trx
->
tokudb_lock_count
;
}
transaction
=
trx
->
sub_sp_level
;
trx
->
tokudb_lock_count
++
;
}
else
{
tokudb_pthread_mutex_lock
(
&
share
->
mutex
);
...
...
@@ -6245,21 +6245,24 @@ int ha_tokudb::external_lock(THD * thd, int lock_type) {
added_rows
=
0
;
deleted_rows
=
0
;
share
->
rows_from_locked_table
=
0
;
if
(
trx
->
tokudb_lock_count
>
0
&&
!--
trx
->
tokudb_lock_count
)
{
if
(
trx
->
stmt
)
{
/*
F_UNLCK is done without a transaction commit / rollback.
This happens if the thread didn't update any rows
We must in this case commit the work to keep the row locks
*/
DBUG_PRINT
(
"trans"
,
(
"commiting non-updating transaction"
));
reset_stmt_progress
(
&
trx
->
stmt_progress
);
commit_txn
(
trx
->
stmt
,
0
);
trx
->
stmt
=
NULL
;
trx
->
sub_sp_level
=
NULL
;
if
(
trx
->
tokudb_lock_count
>
0
)
{
if
(
--
trx
->
tokudb_lock_count
<=
trx
->
create_lock_count
)
{
trx
->
create_lock_count
=
0
;
if
(
trx
->
stmt
)
{
/*
F_UNLCK is done without a transaction commit / rollback.
This happens if the thread didn't update any rows
We must in this case commit the work to keep the row locks
*/
DBUG_PRINT
(
"trans"
,
(
"commiting non-updating transaction"
));
reset_stmt_progress
(
&
trx
->
stmt_progress
);
commit_txn
(
trx
->
stmt
,
0
);
trx
->
stmt
=
NULL
;
trx
->
sub_sp_level
=
NULL
;
}
}
transaction
=
NULL
;
}
transaction
=
NULL
;
}
cleanup:
if
(
tokudb_debug
&
TOKUDB_DEBUG_LOCK
)
...
...
@@ -6274,8 +6277,9 @@ cleanup:
*/
int
ha_tokudb
::
start_stmt
(
THD
*
thd
,
thr_lock_type
lock_type
)
{
TOKUDB_HANDLER_DBUG_ENTER
(
"cmd %d lock %d %s"
,
thd_sql_command
(
thd
),
lock_type
,
share
->
table_name
);
if
(
0
)
if
(
tokudb_debug
&
TOKUDB_DEBUG_LOCK
)
{
TOKUDB_HANDLER_TRACE
(
"q %s"
,
thd
->
query
());
}
int
error
=
0
;
tokudb_trx_data
*
trx
=
(
tokudb_trx_data
*
)
thd_get_ha_data
(
thd
,
tokudb_hton
);
...
...
@@ -6285,6 +6289,11 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) {
thd_set_ha_data
(
thd
,
tokudb_hton
,
trx
);
}
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
{
TOKUDB_HANDLER_TRACE
(
"trx %p %p %p %p %u %u"
,
trx
->
all
,
trx
->
stmt
,
trx
->
sp_level
,
trx
->
sub_sp_level
,
trx
->
tokudb_lock_count
,
trx
->
create_lock_count
);
}
/*
note that trx->stmt may have been already initialized as start_stmt()
is called for *each table* not for each storage engine,
...
...
@@ -6295,9 +6304,7 @@ int ha_tokudb::start_stmt(THD * thd, thr_lock_type lock_type) {
if
(
error
)
{
goto
cleanup
;
}
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
{
TOKUDB_HANDLER_TRACE
(
"%p %p %p %p %u"
,
trx
->
all
,
trx
->
stmt
,
trx
->
sp_level
,
trx
->
sub_sp_level
,
trx
->
tokudb_lock_count
);
}
trx
->
create_lock_count
=
trx
->
tokudb_lock_count
;
}
else
{
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
{
...
...
storage/tokudb/ha_tokudb_admin.cc
View file @
7b05650c
...
...
@@ -121,9 +121,10 @@ static int analyze_progress(void *v_extra, uint64_t rows) {
progress_time
=
(
float
)
(
t_now
-
t_start
)
/
(
float
)
t_limit
;
char
*
write_status_msg
=
extra
->
write_status_msg
;
TABLE_SHARE
*
table_share
=
extra
->
table_share
;
sprintf
(
write_status_msg
,
"%s.%s.%s %u of %u %.lf%% rows %.lf%% time"
,
table_share
->
db
.
str
,
table_share
->
table_name
.
str
,
extra
->
key_name
,
extra
->
key_i
,
table_share
->
keys
,
progress_rows
*
100.0
,
progress_time
*
100.0
);
sprintf
(
write_status_msg
,
"%.*s.%.*s.%s %u of %u %.lf%% rows %.lf%% time"
,
(
int
)
table_share
->
db
.
length
,
table_share
->
db
.
str
,
(
int
)
table_share
->
table_name
.
length
,
table_share
->
table_name
.
str
,
extra
->
key_name
,
extra
->
key_i
,
table_share
->
keys
,
progress_rows
*
100.0
,
progress_time
*
100.0
);
thd_proc_info
(
thd
,
write_status_msg
);
return
0
;
}
...
...
@@ -338,8 +339,10 @@ static int ha_tokudb_check_progress(void *extra, float progress) {
static
void
ha_tokudb_check_info
(
THD
*
thd
,
TABLE
*
table
,
const
char
*
msg
)
{
if
(
thd
->
vio_ok
())
{
char
tablename
[
256
];
snprintf
(
tablename
,
sizeof
tablename
,
"%s.%s"
,
table
->
s
->
db
.
str
,
table
->
s
->
table_name
.
str
);
char
tablename
[
table
->
s
->
db
.
length
+
1
+
table
->
s
->
table_name
.
length
+
1
];
snprintf
(
tablename
,
sizeof
tablename
,
"%.*s.%.*s"
,
(
int
)
table
->
s
->
db
.
length
,
table
->
s
->
db
.
str
,
(
int
)
table
->
s
->
table_name
.
length
,
table
->
s
->
table_name
.
str
);
thd
->
protocol
->
prepare_for_resend
();
thd
->
protocol
->
store
(
tablename
,
strlen
(
tablename
),
system_charset_info
);
thd
->
protocol
->
store
(
"check"
,
5
,
system_charset_info
);
...
...
@@ -388,6 +391,11 @@ int ha_tokudb::check(THD *thd, HA_CHECK_OPT *check_opt) {
}
struct
check_context
check_context
=
{
thd
};
r
=
db
->
verify_with_progress
(
db
,
ha_tokudb_check_progress
,
&
check_context
,
(
tokudb_debug
&
TOKUDB_DEBUG_CHECK
)
!=
0
,
keep_going
);
if
(
r
!=
0
)
{
char
msg
[
32
+
strlen
(
kname
)];
sprintf
(
msg
,
"Corrupt %s"
,
kname
);
ha_tokudb_check_info
(
thd
,
table
,
msg
);
}
snprintf
(
write_status_msg
,
sizeof
write_status_msg
,
"%s key=%s %u result=%d"
,
share
->
table_name
,
kname
,
i
,
r
);
thd_proc_info
(
thd
,
write_status_msg
);
if
(
tokudb_debug
&
TOKUDB_DEBUG_CHECK
)
{
...
...
storage/tokudb/ha_tokudb_alter_56.cc
View file @
7b05650c
...
...
@@ -784,13 +784,16 @@ bool ha_tokudb::commit_inplace_alter_table(TABLE *altered_table, Alter_inplace_i
assert
(
trx
->
tokudb_lock_count
>
0
);
// for partitioned tables, we use a single transaction to do all of the partition changes. the tokudb_lock_count
// is a reference count for each of the handlers to the same transaction. obviously, we want to only abort once.
if
(
!--
trx
->
tokudb_lock_count
)
{
abort_txn
(
ctx
->
alter_txn
);
ctx
->
alter_txn
=
NULL
;
trx
->
stmt
=
NULL
;
trx
->
sub_sp_level
=
NULL
;
if
(
trx
->
tokudb_lock_count
>
0
)
{
if
(
--
trx
->
tokudb_lock_count
<=
trx
->
create_lock_count
)
{
trx
->
create_lock_count
=
0
;
abort_txn
(
ctx
->
alter_txn
);
ctx
->
alter_txn
=
NULL
;
trx
->
stmt
=
NULL
;
trx
->
sub_sp_level
=
NULL
;
}
transaction
=
NULL
;
}
transaction
=
NULL
;
if
(
ctx
->
add_index_changed
)
{
restore_add_index
(
table
,
ha_alter_info
->
index_add_count
,
ctx
->
incremented_num_DBs
,
ctx
->
modified_DBs
);
...
...
storage/tokudb/hatoku_defines.h
View file @
7b05650c
...
...
@@ -355,6 +355,7 @@ typedef struct st_tokudb_trx_data {
DB_TXN
*
sp_level
;
DB_TXN
*
sub_sp_level
;
uint
tokudb_lock_count
;
uint
create_lock_count
;
tokudb_stmt_progress
stmt_progress
;
bool
checkpoint_lock_taken
;
LIST
*
handlers
;
...
...
storage/tokudb/hatoku_hton.cc
View file @
7b05650c
...
...
@@ -1724,6 +1724,8 @@ static int tokudb_fractal_tree_info(TABLE *table, THD *thd) {
error
=
tmp_cursor
->
c_get
(
tmp_cursor
,
&
curr_key
,
&
curr_val
,
DB_NEXT
);
if
(
!
error
)
{
error
=
tokudb_report_fractal_tree_info_for_db
(
&
curr_key
,
&
curr_val
,
table
,
thd
);
if
(
error
)
error
=
0
;
// ignore read uncommitted errors
}
if
(
!
error
&&
thd_killed
(
thd
))
error
=
ER_QUERY_INTERRUPTED
;
...
...
@@ -2002,7 +2004,9 @@ struct tokudb_search_txn_extra {
uint64_t
match_client_id
;
};
static
int
tokudb_search_txn_callback
(
uint64_t
txn_id
,
uint64_t
client_id
,
iterate_row_locks_callback
iterate_locks
,
void
*
locks_extra
,
void
*
extra
)
{
static
int
tokudb_search_txn_callback
(
DB_TXN
*
txn
,
iterate_row_locks_callback
iterate_locks
,
void
*
locks_extra
,
void
*
extra
)
{
uint64_t
txn_id
=
txn
->
id64
(
txn
);
uint64_t
client_id
=
txn
->
get_client_id
(
txn
);
struct
tokudb_search_txn_extra
*
e
=
reinterpret_cast
<
struct
tokudb_search_txn_extra
*>
(
extra
);
if
(
e
->
match_txn_id
==
txn_id
)
{
e
->
match_found
=
true
;
...
...
@@ -2134,6 +2138,7 @@ static struct st_mysql_information_schema tokudb_trx_information_schema = { MYSQ
static
ST_FIELD_INFO
tokudb_trx_field_info
[]
=
{
{
"trx_id"
,
0
,
MYSQL_TYPE_LONGLONG
,
0
,
0
,
NULL
,
SKIP_OPEN_TABLE
},
{
"trx_mysql_thread_id"
,
0
,
MYSQL_TYPE_LONGLONG
,
0
,
0
,
NULL
,
SKIP_OPEN_TABLE
},
{
"trx_time"
,
0
,
MYSQL_TYPE_LONGLONG
,
0
,
0
,
NULL
,
SKIP_OPEN_TABLE
},
{
NULL
,
0
,
MYSQL_TYPE_NULL
,
0
,
0
,
NULL
,
SKIP_OPEN_TABLE
}
};
...
...
@@ -2142,12 +2147,17 @@ struct tokudb_trx_extra {
TABLE
*
table
;
};
static
int
tokudb_trx_callback
(
uint64_t
txn_id
,
uint64_t
client_id
,
iterate_row_locks_callback
iterate_locks
,
void
*
locks_extra
,
void
*
extra
)
{
static
int
tokudb_trx_callback
(
DB_TXN
*
txn
,
iterate_row_locks_callback
iterate_locks
,
void
*
locks_extra
,
void
*
extra
)
{
uint64_t
txn_id
=
txn
->
id64
(
txn
);
uint64_t
client_id
=
txn
->
get_client_id
(
txn
);
uint64_t
start_time
=
txn
->
get_start_time
(
txn
);
struct
tokudb_trx_extra
*
e
=
reinterpret_cast
<
struct
tokudb_trx_extra
*>
(
extra
);
THD
*
thd
=
e
->
thd
;
TABLE
*
table
=
e
->
table
;
table
->
field
[
0
]
->
store
(
txn_id
,
false
);
table
->
field
[
1
]
->
store
(
client_id
,
false
);
uint64_t
tnow
=
(
uint64_t
)
time
(
NULL
);
table
->
field
[
2
]
->
store
(
tnow
>=
start_time
?
tnow
-
start_time
:
0
,
false
);
int
error
=
schema_table_store_record
(
thd
,
table
);
if
(
!
error
&&
thd_killed
(
thd
))
error
=
ER_QUERY_INTERRUPTED
;
...
...
@@ -2295,7 +2305,9 @@ struct tokudb_locks_extra {
TABLE
*
table
;
};
static
int
tokudb_locks_callback
(
uint64_t
txn_id
,
uint64_t
client_id
,
iterate_row_locks_callback
iterate_locks
,
void
*
locks_extra
,
void
*
extra
)
{
static
int
tokudb_locks_callback
(
DB_TXN
*
txn
,
iterate_row_locks_callback
iterate_locks
,
void
*
locks_extra
,
void
*
extra
)
{
uint64_t
txn_id
=
txn
->
id64
(
txn
);
uint64_t
client_id
=
txn
->
get_client_id
(
txn
);
struct
tokudb_locks_extra
*
e
=
reinterpret_cast
<
struct
tokudb_locks_extra
*>
(
extra
);
THD
*
thd
=
e
->
thd
;
TABLE
*
table
=
e
->
table
;
...
...
storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_released.result
View file @
7b05650c
...
...
@@ -2,7 +2,7 @@ set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
drop table if exists t;
create table t (id int primary key);
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
...
...
@@ -19,7 +19,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TRX_ID MYSQL_ID
TRX_ID MYSQL_ID
...
...
@@ -31,7 +31,7 @@ select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
commit;
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
...
...
@@ -48,7 +48,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TRX_ID MYSQL_ID
TRX_ID MYSQL_ID
...
...
@@ -59,7 +59,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
commit;
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
...
...
storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_lock_waits_timeout.result
View file @
7b05650c
...
...
@@ -2,7 +2,7 @@ set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
drop table if exists t;
create table t (id int primary key);
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
...
...
@@ -19,7 +19,7 @@ TRX_ID MYSQL_ID ./test/t-main 0001000000 0001000000 test t main
select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
REQUEST_TRX_ID BLOCK_TRX_ID ./test/t-main 0001000000 0001000000 LOCK_WAITS_START_TIME test t main
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TRX_ID MYSQL_ID
TRX_ID MYSQL_ID
...
...
@@ -30,7 +30,7 @@ select * from information_schema.tokudb_lock_waits;
requesting_trx_id blocking_trx_id lock_waits_dname lock_waits_key_left lock_waits_key_right lock_waits_start_time lock_waits_table_schema lock_waits_table_name lock_waits_table_dictionary_name
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
commit;
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
select * from information_schema.tokudb_locks;
locks_trx_id locks_mysql_thread_id locks_dname locks_key_left locks_key_right locks_table_schema locks_table_name locks_table_dictionary_name
...
...
storage/tokudb/mysql-test/tokudb/r/i_s_tokudb_trx.result
View file @
7b05650c
set default_storage_engine='tokudb';
set tokudb_prelock_empty=false;
drop table if exists t;
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
set autocommit=0;
create table t (id int primary key);
insert into t values (1);
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TXN_ID_DEFAULT CLIENT_ID_DEFAULT
commit;
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
set autocommit=0;
insert into t values (2);
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
TXN_ID_A CLIENT_ID_A
commit;
select
*
from information_schema.tokudb_trx;
select
trx_id,trx_mysql_thread_id
from information_schema.tokudb_trx;
trx_id trx_mysql_thread_id
drop table t;
storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_released.test
View file @
7b05650c
...
...
@@ -13,7 +13,7 @@ create table t (id int primary key);
# verify that txn_a insert (1) blocks txn_b insert (1) and txn_b gets a duplicate key error
# should be empty
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
...
...
@@ -43,7 +43,7 @@ select * from information_schema.tokudb_lock_waits;
# should find the presence of two transactions
replace_column
1
TRX_ID
2
MYSQL_ID
;
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
connection
conn_a
;
commit
;
...
...
@@ -66,7 +66,7 @@ disconnect conn_b;
# verify that the lock on the 2nd transaction has been released
# should be be empty
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
...
...
@@ -96,7 +96,7 @@ select * from information_schema.tokudb_lock_waits;
# should find the presence of two transactions
replace_column
1
TRX_ID
2
MYSQL_ID
;
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
connection
conn_a
;
commit
;
...
...
@@ -116,7 +116,7 @@ disconnect conn_b;
# verify that the lock on the 2nd transaction has been released
# should be be empty
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
...
...
storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_lock_waits_timeout.test
View file @
7b05650c
...
...
@@ -10,7 +10,7 @@ enable_warnings;
create
table
t
(
id
int
primary
key
);
# should be empty
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
...
...
@@ -40,7 +40,7 @@ select * from information_schema.tokudb_lock_waits;
# should find the presence of two transactions
replace_column
1
TRX_ID
2
MYSQL_ID
;
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
connection
conn_a
;
sleep
5
;
# sleep longer than the lock timer to force a lock timeout on txn_b
...
...
@@ -61,7 +61,7 @@ disconnect conn_a;
disconnect
conn_b
;
# should be be empty
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
select
*
from
information_schema
.
tokudb_locks
;
select
*
from
information_schema
.
tokudb_lock_waits
;
...
...
storage/tokudb/mysql-test/tokudb/t/i_s_tokudb_trx.test
View file @
7b05650c
...
...
@@ -8,7 +8,7 @@ drop table if exists t;
enable_warnings
;
# should be empty
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
# should have my txn
let
$default_id
=
`select connection_id()`
;
...
...
@@ -16,11 +16,11 @@ set autocommit=0;
create
table
t
(
id
int
primary
key
);
insert
into
t
values
(
1
);
replace_column
1
TXN_ID_DEFAULT
2
CLIENT_ID_DEFAULT
;
eval
select
*
from
information_schema
.
tokudb_trx
;
eval
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
# should be empty
commit
;
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
connect
(
conn_a
,
localhost
,
root
,,);
let
a_id
=
`select connection_id()`
;
...
...
@@ -29,13 +29,13 @@ insert into t values (2);
connection
default
;
replace_column
1
TXN_ID_A
2
CLIENT_ID_A
;
eval
select
*
from
information_schema
.
tokudb_trx
;
eval
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
connection
conn_a
;
commit
;
connection
default
;
# should be empty
select
*
from
information_schema
.
tokudb_trx
;
select
trx_id
,
trx_mysql_thread_id
from
information_schema
.
tokudb_trx
;
disconnect
conn_a
;
...
...
storage/tokudb/mysql-test/tokudb_bugs/r/tokudb718.result
View file @
7b05650c
...
...
@@ -3,7 +3,8 @@ drop table if exists t;
create table t (id int primary key);
begin;
insert into t values (1),(2);
select * from information_schema.tokudb_fractal_tree_info;
ERROR HY000: Got error -30994 from storage engine
select dictionary_name from information_schema.tokudb_fractal_tree_info;
dictionary_name
./test/t-status
commit;
drop table t;
storage/tokudb/mysql-test/tokudb_bugs/t/tokudb718.test
View file @
7b05650c
...
...
@@ -7,7 +7,6 @@ enable_warnings;
create
table
t
(
id
int
primary
key
);
begin
;
insert
into
t
values
(
1
),(
2
);
--
error
1030
select
*
from
information_schema
.
tokudb_fractal_tree_info
;
select
dictionary_name
from
information_schema
.
tokudb_fractal_tree_info
;
commit
;
drop
table
t
;
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