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
5e4f3af9
Commit
5e4f3af9
authored
Aug 29, 2018
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MyRocks: post-merge fixes part #5: make rocksdb.rocksdb_checksums test pass
parent
3d2c0f61
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
11 deletions
+41
-11
mysql-test/include/search_pattern_in_file.inc
mysql-test/include/search_pattern_in_file.inc
+14
-2
storage/rocksdb/mysql-test/rocksdb/r/rocksdb_checksums.result
...age/rocksdb/mysql-test/rocksdb/r/rocksdb_checksums.result
+18
-3
storage/rocksdb/mysql-test/rocksdb/t/rocksdb_checksums.test
storage/rocksdb/mysql-test/rocksdb/t/rocksdb_checksums.test
+9
-6
No files found.
mysql-test/include/search_pattern_in_file.inc
View file @
5e4f3af9
...
...
@@ -18,6 +18,11 @@
# Optionally, SEARCH_ABORT can be set to "FOUND" or "NOT FOUND" and this
# will abort if the search result doesn't match the requested one.
#
# Optionally, SEARCH_OUTPUT can be set to control the format of output.
# Supported formats:
# - (default) : "FOUND n /pattern/ in FILE " or "NOT FOUND ..."
# - "matches" : Each match is printed, on a separate line
#
# In case of
# - SEARCH_FILE and/or SEARCH_PATTERN is not set
# - SEARCH_FILE cannot be opened
...
...
@@ -75,7 +80,14 @@ perl;
my
@
matches
=
(
$content
=~
m
/
$search_pattern
/
gs
);
my
$res
=@
matches
?
"FOUND "
.
scalar
(
@
matches
)
:
"NOT FOUND"
;
$ENV
{
SEARCH_FILE
}
=~
s
{
^.*?
([
^/
\\
]
+
)
$
}{
$
1
};
print
"
$res
/
$search_pattern
/ in
$ENV
{
SEARCH_FILE
}
\n
"
;
if
(
$ENV
{
SEARCH_OUTPUT
}
eq
"matches"
)
{
foreach
(
@
matches
)
{
print
$_
.
"
\n
"
;
}
}
else
{
print
"
$res
/
$search_pattern
/ in
$ENV
{
SEARCH_FILE
}
\n
"
;
}
die
"
$ENV
{
SEARCH_ABORT
}
\n
"
if
$ENV
{
SEARCH_ABORT
}
&&
$res
=~
/^
$ENV
{
SEARCH_ABORT
}
/
;
if
$ENV
{
SEARCH_ABORT
}
&&
$res
=~
/^
$ENV
{
SEARCH_ABORT
}
/
;
EOF
storage/rocksdb/mysql-test/rocksdb/r/rocksdb_checksums.result
View file @
5e4f3af9
...
...
@@ -11,7 +11,12 @@ insert into t1 values (1,1,1),(2,2,2),(3,3,3);
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
FOUND 1 /0 table records had checksums/ in mysqld.1.err
CHECKTABLE t1: Checking table t1
CHECKTABLE t1: Checking index a
CHECKTABLE t1: ... 3 index entries checked (0 had checksums)
CHECKTABLE t1: Checking index b
CHECKTABLE t1: ... 3 index entries checked (0 had checksums)
CHECKTABLE t1: 0 table records had checksums
drop table t1;
set session rocksdb_store_row_debug_checksums=on;
create table t2 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksdb;
...
...
@@ -19,7 +24,12 @@ insert into t2 values (1,1,1),(2,2,2),(3,3,3);
check table t2;
Table Op Msg_type Msg_text
test.t2 check status OK
FOUND 1 /3 table records had checksums/ in mysqld.1.err
CHECKTABLE t2: Checking table t2
CHECKTABLE t2: Checking index a
CHECKTABLE t2: ... 3 index entries checked (3 had checksums)
CHECKTABLE t2: Checking index b
CHECKTABLE t2: ... 3 index entries checked (3 had checksums)
CHECKTABLE t2: 3 table records had checksums
# Now, make a table that has both rows with checksums and without
create table t3 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksdb;
insert into t3 values (1,1,1),(2,2,2),(3,3,3);
...
...
@@ -29,7 +39,12 @@ set session rocksdb_store_row_debug_checksums=on;
check table t3;
Table Op Msg_type Msg_text
test.t3 check status OK
FOUND 1 /2 table records had checksums/ in mysqld.1.err
CHECKTABLE t3: Checking table t3
CHECKTABLE t3: Checking index a
CHECKTABLE t3: ... 3 index entries checked (3 had checksums)
CHECKTABLE t3: Checking index b
CHECKTABLE t3: ... 3 index entries checked (2 had checksums)
CHECKTABLE t3: 2 table records had checksums
set session rocksdb_store_row_debug_checksums=on;
set session rocksdb_checksums_pct=5;
create table t4 (pk int primary key, a int, b int, key(a), key(b)) engine=rocksdb;
...
...
storage/rocksdb/mysql-test/rocksdb/t/rocksdb_checksums.test
View file @
5e4f3af9
...
...
@@ -19,8 +19,10 @@ show variables like 'rocksdb_%checksum%';
create
table
t1
(
pk
int
primary
key
,
a
int
,
b
int
,
key
(
a
),
key
(
b
))
engine
=
rocksdb
;
insert
into
t1
values
(
1
,
1
,
1
),(
2
,
2
,
2
),(
3
,
3
,
3
);
check
table
t1
;
--
let
SEARCH_FILE
=
$
MYSQLTEST_VARDIR
/
log
/
mysqld
.
1.
err
--
let
SEARCH_FILE
=
$
LOG
--
let
SEARCH_PATTERN
=
0
table
records
had
checksums
--
let
SEARCH_PATTERN
=
CHECKTABLE
t1
[
^
\n
]
*
--
let
SEARCH_OUTPUT
=
matches
--
source
include
/
search_pattern_in_file
.
inc
drop
table
t1
;
...
...
@@ -29,7 +31,7 @@ set session rocksdb_store_row_debug_checksums=on;
create
table
t2
(
pk
int
primary
key
,
a
int
,
b
int
,
key
(
a
),
key
(
b
))
engine
=
rocksdb
;
insert
into
t2
values
(
1
,
1
,
1
),(
2
,
2
,
2
),(
3
,
3
,
3
);
check
table
t2
;
--
let
SEARCH_PATTERN
=
3
table
records
had
checksums
--
let
SEARCH_PATTERN
=
CHECKTABLE
t2
[
^
\n
]
*
--
source
include
/
search_pattern_in_file
.
inc
--
echo
# Now, make a table that has both rows with checksums and without
...
...
@@ -39,7 +41,7 @@ set session rocksdb_store_row_debug_checksums=off;
update
t3
set
b
=
3
where
a
=
2
;
set
session
rocksdb_store_row_debug_checksums
=
on
;
check
table
t3
;
--
let
SEARCH_PATTERN
=
2
table
records
had
checksums
--
let
SEARCH_PATTERN
=
CHECKTABLE
t3
[
^
\n
]
*
--
source
include
/
search_pattern_in_file
.
inc
set
session
rocksdb_store_row_debug_checksums
=
on
;
...
...
@@ -58,11 +60,12 @@ while ($i<4000)
--
enable_query_log
check
table
t4
;
perl
;
$total
=
10
000
;
$total
=
4
000
;
$pct
=
5
;
@
out
=
();
$filename
=
"
$ENV
{
MYSQLTEST_VARDIR
}
/log/mysqld.1.err"
;
$filename
=
"
$ENV
{
LOG
}
"
;
print
$filename
"
\n
"
;
open
(
F
,
'<'
,
$filename
)
||
die
(
"Can't open file
$filename
: $!"
);
while
(
<
F
>
)
{
@
out
=
()
if
/^
CURRENT_TEST
:/
;
...
...
@@ -144,6 +147,6 @@ set @@global.rocksdb_verify_row_debug_checksums=@save_rocksdb_verify_row_debug_c
set
@@
global
.
rocksdb_checksums_pct
=@
save_rocksdb_checksums_pct
;
--
source
include
/
restart_mysqld
.
inc
--
remove_file
$LOG
#
--remove_file $LOG
drop
table
t2
,
t3
,
t4
;
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