mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Merge remote branch 'origin/mdb.master'
This commit is contained in:
commit
04ea399c7c
@ -344,9 +344,9 @@ static txnid_t mdb_debug_start;
|
|||||||
|
|
||||||
/** @brief The maximum size of a key in the database.
|
/** @brief The maximum size of a key in the database.
|
||||||
*
|
*
|
||||||
* While data items have essentially unbounded size, we require that
|
* We require that keys all fit onto a regular page. This limit
|
||||||
* keys all fit onto a regular page. This limit could be raised a bit
|
* could be raised a bit further if needed; to something just
|
||||||
* further if needed; to something just under #MDB_PAGESIZE / #MDB_MINKEYS.
|
* under #MDB_PAGESIZE / #MDB_MINKEYS.
|
||||||
*
|
*
|
||||||
* Note that data items in an #MDB_DUPSORT database are actually keys
|
* Note that data items in an #MDB_DUPSORT database are actually keys
|
||||||
* of a subDB, so they're also limited to this size.
|
* 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
|
#define MDB_MAXKEYSIZE 511
|
||||||
#endif
|
#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
|
#if MDB_DEBUG
|
||||||
/** A key buffer.
|
/** A key buffer.
|
||||||
* @ingroup debug
|
* @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)
|
if (F_ISSET(mc->mc_db->md_flags, MDB_DUPSORT) && data->mv_size > MDB_MAXKEYSIZE)
|
||||||
return EINVAL;
|
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",
|
DPRINTF("==> put db %u key [%s], size %zu, data size %zu",
|
||||||
mc->mc_dbi, DKEY(key), key ? key->mv_size:0, data->mv_size);
|
mc->mc_dbi, DKEY(key), key ? key->mv_size:0, data->mv_size);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user