Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang
2005-Don-t-wrap-continuations-from-mnesia_ext-b...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2005-Don-t-wrap-continuations-from-mnesia_ext-backends.patch of Package erlang
From 98dc4f8c225982cca0bc1fd221167ee9f4031547 Mon Sep 17 00:00:00 2001 From: Richard Carlsson <richardc@klarna.com> Date: Wed, 9 Nov 2016 16:15:29 +0100 Subject: [PATCH] Don't wrap continuations from mnesia_ext backends Continuations returned from mnesia_ext backends were originally wrapped with the backend module, but that was a remnant of the earliest implementation, and is not actually needed, since Mnesia already knows what the table storage type is when it applies the continuation. When mnesia_ext was ported to OTP 19, the wrapper got changed to use the table type alias instead of the module, which triggered an error in the mnesia_eleveldb backend. This patch removes the wrapping completely. --- lib/mnesia/src/mnesia_lib.erl | 16 +++------------- lib/mnesia/test/ext_test.erl | 4 ++-- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/lib/mnesia/src/mnesia_lib.erl b/lib/mnesia/src/mnesia_lib.erl index 10e232c..1fdc656 100644 --- a/lib/mnesia/src/mnesia_lib.erl +++ b/lib/mnesia/src/mnesia_lib.erl @@ -1192,25 +1192,15 @@ db_select(Storage, Tab, Pat) -> end. db_select_init({ext, Alias, Mod}, Tab, Pat, Limit) -> - case Mod:select(Alias, Tab, Pat, Limit) of - {Matches, Continuation} when is_list(Matches) -> - {Matches, {Alias, Continuation}}; - R -> - R - end; + Mod:select(Alias, Tab, Pat, Limit); db_select_init(disc_only_copies, Tab, Pat, Limit) -> dets:select(Tab, Pat, Limit); db_select_init(_, Tab, Pat, Limit) -> ets:select(Tab, Pat, Limit). -db_select_cont({ext, Alias, Mod}, Cont0, Ms) -> +db_select_cont({ext, _Alias, Mod}, Cont0, Ms) -> Cont = Mod:repair_continuation(Cont0, Ms), - case Mod:select(Cont) of - {Matches, Continuation} when is_list(Matches) -> - {Matches, {Alias, Continuation}}; - R -> - R - end; + Mod:select(Cont); db_select_cont(disc_only_copies, Cont0, Ms) -> Cont = dets:repair_continuation(Cont0, Ms), dets:select(Cont); diff --git a/lib/mnesia/test/ext_test.erl b/lib/mnesia/test/ext_test.erl index 45ddb14..b7904c9 100644 --- a/lib/mnesia/test/ext_test.erl +++ b/lib/mnesia/test/ext_test.erl @@ -233,5 +233,5 @@ select_1({Acc, C}) -> select(ext_ets, Tab, Ms, Limit) when is_integer(Limit); Limit =:= infinity -> ets:select(mnesia_lib:val({?MODULE,Tab}), Ms, Limit). -repair_continuation({Alias, Cont}, Ms) -> - {Alias, ets:repair_continuation(Cont, Ms)}. +repair_continuation(Cont, Ms) -> + ets:repair_continuation(Cont, Ms). -- 2.10.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor