aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia_lib.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-09-21 12:17:13 +0200
committerDan Gudmundsson <[email protected]>2011-09-21 12:17:13 +0200
commita192733e4d2b4d74a1ce11bd75c9e59da8f41e0d (patch)
treea8d38b6ebe970252b2de2e83e2812f499b8f3e89 /lib/mnesia/src/mnesia_lib.erl
parente58fa57a4936ad16e81ed05441fc5c85fabafb5d (diff)
parent7b6012a75f26219e5a8c803a0509d97d1b00c73a (diff)
downloadotp-a192733e4d2b4d74a1ce11bd75c9e59da8f41e0d.tar.gz
otp-a192733e4d2b4d74a1ce11bd75c9e59da8f41e0d.tar.bz2
otp-a192733e4d2b4d74a1ce11bd75c9e59da8f41e0d.zip
Merge branch 'dev' into major
Diffstat (limited to 'lib/mnesia/src/mnesia_lib.erl')
-rw-r--r--lib/mnesia/src/mnesia_lib.erl6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/mnesia/src/mnesia_lib.erl b/lib/mnesia/src/mnesia_lib.erl
index 775d370d0f..ae6631646c 100644
--- a/lib/mnesia/src/mnesia_lib.erl
+++ b/lib/mnesia/src/mnesia_lib.erl
@@ -1141,12 +1141,18 @@ db_erase(ram_copies, Tab, Key) -> ?ets_delete(Tab, Key), ok;
db_erase(disc_copies, Tab, Key) -> ?ets_delete(Tab, Key), ok;
db_erase(disc_only_copies, Tab, Key) -> dets:delete(Tab, Key).
+db_match_erase(Tab, '_') ->
+ db_delete_all(val({Tab, storage_type}),Tab);
db_match_erase(Tab, Pat) ->
db_match_erase(val({Tab, storage_type}), Tab, Pat).
db_match_erase(ram_copies, Tab, Pat) -> ?ets_match_delete(Tab, Pat), ok;
db_match_erase(disc_copies, Tab, Pat) -> ?ets_match_delete(Tab, Pat), ok;
db_match_erase(disc_only_copies, Tab, Pat) -> dets:match_delete(Tab, Pat).
+db_delete_all(ram_copies, Tab) -> ets:delete_all_objects(Tab);
+db_delete_all(disc_copies, Tab) -> ets:delete_all_objects(Tab);
+db_delete_all(disc_only_copies, Tab) -> dets:delete_all_objects(Tab).
+
db_first(Tab) ->
db_first(val({Tab, storage_type}), Tab).
db_first(ram_copies, Tab) -> ?ets_first(Tab);