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
5cff170a
Commit
5cff170a
authored
Jan 31, 2008
by
Vincenzo Liberatore
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#Addresses 311.
git-svn-id:
file:///svn/tokudb@1997
c7de825b-a66e-492c-adef-691d508d4ae1
parent
62dc15e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
42 deletions
+45
-42
src/lock_tree/locktree.h
src/lock_tree/locktree.h
+45
-42
No files found.
src/lock_tree/locktree.h
View file @
5cff170a
...
@@ -204,53 +204,56 @@ int toku_lt_acquire_read_lock(toku_lock_tree* tree, DB_TXN* txn,
...
@@ -204,53 +204,56 @@ int toku_lt_acquire_read_lock(toku_lock_tree* tree, DB_TXN* txn,
const
DBT
*
key
,
const
DBT
*
data
);
const
DBT
*
key
,
const
DBT
*
data
);
/*
/*
* Acquires a read lock on a key range (or key/data range). (Closed range).
Acquires a read lock on a key range (or key/data range). (Closed range).
* Params:
* tree: The lock tree for the db.
\param tree: The lock tree for the db.
* txn: The TOKU Transaction this lock is for.
\param txn: The TOKU Transaction this lock is for.
* key_left: The left end key of the range.
\param key_left: The left end key of the range.
* data_left: The left end data of the range.
\param data_left: The left end data of the range.
* key_right: The right end key of the range.
\param key_right: The right end key of the range.
* data_right: The right end data of the range.
\param data_right: The right end data of the range.
* Returns:
* 0: Success.
\return
* DB_LOCK_NOTGRANTED: If there is a conflict in getting the lock.
- 0: Success.
* This can only happen if some other transaction has
- DB_LOCK_NOTGRANTED: If there is a conflict in getting the lock.
* a write lock that overlaps this range.
This can only happen if some other transaction has
* EINVAL: If (tree == NULL || txn == NULL ||
a write lock that overlaps this range.
* key_left == NULL || key_right == NULL) or
- EDOM: In a DB_DUPSORT db:
* (tree->db is dupsort &&
If (key_left, data_left) > (key_right, data_right) or
* (data_left == NULL || data_right == NULL)) or
In a nodup db: if (key_left) > (key_right)
* (tree->db is nodup &&
(According to the db's comparison functions.)
* (data_left != NULL || data_right != NULL)) or
- ENOMEM: If adding the lock would exceed the maximum
* (tree->db is dupsort && key_left != data_left &&
memory allowed for payloads.
* (key_left == toku_lt_infinity ||
* key_left == toku_lt_neg_infinity)) or
The following is asserted, but if this library is ever exported to users,
* (tree->db is dupsort && key_right != data_right &&
EINVAL should be used instead:
* (key_right == toku_lt_infinity ||
If (tree == NULL || txn == NULL ||
* key_right == toku_lt_neg_infinity))
key_left == NULL || key_right == NULL) or
* EDOM: In a DB_DUPSORT db:
(tree->db is dupsort &&
* If (key_left, data_left) > (key_right, data_right) or
(data_left == NULL || data_right == NULL)) or
* In a nodup db: if (key_left) > (key_right)
(tree->db is nodup &&
* (According to the db's comparison functions.
(data_left != NULL || data_right != NULL)) or
* ENOMEM: If adding the lock would exceed the maximum
(tree->db is dupsort && key_left != data_left &&
* memory allowed for payloads.
(key_left == toku_lt_infinity ||
* Asserts:
key_left == toku_lt_neg_infinity)) or
* The EINVAL and ERANGE cases described will use assert to abort instead of returning errors.
(tree->db is dupsort && key_right != data_right &&
* If this library is ever exported to users, we will use error datas instead.
(key_right == toku_lt_infinity ||
* Memory:
key_right == toku_lt_neg_infinity))
* It is safe to free keys and datas after this call.
* If the lock tree needs to hold onto the key or data, it will make copies
Memory: It is safe to free keys and datas after this call.
* to its local memory.
If the lock tree needs to hold onto the key or data, it will make copies
* *** Note that txn == NULL is not supported at this time.
to its local memory.
Note that txn == NULL is not supported at this time.
In BDB, txn can actually be NULL (mixed operations with transactions and
no transactions). This can cause conflicts, nobody was unable (so far)
to verify that MySQL does or does not use this.
*/
*/
int
toku_lt_acquire_range_read_lock
(
toku_lock_tree
*
tree
,
DB_TXN
*
txn
,
int
toku_lt_acquire_range_read_lock
(
toku_lock_tree
*
tree
,
DB_TXN
*
txn
,
const
DBT
*
key_left
,
const
DBT
*
data_left
,
const
DBT
*
key_left
,
const
DBT
*
data_left
,
const
DBT
*
key_right
,
const
DBT
*
data_right
);
const
DBT
*
key_right
,
const
DBT
*
data_right
);
//In BDB, txn can actually be NULL (mixed operations with transactions and no transactions).
//This can cause conflicts, I was unable (so far) to verify that MySQL does or does not use
//this.
/*
/*
* Acquires a write lock on a single key (or key/data).
* Acquires a write lock on a single key (or key/data).
* Params:
* Params:
...
...
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