diff --git a/include/errinj.h b/include/errinj.h index 9f4f2c4e94d8a8f8568e3946a76d9bb18c5f9eb5..c9e13c3ee758d659bc2144397ba4438e28f228cb 100644 --- a/include/errinj.h +++ b/include/errinj.h @@ -53,6 +53,7 @@ bool errinj_get(int id); void errinj_set(int id, bool state); int errinj_set_byname(char *name, bool state); +struct tbuf; void errinj_info(struct tbuf *out); #ifdef NDEBUG diff --git a/src/box/index.m b/src/box/index.m index 168a8a69b6fef4fa8437f012d17a0928cb47f6c1..f8df3ff3b368e88997ae7dc239b0a50df2d07683 100644 --- a/src/box/index.m +++ b/src/box/index.m @@ -500,7 +500,7 @@ int32_tuple_to_node(struct tuple *tuple, struct key_def *key_def) if (k != mh_end(int_hash)) ret = mh_i32ptr_node(int_hash, k)->val; #ifdef DEBUG - say_debug("Hash32Index find(self:%p, key:%i) = %p", self, num, ret); + say_debug("Hash32Index find(self:%p, key:%i) = %p", self, node.key, ret); #endif return ret; } @@ -521,7 +521,7 @@ int32_tuple_to_node(struct tuple *tuple, struct key_def *key_def) ERROR_INJECT(ERRINJ_INDEX_ALLOC, { mh_i32ptr_del(int_hash, pos, NULL, NULL); - pos = mh_end(int_hash); + pos = mh_end(int_hash); }); if (pos == mh_end(int_hash)) { @@ -662,7 +662,7 @@ int64_tuple_to_node(struct tuple *tuple, struct key_def *key_def) if (k != mh_end(int64_hash)) ret = mh_i64ptr_node(int64_hash, k)->val; #ifdef DEBUG - say_debug("Hash64Index find(self:%p, key:%"PRIu64") = %p", self, num, ret); + say_debug("Hash64Index find(self:%p, key:%"PRIu64") = %p", self, node.key, ret); #endif return ret; } @@ -683,7 +683,7 @@ int64_tuple_to_node(struct tuple *tuple, struct key_def *key_def) ERROR_INJECT(ERRINJ_INDEX_ALLOC, { mh_i64ptr_del(int64_hash, pos, NULL, NULL); - pos = mh_end(int64_hash); + pos = mh_end(int64_hash); }); if (pos == mh_end(int64_hash)) { tnt_raise(LoggedError, :ER_MEMORY_ISSUE, (ssize_t) pos, @@ -840,7 +840,7 @@ lstrptr_tuple_to_node(struct tuple *tuple, struct key_def *key_def) ERROR_INJECT(ERRINJ_INDEX_ALLOC, { mh_lstrptr_del(str_hash, pos, NULL, NULL); - pos = mh_end(str_hash); + pos = mh_end(str_hash); }); if (pos == mh_end(str_hash)) { diff --git a/test/big/hash.result b/test/big/hash.result index ed62e042a46172f3f94d18b840707802357aa2bb..56c1ba70d46f0fcd88c52e3dfd648c40b068759d 100644 --- a/test/big/hash.result +++ b/test/big/hash.result @@ -420,6 +420,9 @@ lua box.space[11]:truncate() lua box.space[12]:truncate() --- ... +lua box.space[21]:truncate() +--- +... insert into t21 values (0, 0, 0, 0) Insert OK, 1 row affected insert into t21 values (1, 1, 1, 1) diff --git a/test/big/hash.test b/test/big/hash.test index 0f3b7c4a99160d5dd4ba792060865f4e142f71d9..51c46574092d540d1b34acf510427594c2ee57da 100644 --- a/test/big/hash.test +++ b/test/big/hash.test @@ -270,6 +270,8 @@ exec admin "lua box.space[12]:truncate()" # hash::replace tests # +exec admin "lua box.space[21]:truncate()" + exec sql "insert into t21 values (0, 0, 0, 0)" exec sql "insert into t21 values (1, 1, 1, 1)" exec sql "insert into t21 values (2, 2, 2, 2)" @@ -343,13 +345,4 @@ exec sql "select * from t21 WHERE k2 = 10" exec sql "select * from t21 WHERE k3 = 10" exec sql "select * from t21 WHERE k3 = 0" -# alloc test -#exec admin "set injection ERRINJ_INDEX_ALLOC on" -#exec sql "insert into t21 values (10, 10, 10, 10)" -#exec sql "select * from t21 WHERE k0 = 10" -#exec sql "select * from t21 WHERE k1 = 10" -#exec sql "select * from t21 WHERE k2 = 10" -#exec sql "select * from t21 WHERE k3 = 10" -#exec admin "set injection ERRINJ_INDEX_ALLOC off" - exec admin "lua box.space[21]:truncate()" diff --git a/test/big/suite.ini b/test/big/suite.ini index a7d20861193f0e45a52e5ed574549ae238cd7ac3..4c9d65bcc5f5f528c7e51e57a5d3bdf7de8fc46b 100644 --- a/test/big/suite.ini +++ b/test/big/suite.ini @@ -5,3 +5,4 @@ config = tarantool.cfg # disabled = lua.test # put disabled in valgrind test here #valgrind_disabled = ... +release_disabled = hash_errinj.test diff --git a/test/big/tree_pk.result b/test/big/tree_pk.result index e4760e9ca2f8fafd30f194a6744a53f15410aeba..47d1de4390b9638e389cbc474e7b066e80b16474 100644 --- a/test/big/tree_pk.result +++ b/test/big/tree_pk.result @@ -129,6 +129,9 @@ lua box.space[15].index[0]:select_range(3, 'abcdb') lua box.space[15]:truncate() --- ... +lua box.space[22]:truncate() +--- +... insert into t22 values (0, 0, 0, 0) Insert OK, 1 row affected insert into t22 values (1, 1, 1, 1) @@ -269,28 +272,6 @@ Found 3 tuples: [0, 0, 0, 0] [4, 4, 0, 4] [6, 6, 0, 6] -set injection ERRINJ_INDEX_ALLOC on ---- -ok -... -insert into t22 values (10, 10, 10, 10) -Insert OK, 1 row affected -select * from t22 WHERE k0 = 10 -Found 1 tuple: -[10, 10, 10, 10] -select * from t22 WHERE k1 = 10 -Found 1 tuple: -[10, 10, 10, 10] -select * from t22 WHERE k2 = 10 -Found 1 tuple: -[10, 10, 10, 10] -select * from t22 WHERE k3 = 10 -Found 1 tuple: -[10, 10, 10, 10] -set injection ERRINJ_INDEX_ALLOC off ---- -ok -... lua box.space[22]:truncate() --- ... diff --git a/test/big/tree_pk.test b/test/big/tree_pk.test index b7cfb3fb292103732970bff830416022567c2bd9..91f5fe57b4ecad0d6dade64f0fec71cf69d12514 100644 --- a/test/big/tree_pk.test +++ b/test/big/tree_pk.test @@ -84,6 +84,8 @@ exec admin "lua box.space[15]:truncate()" # tree::replace tests # +exec admin "lua box.space[22]:truncate()" + exec sql "insert into t22 values (0, 0, 0, 0)" exec sql "insert into t22 values (1, 1, 1, 1)" exec sql "insert into t22 values (2, 2, 2, 2)" @@ -166,14 +168,5 @@ exec sql "select * from t22 WHERE k2 = 0" exec sql "delete from t22 WHERE k0 = 5" exec sql "select * from t22 WHERE k2 = 0" -# tree alloc test -exec admin "set injection ERRINJ_INDEX_ALLOC on" -exec sql "insert into t22 values (10, 10, 10, 10)" -exec sql "select * from t22 WHERE k0 = 10" -exec sql "select * from t22 WHERE k1 = 10" -exec sql "select * from t22 WHERE k2 = 10" -exec sql "select * from t22 WHERE k3 = 10" -exec admin "set injection ERRINJ_INDEX_ALLOC off" - exec admin "lua box.space[22]:truncate()"