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
5e13febe
Commit
5e13febe
authored
Jan 15, 2008
by
Rich Prohaska
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multithread check DBT.flags
git-svn-id:
file:///svn/tokudb@1674
c7de825b-a66e-492c-adef-691d508d4ae1
parent
a5969563
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
+14
-9
src/ydb.c
src/ydb.c
+14
-9
No files found.
src/ydb.c
View file @
5e13febe
int
rfp
=
0
;
/* -*- mode: C; c-basic-offset: 4 -*- */
#ident "Copyright (c) 2007 Tokutek Inc. All rights reserved."
...
...
@@ -1528,7 +1526,7 @@ static int toku_db_del(DB *db, DB_TXN *txn, DBT *key, u_int32_t flags) {
memset
(
&
data
,
0
,
sizeof
(
data
));
toku_brt_get_flags
(
db
->
i
->
brt
,
&
brtflags
);
if
(
(
brtflags
&
TOKU_DB_DUPSORT
)
||
(
brtflags
&
TOKU_DB_DUP
)
)
{
if
(
brtflags
&
TOKU_DB_DUPSORT
)
{
int
r2
;
DBC
*
dbc
;
BOOL
found
=
FALSE
;
...
...
@@ -1537,7 +1535,7 @@ static int toku_db_del(DB *db, DB_TXN *txn, DBT *key, u_int32_t flags) {
* We have to make certain we cascade all the deletes. */
assert
(
db
->
i
->
primary
!=
0
);
//Primary cannot have duplicates.
r
=
db
->
cursor
(
db
,
txn
,
&
dbc
,
0
);
r
=
toku_db_
cursor
(
db
,
txn
,
&
dbc
,
0
);
if
(
r
!=
0
)
goto
cleanup
;
r
=
toku_c_get_noassociate
(
dbc
,
key
,
&
data
,
DB_SET
);
if
(
r
!=
0
)
goto
cleanup
;
...
...
@@ -1591,11 +1589,15 @@ static int toku_db_del(DB *db, DB_TXN *txn, DBT *key, u_int32_t flags) {
return
r
;
}
static
inline
int
db_thread_need_flags
(
DBT
*
dbt
)
{
return
(
dbt
->
flags
&
(
DB_DBT_MALLOC
+
DB_DBT_REALLOC
+
DB_DBT_USERMEM
))
==
0
;
}
static
int
toku_db_get
(
DB
*
db
,
DB_TXN
*
txn
,
DBT
*
key
,
DBT
*
data
,
u_int32_t
flags
)
{
HANDLE_PANICKED_DB
(
db
);
int
r
;
if
((
db
->
i
->
open_flags
&
DB_THREAD
)
&&
(
data
->
flags
&
(
DB_DBT_MALLOC
+
DB_DBT_REALLOC
+
DB_DBT_USERMEM
))
==
0
)
if
((
db
->
i
->
open_flags
&
DB_THREAD
)
&&
db_thread_need_flags
(
data
)
)
return
EINVAL
;
if
(
db
->
i
->
primary
==
0
)
r
=
toku_db_get_noassociate
(
db
,
txn
,
key
,
data
,
flags
);
...
...
@@ -1603,9 +1605,9 @@ static int toku_db_get (DB * db, DB_TXN * txn, DBT * key, DBT * data, u_int32_t
// It's a get on a secondary.
if
(
flags
==
DB_GET_BOTH
)
return
EINVAL
;
assert
(
flags
==
0
);
// We aren't ready to handle flags such as DB_READ_COMMITTED or DB_READ_UNCOMMITTED or DB_RMW
DBT
primary_key
;
memset
(
&
primary_key
,
0
,
sizeof
(
primary_key
)
);
r
=
db
->
pget
(
db
,
txn
,
key
,
&
primary_key
,
data
,
0
);
DBT
primary_key
;
memset
(
&
primary_key
,
0
,
sizeof
(
primary_key
));
primary_key
.
flags
=
DB_DBT_MALLOC
;
r
=
toku_db_pget
(
db
,
txn
,
key
,
&
primary_key
,
data
,
0
);
if
(
primary_key
.
data
)
toku_free
(
primary_key
.
data
);
}
return
r
;
}
...
...
@@ -1620,6 +1622,9 @@ static int toku_db_pget (DB *db, DB_TXN *txn, DBT *key, DBT *pkey, DBT *data, u_
assert
(
db
->
i
->
brt
!=
db
->
i
->
primary
->
i
->
brt
);
// Make sure they realy are different trees.
assert
(
db
!=
db
->
i
->
primary
);
if
((
db
->
i
->
open_flags
&
DB_THREAD
)
&&
(
db_thread_need_flags
(
pkey
)
||
db_thread_need_flags
(
data
)))
return
EINVAL
;
r
=
toku_db_cursor
(
db
,
txn
,
&
dbc
,
0
);
if
(
r
!=
0
)
return
r
;
r
=
toku_c_pget
(
dbc
,
key
,
pkey
,
data
,
DB_SET
);
...
...
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