[erlang-questions] Some mnesia oddity
Tue Oct 7 08:30:44 CEST 2008
Ben Hood wrote:
> On Mon, Oct 6, 2008 at 8:32 AM, Dan Gudmundsson <dgud@REDACTED> wrote:
>> You should be able to read the table in the same transaction,
>> but there is a bug in mnesia handling the special atom '_'.
>> delete_object is not match delete do you have records with '_' in them??
> Yes, but I may be missing the point. The test case I attached in my
> previous mail leads me to believe that wildcards do actually work with
No it doesn't, see the first mail in this thread, if it does in some cases it is a bug
too, is shouldn't work.
> As for the visibility of the deleted records, the same test case shows
> that deleted records are still visible to subsequent reads within the
> same transaction. Are you saying that this is the expected behavior?
That's a part of the bug above, you shouldn't see the deleted records,
but then since you are not suppose to be able to delete them with the wildcard
> Or should I modify the test to iterate over the table with
> match_object and delete the records via their key?
Yes, or clear_table (but that's not allowed inside a transaction).
I will probably disallow '_' and '$[1-n]' in mnesia:delete_object.
More information about the erlang-questions