From b2d96d0753c6e0383deb946dcaf4e3769e2b1f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Mon, 16 Aug 2010 16:55:35 +0200 Subject: [PATCH] Fix gen_storage:matchrules_transform_conditions/2 for =/=, and, andalso, or and orelse. --- src/gen_storage.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gen_storage.erl b/src/gen_storage.erl index e7de376f4..99af489fe 100644 --- a/src/gen_storage.erl +++ b/src/gen_storage.erl @@ -287,7 +287,7 @@ matchrules_to_mnesia_matchspec(Tab, MatchRules) -> %% TODO: special handling for '=='? matchrules_transform_conditions(Attributes, {Op, Attribute, Value}) when Op =:= '='; Op =:= '=='; Op =:= '=:='; Op =:= like; - Op =:= '<'; Op =:= '>'; Op =:= '>='; Op =:= '=<' -> + Op =:= '=/='; Op =:= '<'; Op =:= '>'; Op =:= '>='; Op =:= '=<' -> Var = case list_find(Attribute, Attributes) of false -> exit(unknown_attribute); N -> list_to_atom([$$ | integer_to_list(N)]) @@ -311,9 +311,9 @@ matchrules_transform_conditions(Attributes, {Op, Attribute, Value}) end; matchrules_transform_conditions(Attributes, T) when is_tuple(T) -> - L = tuple_to_list(T), + L = tl(tuple_to_list(T)), L2 = [matchrules_transform_conditions(Attributes, E) || E <- L], - list_to_tuple(L2). + list_to_tuple([element(1, T) | L2]). matchrules_transform_column_op(like, Expression, Pattern) ->