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
d153c353
Commit
d153c353
authored
Feb 20, 2013
by
Rich Prohaska
Committed by
Yoni Fogel
Apr 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refs #6040 remove tabs
git-svn-id:
file:///svn/toku/tokudb@53387
c7de825b-a66e-492c-adef-691d508d4ae1
parent
a837ab9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
examples/db-update.c
examples/db-update.c
+5
-5
No files found.
examples/db-update.c
View file @
d153c353
...
...
@@ -81,12 +81,12 @@ static void insert_and_update(DB_ENV *db_env, DB *db, DB_TXN *txn, int a, int b,
}
else
#endif
{
DBT
key
=
{
.
data
=
key_buffer
,
.
size
=
sizeof
key_buffer
};
DBT
value
=
{
.
data
=
val_buffer
,
.
size
=
sizeof
val_buffer
};
DBT
key
=
{
.
data
=
key_buffer
,
.
size
=
sizeof
key_buffer
};
DBT
value
=
{
.
data
=
val_buffer
,
.
size
=
sizeof
val_buffer
};
DBT
oldvalue
=
{
};
r
=
db
->
get
(
db
,
txn
,
&
key
,
&
oldvalue
,
0
);
assert
(
r
==
0
||
r
==
DB_NOTFOUND
);
if
(
r
==
0
)
{
if
(
r
==
0
)
{
// update it
if
(
verbose
)
printf
(
"U"
);
int
oldc
=
get_int
(
oldvalue
.
data
);
...
...
@@ -94,10 +94,10 @@ static void insert_and_update(DB_ENV *db_env, DB *db, DB_TXN *txn, int a, int b,
memcpy
(
val_buffer
,
&
newc
,
sizeof
newc
);
r
=
db
->
put
(
db
,
txn
,
&
key
,
&
value
,
0
);
assert
(
r
==
0
);
}
else
if
(
r
==
DB_NOTFOUND
)
{
}
else
if
(
r
==
DB_NOTFOUND
)
{
r
=
db
->
put
(
db
,
txn
,
&
key
,
&
value
,
0
);
assert
(
r
==
0
);
}
}
}
}
...
...
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