[erlang-questions] Strange behaviour of ets

Maxim Treskin <>
Wed Feb 27 13:01:21 CET 2008


Hello

I see some strange behaviour of ets interaction.
After I did an error in ets:select request, all following requests are
erroneous until, i.e. ets:new
It is my session:

--------------------------

()89> ets:new(test, [public, named_table]).
test
()90> ets:insert(test, {{as, 2}, 23}).
true
()91> ets:insert(test, {{qwe, 5}, 756}).
true
()92> ets:insert(test, {{xcv, 3}, 111}).
true
()93> ets:select(test, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
[111,756,23]
()94>

All is OK

()94> ets:select(qwe, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
** exception error: bad argument
     in function  ets:select/2
        called as ets:select(qwe,[{{{'$1','$2'},'$3'},[],['$3']}])

Error

()95> ets:select(test, [{{{'$1', '$2'}, '$3'}, [], ['$3']}]).
** exception error: bad argument
     in function  ets:select/2
        called as ets:select(test,[{{{'$1','$2'},'$3'},[],['$3']}])

The same request as in 93 line, error also

--------------------------

Why this error happens?


Thank you

-- 
Maxim Treskin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080227/4d042b6d/attachment.html>


More information about the erlang-questions mailing list