Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HAMANO Tsukasa
OpenLDAP
Commits
8e7bb204
Commit
8e7bb204
authored
Jan 15, 2013
by
Howard Chu
Browse files
ITS#7485 data sizes limited to 32 bits
That's all we have space for in a node record.
parent
1a0d02c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb.c
View file @
8e7bb204
...
...
@@ -344,9 +344,9 @@ static txnid_t mdb_debug_start;
/** @brief The maximum size of a key in the database.
*
* W
hile data items have essentially unbounded size, we require tha
t
*
keys all fit onto a regular page. This limit could be raised a bi
t
*
further if needed; to something just
under #MDB_PAGESIZE / #MDB_MINKEYS.
* W
e require that keys all fit onto a regular page. This limi
t
*
could be raised a bit further if needed; to something jus
t
* under #MDB_PAGESIZE / #MDB_MINKEYS.
*
* Note that data items in an #MDB_DUPSORT database are actually keys
* of a subDB, so they're also limited to this size.
...
...
@@ -355,6 +355,12 @@ static txnid_t mdb_debug_start;
#define MDB_MAXKEYSIZE 511
#endif
/** @brief The maximum size of a data item.
*
* We only store a 32 bit value for node sizes.
*/
#define MAXDATASIZE 0xffffffffUL
#if MDB_DEBUG
/** A key buffer.
* @ingroup debug
...
...
@@ -4812,6 +4818,11 @@ mdb_cursor_put(MDB_cursor *mc, MDB_val *key, MDB_val *data,
if
(
F_ISSET
(
mc
->
mc_db
->
md_flags
,
MDB_DUPSORT
)
&&
data
->
mv_size
>
MDB_MAXKEYSIZE
)
return
EINVAL
;
#if SIZE_MAX > MAXDATASIZE
if
(
data
->
mv_size
>
MAXDATASIZE
)
return
EINVAL
;
#endif
DPRINTF
(
"==> put db %u key [%s], size %zu, data size %zu"
,
mc
->
mc_dbi
,
DKEY
(
key
),
key
?
key
->
mv_size
:
0
,
data
->
mv_size
);
...
...
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