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
eafc9d85
Commit
eafc9d85
authored
Oct 30, 2019
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-17171: RocksDB Tables do not have "Creation Date"
Temporarily revert the patch
parent
ad8266a5
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
74 additions
and
278 deletions
+74
-278
storage/rocksdb/ha_rocksdb.cc
storage/rocksdb/ha_rocksdb.cc
+0
-38
storage/rocksdb/mysql-test/rocksdb/include/bulk_load.inc
storage/rocksdb/mysql-test/rocksdb/include/bulk_load.inc
+2
-2
storage/rocksdb/mysql-test/rocksdb/include/bulk_load_unsorted.inc
...rocksdb/mysql-test/rocksdb/include/bulk_load_unsorted.inc
+2
-2
storage/rocksdb/mysql-test/rocksdb/r/bulk_load.result
storage/rocksdb/mysql-test/rocksdb/r/bulk_load.result
+6
-6
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_cf.result
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_cf.result
+6
-6
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_cf_and_data.result
...sdb/mysql-test/rocksdb/r/bulk_load_rev_cf_and_data.result
+6
-6
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_data.result
...ge/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_data.result
+6
-6
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_unsorted.result
...ge/rocksdb/mysql-test/rocksdb/r/bulk_load_unsorted.result
+6
-6
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_unsorted_rev.result
...ocksdb/mysql-test/rocksdb/r/bulk_load_unsorted_rev.result
+6
-6
storage/rocksdb/mysql-test/rocksdb/r/issue255.result
storage/rocksdb/mysql-test/rocksdb/r/issue255.result
+8
-8
storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result
storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result
+3
-3
storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result
...age/rocksdb/mysql-test/rocksdb/r/show_table_status.result
+4
-40
storage/rocksdb/mysql-test/rocksdb/r/truncate_table.result
storage/rocksdb/mysql-test/rocksdb/r/truncate_table.result
+4
-4
storage/rocksdb/mysql-test/rocksdb/t/issue255.test
storage/rocksdb/mysql-test/rocksdb/t/issue255.test
+8
-9
storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test
storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test
+1
-3
storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test
storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test
+2
-35
storage/rocksdb/mysql-test/rocksdb/t/truncate_table.test
storage/rocksdb/mysql-test/rocksdb/t/truncate_table.test
+4
-4
storage/rocksdb/rdb_datadic.cc
storage/rocksdb/rdb_datadic.cc
+0
-67
storage/rocksdb/rdb_datadic.h
storage/rocksdb/rdb_datadic.h
+0
-25
storage/rocksdb/rdb_global.h
storage/rocksdb/rdb_global.h
+0
-2
No files found.
storage/rocksdb/ha_rocksdb.cc
View file @
eafc9d85
...
@@ -2306,8 +2306,6 @@ class Rdb_transaction {
...
@@ -2306,8 +2306,6 @@ class Rdb_transaction {
bool
m_is_delayed_snapshot
=
false
;
bool
m_is_delayed_snapshot
=
false
;
bool
m_is_two_phase
=
false
;
bool
m_is_two_phase
=
false
;
std
::
unordered_set
<
Rdb_tbl_def
*>
modified_tables
;
private:
private:
/*
/*
Number of write operations this transaction had when we took the last
Number of write operations this transaction had when we took the last
...
@@ -3003,25 +3001,6 @@ class Rdb_transaction {
...
@@ -3003,25 +3001,6 @@ class Rdb_transaction {
virtual
void
start_tx
()
=
0
;
virtual
void
start_tx
()
=
0
;
virtual
void
start_stmt
()
=
0
;
virtual
void
start_stmt
()
=
0
;
protected:
// Non-virtual functions with actions to be done on transaction start and
// commit.
void
on_commit
()
{
time_t
tm
;
tm
=
time
(
nullptr
);
for
(
auto
&
it
:
modified_tables
)
{
it
->
update_time
=
tm
;
}
modified_tables
.
clear
();
}
void
on_rollback
()
{
modified_tables
.
clear
();
}
public:
void
log_table_write_op
(
Rdb_tbl_def
*
tbl
)
{
modified_tables
.
insert
(
tbl
);
}
void
set_initial_savepoint
()
{
void
set_initial_savepoint
()
{
/*
/*
Set the initial savepoint. If the first statement in the transaction
Set the initial savepoint. If the first statement in the transaction
...
@@ -3206,9 +3185,7 @@ class Rdb_transaction_impl : public Rdb_transaction {
...
@@ -3206,9 +3185,7 @@ class Rdb_transaction_impl : public Rdb_transaction {
goto
error
;
goto
error
;
}
}
on_commit
();
error:
error:
on_rollback
();
/* Save the transaction object to be reused */
/* Save the transaction object to be reused */
release_tx
();
release_tx
();
...
@@ -3224,7 +3201,6 @@ class Rdb_transaction_impl : public Rdb_transaction {
...
@@ -3224,7 +3201,6 @@ class Rdb_transaction_impl : public Rdb_transaction {
public:
public:
void
rollback
()
override
{
void
rollback
()
override
{
on_rollback
();
m_write_count
=
0
;
m_write_count
=
0
;
m_insert_count
=
0
;
m_insert_count
=
0
;
m_update_count
=
0
;
m_update_count
=
0
;
...
@@ -3546,9 +3522,7 @@ class Rdb_writebatch_impl : public Rdb_transaction {
...
@@ -3546,9 +3522,7 @@ class Rdb_writebatch_impl : public Rdb_transaction {
res
=
true
;
res
=
true
;
goto
error
;
goto
error
;
}
}
on_commit
();
error:
error:
on_rollback
();
reset
();
reset
();
m_write_count
=
0
;
m_write_count
=
0
;
...
@@ -3581,7 +3555,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
...
@@ -3581,7 +3555,6 @@ class Rdb_writebatch_impl : public Rdb_transaction {
}
}
void
rollback
()
override
{
void
rollback
()
override
{
on_rollback
();
m_write_count
=
0
;
m_write_count
=
0
;
m_insert_count
=
0
;
m_insert_count
=
0
;
m_update_count
=
0
;
m_update_count
=
0
;
...
@@ -7726,8 +7699,6 @@ int ha_rocksdb::create_table(const std::string &table_name,
...
@@ -7726,8 +7699,6 @@ int ha_rocksdb::create_table(const std::string &table_name,
goto
error
;
goto
error
;
}
}
m_tbl_def
->
put_creation_time
(
&
dict_manager
,
batch
,
time
(
nullptr
));
err
=
dict_manager
.
commit
(
batch
);
err
=
dict_manager
.
commit
(
batch
);
if
(
err
!=
HA_EXIT_SUCCESS
)
{
if
(
err
!=
HA_EXIT_SUCCESS
)
{
dict_manager
.
unlock
();
dict_manager
.
unlock
();
...
@@ -10364,8 +10335,6 @@ int ha_rocksdb::update_write_row(const uchar *const old_data,
...
@@ -10364,8 +10335,6 @@ int ha_rocksdb::update_write_row(const uchar *const old_data,
row_info
.
tx
->
incr_insert_count
();
row_info
.
tx
->
incr_insert_count
();
}
}
row_info
.
tx
->
log_table_write_op
(
m_tbl_def
);
if
(
do_bulk_commit
(
row_info
.
tx
))
{
if
(
do_bulk_commit
(
row_info
.
tx
))
{
DBUG_RETURN
(
HA_ERR_ROCKSDB_BULK_LOAD
);
DBUG_RETURN
(
HA_ERR_ROCKSDB_BULK_LOAD
);
}
}
...
@@ -10845,7 +10814,6 @@ int ha_rocksdb::delete_row(const uchar *const buf) {
...
@@ -10845,7 +10814,6 @@ int ha_rocksdb::delete_row(const uchar *const buf) {
}
}
tx
->
incr_delete_count
();
tx
->
incr_delete_count
();
tx
->
log_table_write_op
(
m_tbl_def
);
if
(
do_bulk_commit
(
tx
))
{
if
(
do_bulk_commit
(
tx
))
{
DBUG_RETURN
(
HA_ERR_ROCKSDB_BULK_LOAD
);
DBUG_RETURN
(
HA_ERR_ROCKSDB_BULK_LOAD
);
...
@@ -11044,12 +11012,6 @@ int ha_rocksdb::info(uint flag) {
...
@@ -11044,12 +11012,6 @@ int ha_rocksdb::info(uint flag) {
k
->
rec_per_key
[
j
]
=
x
;
k
->
rec_per_key
[
j
]
=
x
;
}
}
}
}
stats
.
create_time
=
m_tbl_def
->
get_creation_time
(
&
dict_manager
);
}
if
(
flag
&
HA_STATUS_TIME
)
{
stats
.
update_time
=
m_tbl_def
->
update_time
;
}
}
if
(
flag
&
HA_STATUS_ERRKEY
)
{
if
(
flag
&
HA_STATUS_ERRKEY
)
{
...
...
storage/rocksdb/mysql-test/rocksdb/include/bulk_load.inc
View file @
eafc9d85
...
@@ -121,12 +121,12 @@ set rocksdb_bulk_load=0;
...
@@ -121,12 +121,12 @@ set rocksdb_bulk_load=0;
--
remove_file
$file
--
remove_file
$file
# Make sure row count index stats are correct
# Make sure row count index stats are correct
--
replace_column
6
# 7 # 8 # 9 #
12 # 13 #
--
replace_column
6
# 7 # 8 # 9 #
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
ANALYZE
TABLE
t1
,
t2
,
t3
;
ANALYZE
TABLE
t1
,
t2
,
t3
;
--
replace_column
6
# 7 # 8 # 9 #
12 # 13 #
--
replace_column
6
# 7 # 8 # 9 #
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
# Make sure all the data is there.
# Make sure all the data is there.
...
...
storage/rocksdb/mysql-test/rocksdb/include/bulk_load_unsorted.inc
View file @
eafc9d85
...
@@ -121,12 +121,12 @@ set rocksdb_bulk_load=0;
...
@@ -121,12 +121,12 @@ set rocksdb_bulk_load=0;
--
remove_file
$file
--
remove_file
$file
# Make sure row count index stats are correct
# Make sure row count index stats are correct
--
replace_column
6
# 7 # 8 # 9 #
12 # 13 #
--
replace_column
6
# 7 # 8 # 9 #
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
ANALYZE
TABLE
t1
,
t2
,
t3
;
ANALYZE
TABLE
t1
,
t2
,
t3
;
--
replace_column
6
# 7 # 8 # 9 #
12 # 13 #
--
replace_column
6
# 7 # 8 # 9 #
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
SHOW
TABLE
STATUS
WHERE
name
LIKE
't%'
;
# Make sure all the data is there.
# Make sure all the data is there.
...
...
storage/rocksdb/mysql-test/rocksdb/r/bulk_load.result
View file @
eafc9d85
...
@@ -40,9 +40,9 @@ pk a b
...
@@ -40,9 +40,9 @@ pk a b
set rocksdb_bulk_load=0;
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
ANALYZE TABLE t1, t2, t3;
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
select count(pk),count(a) from t1;
select count(pk),count(a) from t1;
count(pk) count(a)
count(pk) count(a)
2500000 2500000
2500000 2500000
...
...
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_cf.result
View file @
eafc9d85
...
@@ -40,9 +40,9 @@ pk a b
...
@@ -40,9 +40,9 @@ pk a b
set rocksdb_bulk_load=0;
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
ANALYZE TABLE t1, t2, t3;
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
select count(pk),count(a) from t1;
select count(pk),count(a) from t1;
count(pk) count(a)
count(pk) count(a)
2500000 2500000
2500000 2500000
...
...
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_cf_and_data.result
View file @
eafc9d85
...
@@ -40,9 +40,9 @@ pk a b
...
@@ -40,9 +40,9 @@ pk a b
set rocksdb_bulk_load=0;
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
ANALYZE TABLE t1, t2, t3;
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
select count(pk),count(a) from t1;
select count(pk),count(a) from t1;
count(pk) count(a)
count(pk) count(a)
2500000 2500000
2500000 2500000
...
...
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_rev_data.result
View file @
eafc9d85
...
@@ -40,9 +40,9 @@ pk a b
...
@@ -40,9 +40,9 @@ pk a b
set rocksdb_bulk_load=0;
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
ANALYZE TABLE t1, t2, t3;
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
...
@@ -53,9 +53,9 @@ test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_bin NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_bin NULL partitioned 0 N
select count(pk),count(a) from t1;
select count(pk),count(a) from t1;
count(pk) count(a)
count(pk) count(a)
2500000 2500000
2500000 2500000
...
...
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_unsorted.result
View file @
eafc9d85
...
@@ -72,9 +72,9 @@ LOAD DATA INFILE <input_file> INTO TABLE t3;
...
@@ -72,9 +72,9 @@ LOAD DATA INFILE <input_file> INTO TABLE t3;
set rocksdb_bulk_load=0;
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL partitioned 0 N
ANALYZE TABLE t1, t2, t3;
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Engine-independent statistics collected
...
@@ -85,9 +85,9 @@ test.t3 analyze status Engine-independent statistics collected
...
@@ -85,9 +85,9 @@ test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL partitioned 0 N
select count(a),count(b) from t1;
select count(a),count(b) from t1;
count(a) count(b)
count(a) count(b)
2500000 2500000
2500000 2500000
...
...
storage/rocksdb/mysql-test/rocksdb/r/bulk_load_unsorted_rev.result
View file @
eafc9d85
...
@@ -72,9 +72,9 @@ LOAD DATA INFILE <input_file> INTO TABLE t3;
...
@@ -72,9 +72,9 @@ LOAD DATA INFILE <input_file> INTO TABLE t3;
set rocksdb_bulk_load=0;
set rocksdb_bulk_load=0;
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL partitioned 0 N
ANALYZE TABLE t1, t2, t3;
ANALYZE TABLE t1, t2, t3;
Table Op Msg_type Msg_text
Table Op Msg_type Msg_text
test.t1 analyze status Engine-independent statistics collected
test.t1 analyze status Engine-independent statistics collected
...
@@ -85,9 +85,9 @@ test.t3 analyze status Engine-independent statistics collected
...
@@ -85,9 +85,9 @@ test.t3 analyze status Engine-independent statistics collected
test.t3 analyze status OK
test.t3 analyze status OK
SHOW TABLE STATUS WHERE name LIKE 't%';
SHOW TABLE STATUS WHERE name LIKE 't%';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
# #
NULL latin1_swedish_ci NULL partitioned 0 N
t3 ROCKSDB 10 Fixed 2500000 # # # # 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL partitioned 0 N
select count(a),count(b) from t1;
select count(a),count(b) from t1;
count(a) count(b)
count(a) count(b)
2500000 2500000
2500000 2500000
...
...
storage/rocksdb/mysql-test/rocksdb/r/issue255.result
View file @
eafc9d85
...
@@ -2,7 +2,7 @@ CREATE TABLE t1 (pk BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT);
...
@@ -2,7 +2,7 @@ CREATE TABLE t1 (pk BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (5);
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB # Fixed # # # # # # 6
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB # Fixed # # # # # # 6
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 VALUES ('538647864786478647864');
INSERT INTO t1 VALUES ('538647864786478647864');
Warnings:
Warnings:
Warning 1264 Out of range value for column 'pk' at row 1
Warning 1264 Out of range value for column 'pk' at row 1
...
@@ -12,7 +12,7 @@ pk
...
@@ -12,7 +12,7 @@ pk
9223372036854775807
9223372036854775807
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 2 22 44 0 0 0 9223372036854775807
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 2 22 44 0 0 0 9223372036854775807
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 VALUES ();
INSERT INTO t1 VALUES ();
ERROR 23000: Duplicate entry '9223372036854775807' for key 'PRIMARY'
ERROR 23000: Duplicate entry '9223372036854775807' for key 'PRIMARY'
SELECT * FROM t1;
SELECT * FROM t1;
...
@@ -21,7 +21,7 @@ pk
...
@@ -21,7 +21,7 @@ pk
9223372036854775807
9223372036854775807
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB # Fixed # # # # # # 9223372036854775807
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB # Fixed # # # # # # 9223372036854775807
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 VALUES ();
INSERT INTO t1 VALUES ();
ERROR 23000: Duplicate entry '9223372036854775807' for key 'PRIMARY'
ERROR 23000: Duplicate entry '9223372036854775807' for key 'PRIMARY'
SELECT * FROM t1;
SELECT * FROM t1;
...
@@ -30,13 +30,13 @@ pk
...
@@ -30,13 +30,13 @@ pk
9223372036854775807
9223372036854775807
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB # Fixed # # # # # # 9223372036854775807
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB # Fixed # # # # # # 9223372036854775807
NULL NULL
NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (pk TINYINT NOT NULL PRIMARY KEY AUTO_INCREMENT);
CREATE TABLE t1 (pk TINYINT NOT NULL PRIMARY KEY AUTO_INCREMENT);
INSERT INTO t1 VALUES (5);
INSERT INTO t1 VALUES (5);
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB # Fixed # # # # # # 6
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB # Fixed # # # # # # 6
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 VALUES (1000);
INSERT INTO t1 VALUES (1000);
Warnings:
Warnings:
Warning 1264 Out of range value for column 'pk' at row 1
Warning 1264 Out of range value for column 'pk' at row 1
...
@@ -46,7 +46,7 @@ pk
...
@@ -46,7 +46,7 @@ pk
127
127
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB # Fixed # # # # # # 127
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB # Fixed # # # # # # 127
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 VALUES ();
INSERT INTO t1 VALUES ();
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
SELECT * FROM t1;
SELECT * FROM t1;
...
@@ -55,7 +55,7 @@ pk
...
@@ -55,7 +55,7 @@ pk
127
127
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB # Fixed # # # # # # 127
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB # Fixed # # # # # # 127
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 VALUES ();
INSERT INTO t1 VALUES ();
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
ERROR 23000: Duplicate entry '127' for key 'PRIMARY'
SELECT * FROM t1;
SELECT * FROM t1;
...
@@ -64,5 +64,5 @@ pk
...
@@ -64,5 +64,5 @@ pk
127
127
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB # Fixed # # # # # # 127
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB # Fixed # # # # # # 127
NULL NULL
NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1;
DROP TABLE t1;
storage/rocksdb/mysql-test/rocksdb/r/rocksdb.result
View file @
eafc9d85
...
@@ -1422,7 +1422,7 @@ create table t1 (i int primary key auto_increment) engine=RocksDB;
...
@@ -1422,7 +1422,7 @@ create table t1 (i int primary key auto_increment) engine=RocksDB;
insert into t1 values (null),(null);
insert into t1 values (null),(null);
show table status like 't1';
show table status like 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 1000 0 # 0 0 0 3
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 1000 0 # 0 0 0 3
NULL NULL
NULL latin1_swedish_ci NULL 0 N
drop table t1;
drop table t1;
#
#
# Fix Issue #4: Crash when using pseudo-unique keys
# Fix Issue #4: Crash when using pseudo-unique keys
...
@@ -2595,7 +2595,7 @@ CREATE TABLE t1(a INT AUTO_INCREMENT KEY);
...
@@ -2595,7 +2595,7 @@ CREATE TABLE t1(a INT AUTO_INCREMENT KEY);
INSERT INTO t1 VALUES(0),(-1),(0);
INSERT INTO t1 VALUES(0),(-1),(0);
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 3
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 3
NULL NULL
NULL latin1_swedish_ci NULL 0 N
SELECT * FROM t1;
SELECT * FROM t1;
a
a
-1
-1
...
@@ -2606,7 +2606,7 @@ CREATE TABLE t1(a INT AUTO_INCREMENT KEY);
...
@@ -2606,7 +2606,7 @@ CREATE TABLE t1(a INT AUTO_INCREMENT KEY);
INSERT INTO t1 VALUES(0),(10),(0);
INSERT INTO t1 VALUES(0),(10),(0);
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 12
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 1000 0 0 0 0 0 12
NULL NULL
NULL latin1_swedish_ci NULL 0 N
SELECT * FROM t1;
SELECT * FROM t1;
a
a
1
1
...
...
storage/rocksdb/mysql-test/rocksdb/r/show_table_status.result
View file @
eafc9d85
...
@@ -7,12 +7,12 @@ set global rocksdb_force_flush_memtable_now = true;
...
@@ -7,12 +7,12 @@ set global rocksdb_force_flush_memtable_now = true;
CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb CHARACTER SET utf8;
CREATE TABLE t3 (a INT, b CHAR(8), pk INT PRIMARY KEY) ENGINE=rocksdb CHARACTER SET utf8;
SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' );
SHOW TABLE STATUS WHERE name IN ( 't1', 't2', 't3' );
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
t3 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
# #
NULL utf8_general_ci NULL 0 N
t3 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
NULL NULL
NULL utf8_general_ci NULL 0 N
SHOW TABLE STATUS WHERE name LIKE 't2';
SHOW TABLE STATUS WHERE name LIKE 't2';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t2 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
# #
NULL latin1_swedish_ci NULL 0 N
t2 ROCKSDB 10 Fixed 1000 # # 0 0 0 NULL
NULL NULL
NULL latin1_swedish_ci NULL 0 N
DROP TABLE t1, t2, t3;
DROP TABLE t1, t2, t3;
CREATE DATABASE `db_new..............................................end`;
CREATE DATABASE `db_new..............................................end`;
USE `db_new..............................................end`;
USE `db_new..............................................end`;
...
@@ -22,39 +22,3 @@ SELECT TABLE_SCHEMA, TABLE_NAME FROM information_schema.table_statistics WHERE T
...
@@ -22,39 +22,3 @@ SELECT TABLE_SCHEMA, TABLE_NAME FROM information_schema.table_statistics WHERE T
TABLE_SCHEMA db_new..............................................end
TABLE_SCHEMA db_new..............................................end
TABLE_NAME t1_new..............................................end
TABLE_NAME t1_new..............................................end
DROP DATABASE `db_new..............................................end`;
DROP DATABASE `db_new..............................................end`;
#
# MDEV-17171: Bug: RocksDB Tables do not have "Creation Date"
#
use test;
create table t1 (a int) engine=rocksdb;
select create_time is not null, update_time, check_time
from information_schema.tables where table_schema=database() and table_name='t1';
create_time is not null update_time check_time
1 NULL NULL
insert into t1 values (1);
select create_time is not null, update_time is not null, check_time
from information_schema.tables where table_schema=database() and table_name='t1';
create_time is not null update_time is not null check_time
1 1 NULL
flush tables;
select create_time is not null, update_time is not null, check_time
from information_schema.tables where table_schema=database() and table_name='t1';
create_time is not null update_time is not null check_time
1 1 NULL
select create_time, update_time into @create_tm, @update_tm
from information_schema.tables
where table_schema=database() and table_name='t1';
select sleep(3);
sleep(3)
0
insert into t1 values (2);
select
create_time=@create_tm /* should not change */ ,
timestampdiff(second, @update_tm, update_time) > 2,
check_time
from information_schema.tables
where table_schema=database() and table_name='t1';
create_time=@create_tm 1
timestampdiff(second, @update_tm, update_time) > 2 1
check_time NULL
drop table t1;
storage/rocksdb/mysql-test/rocksdb/r/truncate_table.result
View file @
eafc9d85
...
@@ -9,19 +9,19 @@ DROP TABLE t1;
...
@@ -9,19 +9,19 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT KEY AUTO_INCREMENT, c CHAR(8)) ENGINE=rocksdb;
CREATE TABLE t1 (a INT KEY AUTO_INCREMENT, c CHAR(8)) ENGINE=rocksdb;
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed # # # 0 0 0 1
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed # # # 0 0 0 1
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 (c) VALUES ('a'),('b'),('c');
INSERT INTO t1 (c) VALUES ('a'),('b'),('c');
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed # # # 0 0 0 4
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed # # # 0 0 0 4
NULL NULL
NULL latin1_swedish_ci NULL 0 N
TRUNCATE TABLE t1;
TRUNCATE TABLE t1;
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed # # # 0 0 0 1
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed # # # 0 0 0 1
NULL NULL
NULL latin1_swedish_ci NULL 0 N
INSERT INTO t1 (c) VALUES ('d');
INSERT INTO t1 (c) VALUES ('d');
SHOW TABLE STATUS LIKE 't1';
SHOW TABLE STATUS LIKE 't1';
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
Name Engine Version Row_format Rows Avg_row_length Data_length Max_data_length Index_length Data_free Auto_increment Create_time Update_time Check_time Collation Checksum Create_options Comment Max_index_length Temporary
t1 ROCKSDB 10 Fixed # # # 0 0 0 2
# #
NULL latin1_swedish_ci NULL 0 N
t1 ROCKSDB 10 Fixed # # # 0 0 0 2
NULL NULL
NULL latin1_swedish_ci NULL 0 N
SELECT a,c FROM t1;
SELECT a,c FROM t1;
a c
a c
1 d
1 d
...
...
storage/rocksdb/mysql-test/rocksdb/t/issue255.test
View file @
eafc9d85
...
@@ -3,25 +3,24 @@
...
@@ -3,25 +3,24 @@
CREATE
TABLE
t1
(
pk
BIGINT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
);
CREATE
TABLE
t1
(
pk
BIGINT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
);
INSERT
INTO
t1
VALUES
(
5
);
INSERT
INTO
t1
VALUES
(
5
);
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
INSERT
INTO
t1
VALUES
(
'538647864786478647864'
);
INSERT
INTO
t1
VALUES
(
'538647864786478647864'
);
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
--
replace_column
12
# 13 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
--
error
ER_DUP_ENTRY
--
error
ER_DUP_ENTRY
INSERT
INTO
t1
VALUES
();
INSERT
INTO
t1
VALUES
();
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
--
error
ER_DUP_ENTRY
--
error
ER_DUP_ENTRY
INSERT
INTO
t1
VALUES
();
INSERT
INTO
t1
VALUES
();
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
...
@@ -29,24 +28,24 @@ DROP TABLE t1;
...
@@ -29,24 +28,24 @@ DROP TABLE t1;
CREATE
TABLE
t1
(
pk
TINYINT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
);
CREATE
TABLE
t1
(
pk
TINYINT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT
);
INSERT
INTO
t1
VALUES
(
5
);
INSERT
INTO
t1
VALUES
(
5
);
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
INSERT
INTO
t1
VALUES
(
1000
);
INSERT
INTO
t1
VALUES
(
1000
);
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
--
error
ER_DUP_ENTRY
--
error
ER_DUP_ENTRY
INSERT
INTO
t1
VALUES
();
INSERT
INTO
t1
VALUES
();
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
--
error
ER_DUP_ENTRY
--
error
ER_DUP_ENTRY
INSERT
INTO
t1
VALUES
();
INSERT
INTO
t1
VALUES
();
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
12 # 13 #
--
replace_column
3
# 5 # 6 # 7 # 8 # 9 # 10 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
storage/rocksdb/mysql-test/rocksdb/t/rocksdb.test
View file @
eafc9d85
...
@@ -1207,7 +1207,7 @@ drop table t1;
...
@@ -1207,7 +1207,7 @@ drop table t1;
create
table
t1
(
i
int
primary
key
auto_increment
)
engine
=
RocksDB
;
create
table
t1
(
i
int
primary
key
auto_increment
)
engine
=
RocksDB
;
insert
into
t1
values
(
null
),(
null
);
insert
into
t1
values
(
null
),(
null
);
--
replace_column
7
#
12 # 13 #
--
replace_column
7
#
show
table
status
like
't1'
;
show
table
status
like
't1'
;
drop
table
t1
;
drop
table
t1
;
...
@@ -1914,13 +1914,11 @@ DROP TABLE t1;
...
@@ -1914,13 +1914,11 @@ DROP TABLE t1;
# value is 4 while MyRocks will show it as 3.
# value is 4 while MyRocks will show it as 3.
CREATE
TABLE
t1
(
a
INT
AUTO_INCREMENT
KEY
);
CREATE
TABLE
t1
(
a
INT
AUTO_INCREMENT
KEY
);
INSERT
INTO
t1
VALUES
(
0
),(
-
1
),(
0
);
INSERT
INTO
t1
VALUES
(
0
),(
-
1
),(
0
);
--
replace_column
12
# 13 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
a
INT
AUTO_INCREMENT
KEY
);
CREATE
TABLE
t1
(
a
INT
AUTO_INCREMENT
KEY
);
INSERT
INTO
t1
VALUES
(
0
),(
10
),(
0
);
INSERT
INTO
t1
VALUES
(
0
),(
10
),(
0
);
--
replace_column
12
# 13 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
SELECT
*
FROM
t1
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
DROP
TABLE
t1
;
...
...
storage/rocksdb/mysql-test/rocksdb/t/show_table_status.test
View file @
eafc9d85
...
@@ -25,7 +25,7 @@ set global rocksdb_force_flush_memtable_now = true;
...
@@ -25,7 +25,7 @@ set global rocksdb_force_flush_memtable_now = true;
CREATE
TABLE
t3
(
a
INT
,
b
CHAR
(
8
),
pk
INT
PRIMARY
KEY
)
ENGINE
=
rocksdb
CHARACTER
SET
utf8
;
CREATE
TABLE
t3
(
a
INT
,
b
CHAR
(
8
),
pk
INT
PRIMARY
KEY
)
ENGINE
=
rocksdb
CHARACTER
SET
utf8
;
--
replace_column
6
# 7 #
12 # 13 #
--
replace_column
6
# 7 #
SHOW
TABLE
STATUS
WHERE
name
IN
(
't1'
,
't2'
,
't3'
);
SHOW
TABLE
STATUS
WHERE
name
IN
(
't1'
,
't2'
,
't3'
);
# Some statistics don't get updated as quickly. The Data_length and
# Some statistics don't get updated as quickly. The Data_length and
...
@@ -49,7 +49,7 @@ set global rocksdb_force_flush_memtable_now = true;
...
@@ -49,7 +49,7 @@ set global rocksdb_force_flush_memtable_now = true;
# We expect the number of rows to be 10000. Data_len and Avg_row_len
# We expect the number of rows to be 10000. Data_len and Avg_row_len
# may vary, depending on built-in compression library.
# may vary, depending on built-in compression library.
--
replace_column
6
# 7 #
12 # 13 #
--
replace_column
6
# 7 #
SHOW
TABLE
STATUS
WHERE
name
LIKE
't2'
;
SHOW
TABLE
STATUS
WHERE
name
LIKE
't2'
;
DROP
TABLE
t1
,
t2
,
t3
;
DROP
TABLE
t1
,
t2
,
t3
;
...
@@ -63,36 +63,3 @@ CREATE TABLE `t1_new..............................................end`(a int) en
...
@@ -63,36 +63,3 @@ CREATE TABLE `t1_new..............................................end`(a int) en
INSERT
INTO
`t1_new..............................................end`
VALUES
(
1
);
INSERT
INTO
`t1_new..............................................end`
VALUES
(
1
);
--
query_vertical
SELECT
TABLE_SCHEMA
,
TABLE_NAME
FROM
information_schema
.
table_statistics
WHERE
TABLE_NAME
=
't1_new..............................................end'
--
query_vertical
SELECT
TABLE_SCHEMA
,
TABLE_NAME
FROM
information_schema
.
table_statistics
WHERE
TABLE_NAME
=
't1_new..............................................end'
DROP
DATABASE
`db_new..............................................end`
;
DROP
DATABASE
`db_new..............................................end`
;
--
echo
#
--
echo
# MDEV-17171: Bug: RocksDB Tables do not have "Creation Date"
--
echo
#
use
test
;
create
table
t1
(
a
int
)
engine
=
rocksdb
;
select
create_time
is
not
null
,
update_time
,
check_time
from
information_schema
.
tables
where
table_schema
=
database
()
and
table_name
=
't1'
;
insert
into
t1
values
(
1
);
select
create_time
is
not
null
,
update_time
is
not
null
,
check_time
from
information_schema
.
tables
where
table_schema
=
database
()
and
table_name
=
't1'
;
flush
tables
;
select
create_time
is
not
null
,
update_time
is
not
null
,
check_time
from
information_schema
.
tables
where
table_schema
=
database
()
and
table_name
=
't1'
;
select
create_time
,
update_time
into
@
create_tm
,
@
update_tm
from
information_schema
.
tables
where
table_schema
=
database
()
and
table_name
=
't1'
;
select
sleep
(
3
);
insert
into
t1
values
(
2
);
--
vertical_results
select
create_time
=@
create_tm
/* should not change */
,
timestampdiff
(
second
,
@
update_tm
,
update_time
)
>
2
,
check_time
from
information_schema
.
tables
where
table_schema
=
database
()
and
table_name
=
't1'
;
drop
table
t1
;
storage/rocksdb/mysql-test/rocksdb/t/truncate_table.test
View file @
eafc9d85
...
@@ -29,22 +29,22 @@ DROP TABLE t1;
...
@@ -29,22 +29,22 @@ DROP TABLE t1;
CREATE
TABLE
t1
(
a
INT
KEY
AUTO_INCREMENT
,
c
CHAR
(
8
))
ENGINE
=
rocksdb
;
CREATE
TABLE
t1
(
a
INT
KEY
AUTO_INCREMENT
,
c
CHAR
(
8
))
ENGINE
=
rocksdb
;
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
--
replace_column
5
# 6 # 7 #
12 # 13 #
--
replace_column
5
# 6 # 7 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
INSERT
INTO
t1
(
c
)
VALUES
(
'a'
),(
'b'
),(
'c'
);
INSERT
INTO
t1
(
c
)
VALUES
(
'a'
),(
'b'
),(
'c'
);
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
--
replace_column
5
# 6 # 7 #
12 # 13 #
--
replace_column
5
# 6 # 7 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
TRUNCATE
TABLE
t1
;
TRUNCATE
TABLE
t1
;
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
--
replace_column
5
# 6 # 7 #
12 # 13 #
--
replace_column
5
# 6 # 7 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
INSERT
INTO
t1
(
c
)
VALUES
(
'd'
);
INSERT
INTO
t1
(
c
)
VALUES
(
'd'
);
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
#--replace_column 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 10 # 12 # 13 # 14 # 15 # 16 # 17 # 18 #
--
replace_column
5
# 6 # 7 #
12 # 13 #
--
replace_column
5
# 6 # 7 #
SHOW
TABLE
STATUS
LIKE
't1'
;
SHOW
TABLE
STATUS
LIKE
't1'
;
--
sorted_result
--
sorted_result
...
...
storage/rocksdb/rdb_datadic.cc
View file @
eafc9d85
...
@@ -3517,27 +3517,6 @@ Rdb_tbl_def::~Rdb_tbl_def() {
...
@@ -3517,27 +3517,6 @@ Rdb_tbl_def::~Rdb_tbl_def() {
}
}
}
}
void
Rdb_tbl_def
::
put_creation_time
(
Rdb_dict_manager
*
dict_manager
,
rocksdb
::
WriteBatchBase
*
batch
,
time_t
timeval
)
{
dict_manager
->
put_creation_time
(
batch
,
m_key_descr_arr
[
0
]
->
get_gl_index_id
(),
timeval
);
create_time
=
timeval
;
}
time_t
Rdb_tbl_def
::
get_creation_time
(
Rdb_dict_manager
*
dict_manager
)
{
time_t
tm
;
if
(
create_time
==
CREATE_TIME_UNKNOWN
)
{
if
(
dict_manager
->
get_creation_time
(
m_key_descr_arr
[
0
]
->
get_gl_index_id
(),
&
tm
))
create_time
=
tm
;
else
create_time
=
0
;
// Not available
}
return
create_time
;
}
/*
/*
Put table definition DDL entry. Actual write is done at
Put table definition DDL entry. Actual write is done at
Rdb_dict_manager::commit.
Rdb_dict_manager::commit.
...
@@ -5364,7 +5343,6 @@ rocksdb::Status Rdb_dict_manager::put_auto_incr_val(
...
@@ -5364,7 +5343,6 @@ rocksdb::Status Rdb_dict_manager::put_auto_incr_val(
value_writer
.
to_slice
());
value_writer
.
to_slice
());
}
}
bool
Rdb_dict_manager
::
get_auto_incr_val
(
const
GL_INDEX_ID
&
gl_index_id
,
bool
Rdb_dict_manager
::
get_auto_incr_val
(
const
GL_INDEX_ID
&
gl_index_id
,
ulonglong
*
new_val
)
const
{
ulonglong
*
new_val
)
const
{
Rdb_buf_writer
<
Rdb_key_def
::
INDEX_NUMBER_SIZE
*
3
>
key_writer
;
Rdb_buf_writer
<
Rdb_key_def
::
INDEX_NUMBER_SIZE
*
3
>
key_writer
;
...
@@ -5384,51 +5362,6 @@ bool Rdb_dict_manager::get_auto_incr_val(const GL_INDEX_ID &gl_index_id,
...
@@ -5384,51 +5362,6 @@ bool Rdb_dict_manager::get_auto_incr_val(const GL_INDEX_ID &gl_index_id,
return
false
;
return
false
;
}
}
rocksdb
::
Status
Rdb_dict_manager
::
put_creation_time
(
rocksdb
::
WriteBatchBase
*
batch
,
const
GL_INDEX_ID
&
gl_index_id
,
time_t
timeval
)
const
{
uchar
key_buf
[
Rdb_key_def
::
INDEX_NUMBER_SIZE
*
3
]
=
{
0
};
dump_index_id
(
key_buf
,
Rdb_key_def
::
TABLE_CREATION_TS
,
gl_index_id
);
const
rocksdb
::
Slice
key
=
rocksdb
::
Slice
(
reinterpret_cast
<
char
*>
(
key_buf
),
sizeof
(
key_buf
));
// Value is constructed by storing the version and the value.
uchar
value_buf
[
RDB_SIZEOF_TABLE_CREATION_TS_VERSION
+
ROCKSDB_SIZEOF_TABLE_CREATION_TS
]
=
{
0
};
uchar
*
ptr
=
value_buf
;
rdb_netbuf_store_uint16
(
ptr
,
Rdb_key_def
::
TABLE_CREATION_TS_VERSION
);
ptr
+=
RDB_SIZEOF_TABLE_CREATION_TS_VERSION
;
rdb_netbuf_store_uint64
(
ptr
,
timeval
);
ptr
+=
ROCKSDB_SIZEOF_TABLE_CREATION_TS
;
const
rocksdb
::
Slice
value
=
rocksdb
::
Slice
(
reinterpret_cast
<
char
*>
(
value_buf
),
ptr
-
value_buf
);
return
batch
->
Put
(
m_system_cfh
,
key
,
value
);
}
bool
Rdb_dict_manager
::
get_creation_time
(
const
GL_INDEX_ID
&
gl_index_id
,
time_t
*
new_val
)
const
{
uchar
key_buf
[
Rdb_key_def
::
INDEX_NUMBER_SIZE
*
3
]
=
{
0
};
dump_index_id
(
key_buf
,
Rdb_key_def
::
TABLE_CREATION_TS
,
gl_index_id
);
std
::
string
value
;
const
rocksdb
::
Status
status
=
get_value
(
rocksdb
::
Slice
(
reinterpret_cast
<
char
*>
(
key_buf
),
sizeof
(
key_buf
)),
&
value
);
if
(
status
.
ok
()
&&
value
.
size
()
>=
RDB_SIZEOF_TABLE_CREATION_TS_VERSION
)
{
const
uchar
*
const
val
=
reinterpret_cast
<
const
uchar
*>
(
value
.
data
());
if
(
rdb_netbuf_to_uint16
(
val
)
<=
Rdb_key_def
::
TABLE_CREATION_TS_VERSION
)
{
*
new_val
=
rdb_netbuf_to_uint64
(
val
+
RDB_SIZEOF_TABLE_CREATION_TS_VERSION
);
return
true
;
}
}
return
false
;
}
uint
Rdb_seq_generator
::
get_and_update_next_number
(
uint
Rdb_seq_generator
::
get_and_update_next_number
(
Rdb_dict_manager
*
const
dict
)
{
Rdb_dict_manager
*
const
dict
)
{
DBUG_ASSERT
(
dict
!=
nullptr
);
DBUG_ASSERT
(
dict
!=
nullptr
);
...
...
storage/rocksdb/rdb_datadic.h
View file @
eafc9d85
...
@@ -201,7 +201,6 @@ const size_t RDB_SIZEOF_INDEX_TYPE = sizeof(uchar);
...
@@ -201,7 +201,6 @@ const size_t RDB_SIZEOF_INDEX_TYPE = sizeof(uchar);
const
size_t
RDB_SIZEOF_KV_VERSION
=
sizeof
(
uint16
);
const
size_t
RDB_SIZEOF_KV_VERSION
=
sizeof
(
uint16
);
const
size_t
RDB_SIZEOF_INDEX_FLAGS
=
sizeof
(
uint32
);
const
size_t
RDB_SIZEOF_INDEX_FLAGS
=
sizeof
(
uint32
);
const
size_t
RDB_SIZEOF_AUTO_INCREMENT_VERSION
=
sizeof
(
uint16
);
const
size_t
RDB_SIZEOF_AUTO_INCREMENT_VERSION
=
sizeof
(
uint16
);
const
size_t
RDB_SIZEOF_TABLE_CREATION_TS_VERSION
=
sizeof
(
uint16
);
// Possible return values for rdb_index_field_unpack_t functions.
// Possible return values for rdb_index_field_unpack_t functions.
enum
{
enum
{
...
@@ -505,7 +504,6 @@ class Rdb_key_def {
...
@@ -505,7 +504,6 @@ class Rdb_key_def {
MAX_INDEX_ID
=
7
,
MAX_INDEX_ID
=
7
,
DDL_CREATE_INDEX_ONGOING
=
8
,
DDL_CREATE_INDEX_ONGOING
=
8
,
AUTO_INC
=
9
,
AUTO_INC
=
9
,
TABLE_CREATION_TS
=
10
,
END_DICT_INDEX_ID
=
255
END_DICT_INDEX_ID
=
255
};
};
...
@@ -519,7 +517,6 @@ class Rdb_key_def {
...
@@ -519,7 +517,6 @@ class Rdb_key_def {
MAX_INDEX_ID_VERSION
=
1
,
MAX_INDEX_ID_VERSION
=
1
,
DDL_CREATE_INDEX_ONGOING_VERSION
=
1
,
DDL_CREATE_INDEX_ONGOING_VERSION
=
1
,
AUTO_INCREMENT_VERSION
=
1
,
AUTO_INCREMENT_VERSION
=
1
,
TABLE_CREATION_TS_VERSION
=
1
// Version for index stats is stored in IndexStats struct
// Version for index stats is stored in IndexStats struct
};
};
...
@@ -1111,13 +1108,6 @@ class Rdb_tbl_def {
...
@@ -1111,13 +1108,6 @@ class Rdb_tbl_def {
~
Rdb_tbl_def
();
~
Rdb_tbl_def
();
// time values are shown in SHOW TABLE STATUS
void
put_creation_time
(
Rdb_dict_manager
*
dict_manager
,
rocksdb
::
WriteBatchBase
*
batch
,
time_t
timeval
);
time_t
get_creation_time
(
Rdb_dict_manager
*
dict_manager
);
time_t
update_time
=
0
;
// in-memory only value, maintained right here
void
check_and_set_read_free_rpl_table
();
void
check_and_set_read_free_rpl_table
();
/* Number of indexes */
/* Number of indexes */
...
@@ -1143,12 +1133,6 @@ class Rdb_tbl_def {
...
@@ -1143,12 +1133,6 @@ class Rdb_tbl_def {
const
std
::
string
&
base_tablename
()
const
{
return
m_tablename
;
}
const
std
::
string
&
base_tablename
()
const
{
return
m_tablename
;
}
const
std
::
string
&
base_partition
()
const
{
return
m_partition
;
}
const
std
::
string
&
base_partition
()
const
{
return
m_partition
;
}
GL_INDEX_ID
get_autoincr_gl_index_id
();
GL_INDEX_ID
get_autoincr_gl_index_id
();
private:
const
time_t
CREATE_TIME_UNKNOWN
=
1
;
// CREATE_TIME_UNKNOWN means "didn't try to read, yet"
// 0 means "no data available" (and SQL layer shares this)
time_t
create_time
=
CREATE_TIME_UNKNOWN
;
};
};
/*
/*
...
@@ -1363,10 +1347,6 @@ class Rdb_binlog_manager {
...
@@ -1363,10 +1347,6 @@ class Rdb_binlog_manager {
value: version, {max auto_increment so far}
value: version, {max auto_increment so far}
max auto_increment is 8 bytes
max auto_increment is 8 bytes
10. Table creation timestamp
key: Rdb_key_def::TABLE_CREATION_TIMESTAMP + cf_id + index_id
value: timestamp
Data dictionary operations are atomic inside RocksDB. For example,
Data dictionary operations are atomic inside RocksDB. For example,
when creating a table with two indexes, it is necessary to call Put
when creating a table with two indexes, it is necessary to call Put
three times. They have to be atomic. Rdb_dict_manager has a wrapper function
three times. They have to be atomic. Rdb_dict_manager has a wrapper function
...
@@ -1525,11 +1505,6 @@ class Rdb_dict_manager {
...
@@ -1525,11 +1505,6 @@ class Rdb_dict_manager {
bool
overwrite
=
false
)
const
;
bool
overwrite
=
false
)
const
;
bool
get_auto_incr_val
(
const
GL_INDEX_ID
&
gl_index_id
,
bool
get_auto_incr_val
(
const
GL_INDEX_ID
&
gl_index_id
,
ulonglong
*
new_val
)
const
;
ulonglong
*
new_val
)
const
;
rocksdb
::
Status
put_creation_time
(
rocksdb
::
WriteBatchBase
*
batch
,
const
GL_INDEX_ID
&
gl_index_id
,
time_t
timeval_arg
)
const
;
bool
get_creation_time
(
const
GL_INDEX_ID
&
gl_index_id
,
time_t
*
new_val
)
const
;
};
};
struct
Rdb_index_info
{
struct
Rdb_index_info
{
...
...
storage/rocksdb/rdb_global.h
View file @
eafc9d85
...
@@ -228,8 +228,6 @@ const char *const RDB_TTL_COL_QUALIFIER = "ttl_col";
...
@@ -228,8 +228,6 @@ const char *const RDB_TTL_COL_QUALIFIER = "ttl_col";
#define ROCKSDB_SIZEOF_AUTOINC_VALUE sizeof(longlong)
#define ROCKSDB_SIZEOF_AUTOINC_VALUE sizeof(longlong)
#define ROCKSDB_SIZEOF_TABLE_CREATION_TS sizeof(uint64_t)
/*
/*
Maximum index prefix length in bytes.
Maximum index prefix length in bytes.
*/
*/
...
...
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