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
79896edf
Commit
79896edf
authored
May 27, 2008
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A better fix for #865. Fixes #865.
git-svn-id:
file:///svn/tokudb@4166
c7de825b-a66e-492c-adef-691d508d4ae1
parent
2feb06fa
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
18 deletions
+12
-18
newbrt/tests/ybt-test.c
newbrt/tests/ybt-test.c
+12
-18
No files found.
newbrt/tests/ybt-test.c
View file @
79896edf
...
...
@@ -14,14 +14,12 @@ static void ybt_test0 (void) {
toku_init_dbt
(
&
t0
);
toku_init_dbt
(
&
t1
);
{
char
*
temp1
=
"hello"
;
char
**
temp1p
=
&
temp1
;
toku_dbt_set_value
(
&
t0
,
(
bytevec
*
)
temp1p
,
6
,
&
v0
,
FALSE
);
bytevec
temp1
=
"hello"
;
toku_dbt_set_value
(
&
t0
,
&
temp1
,
6
,
&
v0
,
FALSE
);
}
{
char
*
temp2
=
"foo"
;
char
**
temp2p
=
&
temp2
;
toku_dbt_set_value
(
&
t1
,
(
bytevec
*
)
temp2p
,
4
,
&
v1
,
FALSE
);
bytevec
temp2
=
"foo"
;
toku_dbt_set_value
(
&
t1
,
&
temp2
,
4
,
&
v1
,
FALSE
);
}
assert
(
t0
.
size
==
6
);
assert
(
strcmp
(
t0
.
data
,
"hello"
)
==
0
);
...
...
@@ -29,9 +27,8 @@ static void ybt_test0 (void) {
assert
(
strcmp
(
t1
.
data
,
"foo"
)
==
0
);
{
char
*
temp3
=
"byebye"
;
char
**
temp3p
=
&
temp3
;
toku_dbt_set_value
(
&
t1
,
(
bytevec
*
)
temp3p
,
7
,
&
v0
,
FALSE
);
/* Use v0, not v1 */
bytevec
temp3
=
"byebye"
;
toku_dbt_set_value
(
&
t1
,
&
temp3
,
7
,
&
v0
,
FALSE
);
/* Use v0, not v1 */
}
// This assertion would be wrong, since v0 may have been realloc'd, and t0.data may now point
// at the wrong place
...
...
@@ -46,9 +43,8 @@ static void ybt_test0 (void) {
t0
.
flags
=
DB_DBT_USERMEM
;
t0
.
ulen
=
0
;
{
char
*
temp4
=
"hello"
;
char
**
temp4p
=&
temp4
;
toku_dbt_set_value
(
&
t0
,
(
bytevec
*
)
temp4p
,
6
,
0
,
FALSE
);
bytevec
temp4
=
"hello"
;
toku_dbt_set_value
(
&
t0
,
&
temp4
,
6
,
0
,
FALSE
);
}
assert
(
t0
.
data
==
0
);
assert
(
t0
.
size
==
6
);
...
...
@@ -58,18 +54,16 @@ static void ybt_test0 (void) {
t0
.
flags
=
DB_DBT_REALLOC
;
v0
=
0
;
{
char
*
temp5
=
"internationalization"
;
char
**
temp5p
=
&
temp5
;
toku_dbt_set_value
(
&
t0
,
(
bytevec
*
)
temp5p
,
21
,
&
v0
,
FALSE
);
bytevec
temp5
=
"internationalization"
;
toku_dbt_set_value
(
&
t0
,
&
temp5
,
21
,
&
v0
,
FALSE
);
}
assert
(
v0
==
0
);
/* Didn't change v0 */
assert
(
t0
.
size
==
21
);
assert
(
strcmp
(
t0
.
data
,
"internationalization"
)
==
0
);
{
char
*
temp6
=
"provincial"
;
char
**
temp6p
=
&
temp6
;
toku_dbt_set_value
(
&
t0
,
(
bytevec
*
)
temp6p
,
11
,
&
v0
,
FALSE
);
bytevec
temp6
=
"provincial"
;
toku_dbt_set_value
(
&
t0
,
&
temp6
,
11
,
&
v0
,
FALSE
);
}
assert
(
t0
.
size
==
11
);
assert
(
strcmp
(
t0
.
data
,
"provincial"
)
==
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