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
ad5233e0
Commit
ad5233e0
authored
Nov 20, 2007
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log fcreate
git-svn-id:
file:///svn/tokudb@683
c7de825b-a66e-492c-adef-691d508d4ae1
parent
20a56541
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
3 deletions
+23
-3
newbrt/log.c
newbrt/log.c
+5
-0
newbrt/logdump.c
newbrt/logdump.c
+17
-2
src/tests/test_log2.c
src/tests/test_log2.c
+1
-1
No files found.
newbrt/log.c
View file @
ad5233e0
...
...
@@ -267,6 +267,8 @@ int tokulogger_log_fcreate (TOKUTXN txn, const char *fname, int mode) {
if
(
txn
==
0
)
return
0
;
const
int
fnamelen
=
strlen
(
fname
);
const
int
buflen
=
(
+
1
// log command
+
8
// lsn
+
8
// txnid
+
4
// length of fname
+
fnamelen
+
4
// mode
...
...
@@ -276,6 +278,9 @@ int tokulogger_log_fcreate (TOKUTXN txn, const char *fname, int mode) {
struct
wbuf
wbuf
;
wbuf_init
(
&
wbuf
,
buf
,
buflen
);
wbuf_char
(
&
wbuf
,
LT_FCREATE
);
wbuf_lsn
(
&
wbuf
,
txn
->
logger
->
lsn
);
txn
->
logger
->
lsn
.
lsn
++
;
wbuf_txnid
(
&
wbuf
,
txn
->
txnid64
);
wbuf_bytes
(
&
wbuf
,
fname
,
fnamelen
);
wbuf_int
(
&
wbuf
,
mode
);
return
tokulogger_finish
(
txn
->
logger
,
&
wbuf
);
...
...
newbrt/logdump.c
View file @
ad5233e0
...
...
@@ -58,7 +58,6 @@ void transcribe_diskoff (void) {
printf
(
" diskoff=%lld"
,
value
);
}
void
transcribe_crc32
(
void
)
{
u_int32_t
oldcrc
=
crc
;
u_int32_t
l
=
get_uint32
();
...
...
@@ -66,6 +65,11 @@ void transcribe_crc32 (void) {
assert
(
l
==
oldcrc
);
}
void
transcribe_mode
(
void
)
{
u_int32_t
value
=
get_uint32
();
printf
(
" mode=0%o"
,
value
);
}
void
transcribe_len
(
void
)
{
u_int32_t
l
=
get_uint32
();
printf
(
" len=%d"
,
l
);
...
...
@@ -127,6 +131,17 @@ int main (int argc, char *argv[]) {
printf
(
"
\n
"
);
break
;
case
LT_FCREATE
:
printf
(
"FCREATE:"
);
transcribe_lsn
();
transcribe_txnid
();
transcribe_key_or_data
(
"fname"
);
transcribe_mode
();
transcribe_crc32
();
transcribe_len
();
printf
(
"
\n
"
);
break
;
case
LT_COMMIT
:
printf
(
"COMMIT:"
);
transcribe_lsn
();
...
...
@@ -137,7 +152,7 @@ int main (int argc, char *argv[]) {
break
;
default:
printf
(
"Huh?"
);
fprintf
(
stderr
,
"Huh?, found command %c
\n
"
,
cmd
);
assert
(
0
);
}
}
...
...
src/tests/test_log2.c
View file @
ad5233e0
...
...
@@ -20,7 +20,7 @@ static void make_db (void) {
system
(
"rm -rf "
DIR
);
r
=
mkdir
(
DIR
,
0777
);
assert
(
r
==
0
);
r
=
db_env_create
(
&
env
,
0
);
assert
(
r
==
0
);
r
=
env
->
open
(
env
,
DIR
,
DB_INIT_LOCK
|
DB_INIT_LOG
|
DB_INIT_MPOOL
|
DB_INIT_TXN
|
DB_CREATE
,
0777
);
CKERR
(
r
);
r
=
env
->
open
(
env
,
DIR
,
DB_INIT_LOCK
|
DB_INIT_LOG
|
DB_INIT_MPOOL
|
DB_INIT_TXN
|
DB_CREATE
|
DB_PRIVATE
,
0777
);
CKERR
(
r
);
r
=
db_create
(
&
db
,
env
,
0
);
CKERR
(
r
);
r
=
env
->
txn_begin
(
env
,
0
,
&
tid
,
0
);
assert
(
r
==
0
);
r
=
db
->
open
(
db
,
tid
,
"foo.db"
,
0
,
DB_BTREE
,
DB_CREATE
,
0777
);
CKERR
(
r
);
...
...
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