Commit a9814e0a authored by Yoni Fogel's avatar Yoni Fogel

closes[t:2720] Fix bug in get_iname test.

dbt.size should be length of string, not size of pointer

git-svn-id: file:///svn/toku/tokudb@21052 c7de825b-a66e-492c-adef-691d508d4ae1
parent 96b3ab64
...@@ -302,7 +302,7 @@ get_inames(DBT* inames, DB** dbs) { ...@@ -302,7 +302,7 @@ get_inames(DBT* inames, DB** dbs) {
for (i = 0; i < NUM_DBS; i++) { for (i = 0; i < NUM_DBS; i++) {
DBT dname; DBT dname;
char * dname_str = dbs[i]->i->dname; char * dname_str = dbs[i]->i->dname;
dbt_init(&dname, dname_str, sizeof(dname_str)); dbt_init(&dname, dname_str, strlen(dname_str)+1);
dbt_init(&(inames[i]), NULL, 0); dbt_init(&(inames[i]), NULL, 0);
inames[i].flags |= DB_DBT_MALLOC; inames[i].flags |= DB_DBT_MALLOC;
int r = env->get_iname(env, &dname, &inames[i]); int r = env->get_iname(env, &dname, &inames[i]);
......
...@@ -132,7 +132,7 @@ get_inames(DBT* inames, DB** dbs) { ...@@ -132,7 +132,7 @@ get_inames(DBT* inames, DB** dbs) {
for (i = 0; i < NUM_DBS; i++) { for (i = 0; i < NUM_DBS; i++) {
DBT dname; DBT dname;
char * dname_str = dbs[i]->i->dname; char * dname_str = dbs[i]->i->dname;
dbt_init(&dname, dname_str, sizeof(dname_str)); dbt_init(&dname, dname_str, strlen(dname_str)+1);
dbt_init(&(inames[i]), NULL, 0); dbt_init(&(inames[i]), NULL, 0);
inames[i].flags |= DB_DBT_MALLOC; inames[i].flags |= DB_DBT_MALLOC;
int r = env->get_iname(env, &dname, &inames[i]); int r = env->get_iname(env, &dname, &inames[i]);
......
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