Commit 673435d4 authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

throw a better error message for row size errors. addresses #1766

git-svn-id: file:///svn/toku/tokudb@12659 c7de825b-a66e-492c-adef-691d508d4ae1
parent 3dac1ed8
...@@ -3115,11 +3115,13 @@ db_put_check_size_constraints(DB *db, DBT *key, DBT *val) { ...@@ -3115,11 +3115,13 @@ db_put_check_size_constraints(DB *db, DBT *key, DBT *val) {
if (dupsort) { if (dupsort) {
limit = nodesize / BRT_FANOUT; limit = nodesize / BRT_FANOUT;
if (key->size + val->size > limit) if (key->size + val->size > limit)
r = toku_ydb_do_error(db->dbenv, EINVAL, "The largest (key + val) item allowed is %u bytes", limit-1); r = toku_ydb_do_error(db->dbenv, EINVAL, "The largest row (key + val) allowed is %u bytes", limit);
} else { } else {
limit = nodesize / BRT_FANOUT; limit = nodesize / BRT_FANOUT;
if (key->size > limit || val->size > nodesize) if (key->size > limit)
r = toku_ydb_do_error(db->dbenv, EINVAL, "The largest key or val item allowed is %u bytes", limit-1); r = toku_ydb_do_error(db->dbenv, EINVAL, "The largest key allowed is %u bytes", limit);
else if (val->size > nodesize)
r = toku_ydb_do_error(db->dbenv, EINVAL, "The largest value allowed is %u bytes", nodesize);
} }
return r; return r;
} }
......
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