Commit 666ceccb authored by Bradley C. Kuszmaul's avatar Bradley C. Kuszmaul

Improve accuracy of put documentation. Addresses #52.

git-svn-id: file:///svn/tokudb@1215 c7de825b-a66e-492c-adef-691d508d4ae1
parent 8bb4423f
@page
@section @code{DB->put} @section @code{DB->put}
@setfilename tokudb @setfilename tokudb
@settitle DB->put @settitle DB->put
...@@ -26,7 +27,7 @@ Data items are limited to 256KB in size (for now.) ...@@ -26,7 +27,7 @@ Data items are limited to 256KB in size (for now.)
@c man begin PARAMETERS @c man begin PARAMETERS
@table @var @table @var
@item db @item db
The @code{DB} handle for the database}. The @code{DB} handle for the database.
@item txnid @item txnid
Either @code{NULL} or a @code{TXNID}. Either @code{NULL} or a @code{TXNID}.
@item key @item key
...@@ -34,11 +35,15 @@ The key to be inserted. ...@@ -34,11 +35,15 @@ The key to be inserted.
@item data @item data
The data to be inserted. The data to be inserted.
@item flags @item flags
Must not be zero, but instead must be one of the following flagsd:. Must be zero or must be one of the following flags. However, @code{flags} must be nonzero for sorted duplicates.
@table @code @table @code
@item 0
For non-dup databases, insert the new key/data pair, overwriting any pair with a matching key.
Zero is not allowed databases with duplicates (returns @code{EINVAL}).
@item DB_YESOVERWRITE @item DB_YESOVERWRITE
Insert the new key/data pair, overwriting any matching pair.. If the Insert the new key/data pair, overwriting any matching pair. If the
database supports sorted duplicates, then the matching key/data pair database supports sorted duplicates, then the matching key/data pair
(if any) is overwritten. If the database does not support duplicates, (if any) is overwritten. If the database does not support duplicates,
then the pair with a matching key (if any) is overwritten. (TokuDB then the pair with a matching key (if any) is overwritten. (TokuDB
...@@ -64,6 +69,7 @@ it the implementation must perform a @code{DB->get} to determine ...@@ -64,6 +69,7 @@ it the implementation must perform a @code{DB->get} to determine
whether the pair already exists. whether the pair already exists.
@end table @end table
Rationale: Using @code{0} for flags does not give the results that Rationale: Using @code{0} for flags does not give the results that
many users expect. The Berkeley DB documentation says that someday many users expect. The Berkeley DB documentation says that someday
they will support duplicate duplicates, and that if you want the they will support duplicate duplicates, and that if you want the
...@@ -96,9 +102,12 @@ In an environment configured for lock timeouts, the system was unable to grant a ...@@ -96,9 +102,12 @@ In an environment configured for lock timeouts, the system was unable to grant a
@item ENOENT @item ENOENT
The file or directory does not exist. The file or directory does not exist.
@item EINVAL @item EINVAL
You passed invalid parameters to this operation. You passed invalid parameters to this operation.
If @var{flags} is zero, returns @code{BEINVAL}. In particular, if you pass 0 to a database configured for duplicates,
then @code{DB->put()} returns @code{EINVAL}.
@end table
@c man end @c man end
@include everyman.texi @include everyman.texi
......
...@@ -39,6 +39,8 @@ Copyright @copyright{} 2007, Tokutek, Inc. ...@@ -39,6 +39,8 @@ Copyright @copyright{} 2007, Tokutek, Inc.
@include tdb_del.texi @include tdb_del.texi
@include tdb_put.texi
@node Index @node Index
@unnumbered Index @unnumbered Index
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment