aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mnesia/src/mnesia_frag.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-03-07 16:25:31 +0100
committerDan Gudmundsson <[email protected]>2011-03-09 11:58:38 +0100
commit6a486ff2dfa285e913a1d0b013c2165c9a5a7b42 (patch)
tree74bc84edaf07b320ea30563ebc46d3c499b53631 /lib/mnesia/src/mnesia_frag.erl
parent700e0b89f7c928fbd3593a79e9038582ffb68406 (diff)
downloadotp-6a486ff2dfa285e913a1d0b013c2165c9a5a7b42.tar.gz
otp-6a486ff2dfa285e913a1d0b013c2165c9a5a7b42.tar.bz2
otp-6a486ff2dfa285e913a1d0b013c2165c9a5a7b42.zip
Applied from mnesia_frag:first patch from Magnus Henoch
"When I run mnesia:first on an empty fragmented table, it tries to access the fragment with the number one beyond the maximum. In the sample code below, I create a table with two fragments, 'foo' and 'foo_frag2', but mnesia tries to access 'foo_frag3':"
Diffstat (limited to 'lib/mnesia/src/mnesia_frag.erl')
-rw-r--r--lib/mnesia/src/mnesia_frag.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mnesia/src/mnesia_frag.erl b/lib/mnesia/src/mnesia_frag.erl
index 6cc16c80fd..9e77fe0b9f 100644
--- a/lib/mnesia/src/mnesia_frag.erl
+++ b/lib/mnesia/src/mnesia_frag.erl
@@ -209,7 +209,7 @@ first(ActivityId, Opaque, Tab) ->
end
end.
-search_first(ActivityId, Opaque, Tab, N, FH) when N =< FH#frag_state.n_fragments ->
+search_first(ActivityId, Opaque, Tab, N, FH) when N < FH#frag_state.n_fragments ->
NextN = N + 1,
NextFrag = n_to_frag_name(Tab, NextN),
case mnesia:first(ActivityId, Opaque, NextFrag) of