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
b3e5332e
Commit
b3e5332e
authored
Feb 03, 2015
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into releases/tokudb-7.5
parents
d8493f40
a06c7d6a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
13 deletions
+48
-13
README.md
README.md
+5
-4
mysql-test/suite/tokudb.bugs/r/5733_tokudb.result
mysql-test/suite/tokudb.bugs/r/5733_tokudb.result
+1
-1
mysql-test/suite/tokudb.bugs/t/5733_tokudb.test
mysql-test/suite/tokudb.bugs/t/5733_tokudb.test
+12
-1
scripts/make.mysql.bash
scripts/make.mysql.bash
+1
-0
storage/tokudb/ha_tokudb.cc
storage/tokudb/ha_tokudb.cc
+16
-4
storage/tokudb/hatoku_hton.cc
storage/tokudb/hatoku_hton.cc
+13
-3
No files found.
README.md
View file @
b3e5332e
...
...
@@ -30,14 +30,14 @@ working MySQL or MariaDB with Tokutek patches, and with the TokuDB storage
engine, called
`make.mysql.bash`
. This script will download copies of the
needed source code from github and build everything.
To build MySQL 5.5.4
0 with TokuDB 7.5.3
:
To build MySQL 5.5.4
1 with TokuDB 7.5.5
:
```
sh
scripts/make.mysql.bash
--mysqlbuild
=
mysql-5.5.4
0-tokudb-7.5.3
-linux-x86_64
scripts/make.mysql.bash
--mysqlbuild
=
mysql-5.5.4
1-tokudb-7.5.5
-linux-x86_64
```
To build MariaDB 5.5.4
0 with TokuDB 7.5.3
:
To build MariaDB 5.5.4
1 with TokuDB 7.5.5
:
```
sh
scripts/make.mysql.bash
--mysqlbuild
=
mariadb-5.5.4
0-tokudb-7.5.3
-linux-x86_64
scripts/make.mysql.bash
--mysqlbuild
=
mariadb-5.5.4
1-tokudb-7.5.5
-linux-x86_64
```
Before you start, make sure you have a C++11-compatible compiler (GCC >=
...
...
@@ -59,6 +59,7 @@ repositories, run this:
scripts/make.mysql.debug.env.bash
```
We use gcc from devtoolset-1.1 on CentOS 5.9 for builds.
Contribute
----------
...
...
mysql-test/suite/tokudb.bugs/r/5733_tokudb.result
View file @
b3e5332e
...
...
@@ -10003,7 +10003,7 @@ insert into t values (9998,0);
insert into t values (9999,0);
explain select id from t where id>0 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where; Using index
1 SIMPLE t range
_or_index
PRIMARY PRIMARY 8 NULL # Using where; Using index
explain select * from t where id>0 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t range PRIMARY PRIMARY 8 NULL # Using where
...
...
mysql-test/suite/tokudb.bugs/t/5733_tokudb.test
View file @
b3e5332e
...
...
@@ -18,7 +18,18 @@ while ($i < $n) {
inc
$i
;
}
replace_column
9
#;
# the plan for the following query should be a range scan. about 1 of 10 times,
# the plan is an index scan. the different scan type occurs because the query optimizer
# is handed different row counts by tokudb::records_in_range. the cost estimates made
# by the query optimizer are very close to begin with. sometimes, the cost of an index
# scan is less than the cost of a range scan.
#
# if a tokudb checkpoint occurs before this query is run, then the records_in_range
# function returns a larger than expected row estimate.
#
# column 4 is the join type (should be range or index)
# column 9 is the estimated key count
replace_column
4
range_or_index
9
#;
explain
select
id
from
t
where
id
>
0
limit
10
;
replace_column
9
#;
...
...
scripts/make.mysql.bash
View file @
b3e5332e
...
...
@@ -117,6 +117,7 @@ elif [ $build_type = enterprise ] ; then
github_download Tokutek/tokudb-backup-plugin
$(
git_tree
$git_tag
$backup_tree
)
tokudb-backup-plugin
mv
tokudb-backup-plugin plugin
github_download Tokutek/backup-enterprise
$(
git_tree
$git_tag
$backup_tree
)
backup-enterprise
rm
-rf
plugin/tokudb-backup-plugin/backup
mv
backup-enterprise/backup plugin/tokudb-backup-plugin
rm
-rf
backup-enterprise
fi
...
...
storage/tokudb/ha_tokudb.cc
View file @
b3e5332e
...
...
@@ -7154,12 +7154,15 @@ To rename the table, make sure no transactions touch the table.", from, to);
double
ha_tokudb
::
scan_time
()
{
TOKUDB_HANDLER_DBUG_ENTER
(
""
);
double
ret_val
=
(
double
)
stats
.
records
/
3
;
if
(
tokudb_debug
&
TOKUDB_DEBUG_RETURN
)
{
TOKUDB_HANDLER_TRACE
(
"return %"
PRIu64
" %f"
,
(
uint64_t
)
stats
.
records
,
ret_val
);
}
DBUG_RETURN
(
ret_val
);
}
double
ha_tokudb
::
keyread_time
(
uint
index
,
uint
ranges
,
ha_rows
rows
)
{
TOKUDB_HANDLER_DBUG_ENTER
(
"
"
);
TOKUDB_HANDLER_DBUG_ENTER
(
"
%u %u %"
PRIu64
,
index
,
ranges
,
(
uint64_t
)
rows
);
double
ret_val
;
if
(
index
==
primary_key
||
key_is_clustering
(
&
table
->
key_info
[
index
]))
{
ret_val
=
read_time
(
index
,
ranges
,
rows
);
...
...
@@ -7177,6 +7180,9 @@ double ha_tokudb::keyread_time(uint index, uint ranges, ha_rows rows)
(
table
->
key_info
[
index
].
key_length
+
ref_length
)
+
1
);
ret_val
=
(
rows
+
keys_per_block
-
1
)
/
keys_per_block
;
if
(
tokudb_debug
&
TOKUDB_DEBUG_RETURN
)
{
TOKUDB_HANDLER_TRACE
(
"return %f"
,
ret_val
);
}
DBUG_RETURN
(
ret_val
);
}
...
...
@@ -7197,7 +7203,7 @@ double ha_tokudb::read_time(
ha_rows
rows
)
{
TOKUDB_HANDLER_DBUG_ENTER
(
"
"
);
TOKUDB_HANDLER_DBUG_ENTER
(
"
%u %u %"
PRIu64
,
index
,
ranges
,
(
uint64_t
)
rows
);
double
total_scan
;
double
ret_val
;
bool
is_primary
=
(
index
==
primary_key
);
...
...
@@ -7239,12 +7245,18 @@ double ha_tokudb::read_time(
ret_val
=
is_clustering
?
ret_val
+
0.00001
:
ret_val
;
cleanup:
if
(
tokudb_debug
&
TOKUDB_DEBUG_RETURN
)
{
TOKUDB_HANDLER_TRACE
(
"return %f"
,
ret_val
);
}
DBUG_RETURN
(
ret_val
);
}
double
ha_tokudb
::
index_only_read_time
(
uint
keynr
,
double
records
)
{
TOKUDB_HANDLER_DBUG_ENTER
(
"
"
);
TOKUDB_HANDLER_DBUG_ENTER
(
"
%u %f"
,
keynr
,
records
);
double
ret_val
=
keyread_time
(
keynr
,
1
,
(
ha_rows
)
records
);
if
(
tokudb_debug
&
TOKUDB_DEBUG_RETURN
)
{
TOKUDB_HANDLER_TRACE
(
"return %f"
,
ret_val
);
}
DBUG_RETURN
(
ret_val
);
}
...
...
@@ -7319,7 +7331,7 @@ ha_rows ha_tokudb::records_in_range(uint keynr, key_range* start_key, key_range*
cleanup:
if
(
tokudb_debug
&
TOKUDB_DEBUG_RETURN
)
{
TOKUDB_HANDLER_TRACE
(
"%"
PRIu64
" %"
PRIu64
,
(
uint64_t
)
ret_val
,
rows
);
TOKUDB_HANDLER_TRACE
(
"
return
%"
PRIu64
" %"
PRIu64
,
(
uint64_t
)
ret_val
,
rows
);
}
DBUG_RETURN
(
ret_val
);
}
...
...
storage/tokudb/hatoku_hton.cc
View file @
b3e5332e
...
...
@@ -777,7 +777,7 @@ extern "C" enum durability_properties thd_get_durability_property(const MYSQL_TH
#endif
// Determine if an fsync is used when a transaction is committed.
static
bool
tokudb_
f
sync_on_commit
(
THD
*
thd
,
tokudb_trx_data
*
trx
,
DB_TXN
*
txn
)
{
static
bool
tokudb_sync_on_commit
(
THD
*
thd
,
tokudb_trx_data
*
trx
,
DB_TXN
*
txn
)
{
#if MYSQL_VERSION_ID >= 50600
// Check the client durability property which is set during 2PC
if
(
thd_get_durability_property
(
thd
)
==
HA_IGNORE_DURABILITY
)
...
...
@@ -788,6 +788,8 @@ static bool tokudb_fsync_on_commit(THD *thd, tokudb_trx_data *trx, DB_TXN *txn)
if
(
txn
->
is_prepared
(
txn
)
&&
mysql_bin_log
.
is_open
())
return
false
;
#endif
if
(
tokudb_fsync_log_period
>
0
)
return
false
;
return
THDVAR
(
thd
,
commit_sync
)
!=
0
;
}
...
...
@@ -798,7 +800,7 @@ static int tokudb_commit(handlerton * hton, THD * thd, bool all) {
DB_TXN
**
txn
=
all
?
&
trx
->
all
:
&
trx
->
stmt
;
DB_TXN
*
this_txn
=
*
txn
;
if
(
this_txn
)
{
uint32_t
syncflag
=
tokudb_
f
sync_on_commit
(
thd
,
trx
,
this_txn
)
?
0
:
DB_TXN_NOSYNC
;
uint32_t
syncflag
=
tokudb_sync_on_commit
(
thd
,
trx
,
this_txn
)
?
0
:
DB_TXN_NOSYNC
;
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
{
TOKUDB_TRACE
(
"commit trx %u txn %p syncflag %u"
,
all
,
this_txn
,
syncflag
);
}
...
...
@@ -849,6 +851,13 @@ static int tokudb_rollback(handlerton * hton, THD * thd, bool all) {
}
#if TOKU_INCLUDE_XA
static
bool
tokudb_sync_on_prepare
(
void
)
{
// skip sync of log if fsync log period > 0
if
(
tokudb_fsync_log_period
>
0
)
return
false
;
else
return
true
;
}
static
int
tokudb_xa_prepare
(
handlerton
*
hton
,
THD
*
thd
,
bool
all
)
{
TOKUDB_DBUG_ENTER
(
""
);
...
...
@@ -863,6 +872,7 @@ static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) {
tokudb_trx_data
*
trx
=
(
tokudb_trx_data
*
)
thd_get_ha_data
(
thd
,
hton
);
DB_TXN
*
txn
=
all
?
trx
->
all
:
trx
->
stmt
;
if
(
txn
)
{
uint32_t
syncflag
=
tokudb_sync_on_prepare
()
?
0
:
DB_TXN_NOSYNC
;
if
(
tokudb_debug
&
TOKUDB_DEBUG_TXN
)
{
TOKUDB_TRACE
(
"doing txn prepare:%d:%p"
,
all
,
txn
);
}
...
...
@@ -871,7 +881,7 @@ static int tokudb_xa_prepare(handlerton* hton, THD* thd, bool all) {
thd_get_xid
(
thd
,
(
MYSQL_XID
*
)
&
thd_xid
);
// test hook to induce a crash on a debug build
DBUG_EXECUTE_IF
(
"tokudb_crash_prepare_before"
,
DBUG_SUICIDE
(););
r
=
txn
->
xa_prepare
(
txn
,
&
thd_xid
);
r
=
txn
->
xa_prepare
(
txn
,
&
thd_xid
,
syncflag
);
// test hook to induce a crash on a debug build
DBUG_EXECUTE_IF
(
"tokudb_crash_prepare_after"
,
DBUG_SUICIDE
(););
}
...
...
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