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
6942f6c2
Commit
6942f6c2
authored
Jan 11, 2008
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test next/prev_dup/nodup. closes #259
git-svn-id:
file:///svn/tokudb@1602
c7de825b-a66e-492c-adef-691d508d4ae1
parent
57534991
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
18 deletions
+20
-18
src/ydb.c
src/ydb.c
+20
-18
No files found.
src/ydb.c
View file @
6942f6c2
...
@@ -845,6 +845,8 @@ static int verify_secondary_key(DB *secondary, DBT *pkey, DBT *data, DBT *skey)
...
@@ -845,6 +845,8 @@ static int verify_secondary_key(DB *secondary, DBT *pkey, DBT *data, DBT *skey)
return
r
;
return
r
;
}
}
static
int
toku_c_get_noassociate
(
DBC
*
c
,
DBT
*
key
,
DBT
*
data
,
u_int32_t
flag
);
static
inline
int
keyeq
(
DBC
*
c
,
DBT
*
a
,
DBT
*
b
)
{
static
inline
int
keyeq
(
DBC
*
c
,
DBT
*
a
,
DBT
*
b
)
{
DB
*
db
=
c
->
dbp
;
DB
*
db
=
c
->
dbp
;
return
db
->
i
->
brt
->
compare_fun
(
db
,
a
,
b
)
==
0
;
return
db
->
i
->
brt
->
compare_fun
(
db
,
a
,
b
)
==
0
;
...
@@ -856,19 +858,19 @@ static int toku_c_get_next_dup(DBC *c, DBT *key, DBT *data) {
...
@@ -856,19 +858,19 @@ static int toku_c_get_next_dup(DBC *c, DBT *key, DBT *data) {
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
r
=
c
->
c_get
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
r
=
toku_c_get_noassociate
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
if
(
r
!=
0
)
goto
finish
;
if
(
r
!=
0
)
goto
finish
;
r
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_NEXT
);
r
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_NEXT
);
if
(
r
!=
0
)
{
if
(
r
!=
0
)
{
int
rr
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_LAST
);
assert
(
rr
==
0
);
/* sticky */
int
rr
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_LAST
);
assert
(
rr
==
0
);
/* sticky */
goto
finish
;
goto
finish
;
}
}
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
{
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
{
int
rr
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_PREV
);
assert
(
rr
==
0
);
/* sticky */
int
rr
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_PREV
);
assert
(
rr
==
0
);
/* sticky */
r
=
DB_NOTFOUND
;
r
=
DB_NOTFOUND
;
goto
finish
;
goto
finish
;
}
}
r
=
c
->
c_get
(
c
,
key
,
data
,
DB_CURRENT
);
r
=
toku_c_get_noassociate
(
c
,
key
,
data
,
DB_CURRENT
);
finish:
finish:
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
...
@@ -885,19 +887,19 @@ static int toku_c_get_prev_dup(DBC *c, DBT *key, DBT *data) {
...
@@ -885,19 +887,19 @@ static int toku_c_get_prev_dup(DBC *c, DBT *key, DBT *data) {
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
r
=
c
->
c_get
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
r
=
toku_c_get_noassociate
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
if
(
r
!=
0
)
goto
finish
;
if
(
r
!=
0
)
goto
finish
;
r
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_PREV
);
r
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_PREV
);
if
(
r
!=
0
)
{
if
(
r
!=
0
)
{
int
rr
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_FIRST
);
assert
(
rr
==
0
);
/* sticky */
int
rr
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_FIRST
);
assert
(
rr
==
0
);
/* sticky */
goto
finish
;
goto
finish
;
}
}
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
{
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
{
int
rr
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_NEXT
);
assert
(
rr
==
0
);
/* sticky */
int
rr
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_NEXT
);
assert
(
rr
==
0
);
/* sticky */
r
=
DB_NOTFOUND
;
r
=
DB_NOTFOUND
;
goto
finish
;
goto
finish
;
}
}
r
=
c
->
c_get
(
c
,
key
,
data
,
DB_CURRENT
);
r
=
toku_c_get_noassociate
(
c
,
key
,
data
,
DB_CURRENT
);
finish:
finish:
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
...
@@ -914,16 +916,16 @@ static int toku_c_get_next_nodup(DBC *c, DBT *key, DBT *data) {
...
@@ -914,16 +916,16 @@ static int toku_c_get_next_nodup(DBC *c, DBT *key, DBT *data) {
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
r
=
c
->
c_get
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
r
=
toku_c_get_noassociate
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
if
(
r
!=
0
)
if
(
r
!=
0
)
r
=
c
->
c_get
(
c
,
key
,
data
,
DB_FIRST
);
r
=
toku_c_get_noassociate
(
c
,
key
,
data
,
DB_FIRST
);
else
{
else
{
while
(
r
==
0
)
{
while
(
r
==
0
)
{
r
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_NEXT
);
r
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_NEXT
);
if
(
r
!=
0
)
break
;
if
(
r
!=
0
)
break
;
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
break
;
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
break
;
}
}
if
(
r
==
0
)
r
=
c
->
c_get
(
c
,
key
,
data
,
DB_CURRENT
);
if
(
r
==
0
)
r
=
toku_c_get_noassociate
(
c
,
key
,
data
,
DB_CURRENT
);
}
}
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
...
@@ -938,16 +940,16 @@ static int toku_c_get_prev_nodup(DBC *c, DBT *key, DBT *data) {
...
@@ -938,16 +940,16 @@ static int toku_c_get_prev_nodup(DBC *c, DBT *key, DBT *data) {
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
currentval
;
memset
(
&
currentval
,
0
,
sizeof
currentval
);
currentval
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nkey
;
memset
(
&
nkey
,
0
,
sizeof
nkey
);
nkey
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
DBT
nval
;
memset
(
&
nval
,
0
,
sizeof
nval
);
nval
.
flags
=
DB_DBT_REALLOC
;
r
=
c
->
c_get
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
r
=
toku_c_get_noassociate
(
c
,
&
currentkey
,
&
currentval
,
DB_CURRENT
+
256
);
if
(
r
!=
0
)
if
(
r
!=
0
)
r
=
c
->
c_get
(
c
,
key
,
data
,
DB_LAST
);
r
=
toku_c_get_noassociate
(
c
,
key
,
data
,
DB_LAST
);
else
{
else
{
while
(
r
==
0
)
{
while
(
r
==
0
)
{
r
=
c
->
c_get
(
c
,
&
nkey
,
&
nval
,
DB_PREV
);
r
=
toku_c_get_noassociate
(
c
,
&
nkey
,
&
nval
,
DB_PREV
);
if
(
r
!=
0
)
break
;
if
(
r
!=
0
)
break
;
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
break
;
if
(
!
keyeq
(
c
,
&
currentkey
,
&
nkey
))
break
;
}
}
if
(
r
==
0
)
r
=
c
->
c_get
(
c
,
key
,
data
,
DB_CURRENT
);
if
(
r
==
0
)
r
=
toku_c_get_noassociate
(
c
,
key
,
data
,
DB_CURRENT
);
}
}
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nkey
.
data
)
toku_free
(
nkey
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
if
(
nval
.
data
)
toku_free
(
nval
.
data
);
...
...
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