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
33ebb7b3
Commit
33ebb7b3
authored
Apr 16, 2013
by
Yoni Fogel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve checkpoint tests
git-svn-id:
file:///svn/toku/tokudb@11496
c7de825b-a66e-492c-adef-691d508d4ae1
parent
b04619c7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
src/tests/checkpoint_1.c
src/tests/checkpoint_1.c
+2
-2
src/tests/checkpoint_test.h
src/tests/checkpoint_test.h
+23
-4
No files found.
src/tests/checkpoint_1.c
View file @
33ebb7b3
...
...
@@ -23,7 +23,7 @@ checkpoint_test_1(u_int32_t flags, u_int32_t n, int snap_all) {
fflush
(
stdout
);
}
dir_create
();
env_startup
();
env_startup
(
0
,
0
);
int
run
;
int
r
;
DICTIONARY_S
db_control
;
...
...
@@ -61,7 +61,7 @@ checkpoint_test_2(u_int32_t flags, u_int32_t n) {
fflush
(
stdout
);
}
dir_create
();
env_startup
();
env_startup
(
0
,
0
);
int
run
;
int
r
;
DICTIONARY_S
db_control
;
...
...
src/tests/checkpoint_test.h
View file @
33ebb7b3
...
...
@@ -88,8 +88,9 @@ dir_create(void) {
CKERR
(
r
);
}
// pass in zeroes for default cachesize
static
void
UU
()
env_startup
(
void
)
{
env_startup
(
int32_t
gbytes
,
int32_t
bytes
)
{
int
r
;
r
=
db_env_create
(
&
env
,
0
);
CKERR
(
r
);
...
...
@@ -97,6 +98,10 @@ env_startup(void) {
CKERR
(
r
);
r
=
env
->
set_default_dup_compare
(
env
,
int64_dbt_cmp
);
CKERR
(
r
);
if
(
gbytes
|
bytes
)
{
r
=
env
->
set_cachesize
(
env
,
gbytes
,
bytes
,
1
);
CKERR
(
r
);
}
r
=
env
->
open
(
env
,
ENVDIR
,
DB_INIT_LOCK
|
DB_INIT_LOG
|
DB_INIT_MPOOL
|
DB_INIT_TXN
|
DB_CREATE
|
DB_PRIVATE
,
S_IRWXU
+
S_IRWXG
+
S_IRWXO
);
CKERR
(
r
);
env
->
set_errfile
(
env
,
stderr
);
...
...
@@ -262,8 +267,8 @@ generate_val(int64_t key) {
}
static
void
UU
()
insert_n
_fixed
(
DB
*
db1
,
DB
*
db2
,
DB_TXN
*
txn
,
int
firstkey
,
int
n
)
{
static
void
insert_n
(
DB
*
db1
,
DB
*
db2
,
DB_TXN
*
txn
,
int
firstkey
,
int
n
,
int
offset
)
{
int64_t
k
;
int64_t
v
;
int
r
;
...
...
@@ -280,7 +285,7 @@ insert_n_fixed(DB *db1, DB *db2, DB_TXN *txn, int firstkey, int n) {
for
(
i
=
0
;
i
<
n
;
i
++
)
{
k
=
firstkey
+
i
;
v
=
generate_val
(
k
);
v
=
generate_val
(
k
)
+
offset
;
dbt_init
(
&
key
,
&
k
,
sizeof
(
k
));
dbt_init
(
&
val
,
&
v
,
sizeof
(
v
));
if
(
db1
)
{
...
...
@@ -295,6 +300,20 @@ insert_n_fixed(DB *db1, DB *db2, DB_TXN *txn, int firstkey, int n) {
}
static
void
UU
()
insert_n_broken
(
DB
*
db1
,
DB
*
db2
,
DB_TXN
*
txn
,
int
firstkey
,
int
n
)
{
insert_n
(
db1
,
db2
,
txn
,
firstkey
,
n
,
2718
);
}
static
void
UU
()
insert_n_fixed
(
DB
*
db1
,
DB
*
db2
,
DB_TXN
*
txn
,
int
firstkey
,
int
n
)
{
insert_n
(
db1
,
db2
,
txn
,
firstkey
,
n
,
0
);
}
static
void
UU
()
snapshot
(
DICTIONARY
d
,
int
do_checkpoint
)
{
if
(
do_checkpoint
)
{
...
...
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