diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2010-06-30 09:49:50 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2010-06-30 09:49:50 +0000 |
commit | 2831a53515d0be4cd77a3acf18bb57abeb2651a4 (patch) | |
tree | 4dc973de84051d9f669cad33ed1ac365422f5233 /src | |
parent | 374eace8115a502011e6598ec7177f409f6b2410 (diff) |
Bug fix when creating a DB with the option 'sys_db' and the number of current opened DBs corresponds to the max_open_dbs config parameter.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@959246 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/couchdb/couch_server.erl | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/couchdb/couch_server.erl b/src/couchdb/couch_server.erl index 65e4b7a0..f8b362dd 100644 --- a/src/couchdb/couch_server.erl +++ b/src/couchdb/couch_server.erl @@ -329,13 +329,19 @@ handle_call({create, DbName, Options}, From, Server) -> ok -> case ets:lookup(couch_dbs_by_name, DbName) of [] -> - case maybe_close_lru_db(Server) of - {ok, Server2} -> - Filepath = get_full_filename(Server, DbNameList), - {noreply, open_async(Server2, From, DbName, Filepath, + Filepath = get_full_filename(Server, DbNameList), + case lists:member(sys_db, Options) of + true -> + {noreply, open_async(Server, From, DbName, Filepath, + [create | Options])}; + false -> + case maybe_close_lru_db(Server) of + {ok, Server2} -> + {noreply, open_async(Server2, From, DbName, Filepath, [create | Options])}; - CloseError -> - {reply, CloseError, Server} + CloseError -> + {reply, CloseError, Server} + end end; [_AlreadyRunningDb] -> {reply, file_exists, Server} |