[erlang-questions] Some mnesia oddity

Dan Gudmundsson <>
Tue Oct 7 08:30:44 CEST 2008



Ben Hood wrote:
> Dan,
> 
> On Mon, Oct 6, 2008 at 8:32 AM, Dan Gudmundsson <> 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
> delete_object.

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.

Regards
/Dan
> Thx,
> Ben
> 



More information about the erlang-questions mailing list