diff options
author | Dan Gudmundsson <[email protected]> | 2016-05-24 16:17:51 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2016-05-24 16:17:51 +0200 |
commit | cba63cdb2c236c7e0a90070bb10217d5297f9dd7 (patch) | |
tree | 9fe9a457d85b0a0942dbecac36333885d39e0ebf /lib/mnesia/src/mnesia_index.erl | |
parent | 83b3007c6776be6e35ad8909af1a9d0707baa4d9 (diff) | |
download | otp-cba63cdb2c236c7e0a90070bb10217d5297f9dd7.tar.gz otp-cba63cdb2c236c7e0a90070bb10217d5297f9dd7.tar.bz2 otp-cba63cdb2c236c7e0a90070bb10217d5297f9dd7.zip |
mnesia: Fix index match return patterns
When building match result patterns the tuples they must qouted
with { }, which causes a problem with variable patterns.
Use element(1, Match) instead of trying to build the two tuple.
Diffstat (limited to 'lib/mnesia/src/mnesia_index.erl')
-rw-r--r-- | lib/mnesia/src/mnesia_index.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/mnesia/src/mnesia_index.erl b/lib/mnesia/src/mnesia_index.erl index 73d170d1fa..c79f790973 100644 --- a/lib/mnesia/src/mnesia_index.erl +++ b/lib/mnesia/src/mnesia_index.erl @@ -513,11 +513,11 @@ db_put({dets, Ixt}, V) -> ok = dets:insert(Ixt, V). db_get({ram, _}=Ixt, IxKey) -> - Pat = [{{{IxKey, '$1'}}, [], [{{IxKey,'$1'}}]}], + Pat = [{{{IxKey, '$1'}}, [], [{element, 1, '$_'}]}], db_select(Ixt, Pat); db_get({{ext,_,_} = _Storage, {_,_,{_,Type}}} = Ixt, IxKey) -> Pat = case Type of - ordered -> [{{{IxKey, '$1'}}, [], [{{IxKey,'$1'}}]}]; + ordered -> [{{{IxKey, '$1'}}, [], [{element, 1, '$_'}]}]; bag -> [{{IxKey, '_'}, [], ['$_']}] end, db_select(Ixt, Pat); |