aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/ets_SUITE.erl
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2010-07-06 20:28:51 +0200
committerSverker Eriksson <[email protected]>2010-07-07 14:31:58 +0200
commitac90c289ab5ce18395c5fa53c30b38bc5f50ae1d (patch)
treed2d5c15054299553fdef69113871fe17cf2f59be /lib/stdlib/test/ets_SUITE.erl
parent91078fbc7b0719150a0c7749a1de9e5c0c9bbdeb (diff)
downloadotp-ac90c289ab5ce18395c5fa53c30b38bc5f50ae1d.tar.gz
otp-ac90c289ab5ce18395c5fa53c30b38bc5f50ae1d.tar.bz2
otp-ac90c289ab5ce18395c5fa53c30b38bc5f50ae1d.zip
Fix ets:select hanging on ordered_set with empty list as key.
erl_db_tree.c incorrectly used NIL (empty list) as "lastkey" to mark start of the iteration. A real NIL key could then cause a select or match iteration to be restarted over and over again if the last key before a trap happended to be NIL. Changed NIL to THE_NON_VALUE. Should be ok as the initial key value can never be put into any continuation tuple.
Diffstat (limited to 'lib/stdlib/test/ets_SUITE.erl')
-rw-r--r--lib/stdlib/test/ets_SUITE.erl15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 13c87ca005..fe8e481121 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -63,7 +63,8 @@
meta_lookup_unnamed_read/1, meta_lookup_unnamed_write/1,
meta_lookup_named_read/1, meta_lookup_named_write/1,
meta_newdel_unnamed/1, meta_newdel_named/1]).
--export([smp_insert/1, smp_fixed_delete/1, smp_unfix_fix/1, smp_select_delete/1, otp_8166/1]).
+-export([smp_insert/1, smp_fixed_delete/1, smp_unfix_fix/1, smp_select_delete/1,
+ otp_8166/1, otp_8732/1]).
-export([exit_large_table_owner/1,
exit_many_large_table_owner/1,
exit_many_tables_owner/1,
@@ -129,7 +130,7 @@ all(suite) ->
t_select_delete, t_ets_dets, memory,
t_bucket_disappears,
select_fail,t_insert_new, t_repair_continuation, otp_5340, otp_6338,
- otp_6842_select_1000, otp_7665,
+ otp_6842_select_1000, otp_7665, otp_8732,
meta_wb,
grow_shrink, grow_pseudo_deleted, shrink_pseudo_deleted,
meta_smp,
@@ -5010,8 +5011,14 @@ verify_table_load(T) ->
end.
-
-
+otp_8732(doc) -> ["ets:select on a tree with NIL key object"];
+otp_8732(Config) when is_list(Config) ->
+ Tab = ets:new(noname,[ordered_set]),
+ filltabstr(Tab,999),
+ ets:insert(Tab,{[],"nasty NIL object"}),
+ ?line [] = ets:match(Tab,{'_',nomatch}), %% Will hang if bug not fixed
+ ok.
+
smp_select_delete(suite) -> [];
smp_select_delete(doc) ->