diff options
author | Dan Gudmundsson <[email protected]> | 2011-09-19 17:45:48 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2011-09-19 17:45:48 +0200 |
commit | 533aeba2211bc29bf2a207737d74ffa52a46bdec (patch) | |
tree | 0cbe8f0775dd3fdad0a0311039062205c70cb583 /lib/mnesia/src/mnesia_log.erl | |
parent | 7ebf84abf7e5d06ce9ef6ec11783318aa393093d (diff) | |
download | otp-533aeba2211bc29bf2a207737d74ffa52a46bdec.tar.gz otp-533aeba2211bc29bf2a207737d74ffa52a46bdec.tar.bz2 otp-533aeba2211bc29bf2a207737d74ffa52a46bdec.zip |
[mnesia] Use dedicated api for clearing tables
Mainly to correctly clear dets tables. It may also be faster to use
the dedicated functions.
Diffstat (limited to 'lib/mnesia/src/mnesia_log.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_log.erl | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/mnesia/src/mnesia_log.erl b/lib/mnesia/src/mnesia_log.erl index 9e804cc4c2..94153473cb 100644 --- a/lib/mnesia/src/mnesia_log.erl +++ b/lib/mnesia/src/mnesia_log.erl @@ -1021,7 +1021,8 @@ add_recs([LogH|Rest], N) LogH#log_header.log_version >= "1.0" -> add_recs(Rest, N); add_recs([{{Tab, _Key}, _Val, clear_table} | Rest], N) -> - true = ets:match_delete(Tab, '_'), - add_recs(Rest, N+ets:info(Tab, size)); + Size = ets:info(Tab, size), + true = ets:delete_all_objects(Tab), + add_recs(Rest, N+Size); add_recs([], N) -> N. |