couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rnew...@apache.org
Subject fabric commit: updated refs/heads/master to eb7c126
Date Wed, 12 Aug 2015 15:59:27 GMT
Repository: couchdb-fabric
Updated Branches:
  refs/heads/master b6659c834 -> eb7c12650


Use `couch_db:validate_dbname/1`


Project: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/commit/eb7c1265
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/tree/eb7c1265
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-fabric/diff/eb7c1265

Branch: refs/heads/master
Commit: eb7c1265022881017e53d42fbd79884280c37a28
Parents: b6659c8
Author: ILYA Khlopotov <iilyak@ca.ibm.com>
Authored: Fri Jul 31 11:41:48 2015 -0700
Committer: ILYA Khlopotov <iilyak@ca.ibm.com>
Committed: Tue Aug 11 12:28:07 2015 -0700

----------------------------------------------------------------------
 src/fabric_db_create.erl | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fabric/blob/eb7c1265/src/fabric_db_create.erl
----------------------------------------------------------------------
diff --git a/src/fabric_db_create.erl b/src/fabric_db_create.erl
index 6678d5b..ffbf78a 100644
--- a/src/fabric_db_create.erl
+++ b/src/fabric_db_create.erl
@@ -17,7 +17,6 @@
 -include_lib("mem3/include/mem3.hrl").
 -include_lib("couch/include/couch_db.hrl").
 
--define(DBNAME_REGEX, "^[a-z][a-z0-9\\_\\$()\\+\\-\\/]*$").
 
 %% @doc Create a new database, and all its partition files across the cluster
 %%      Options is proplist with user_ctx, n, q, validate_name
@@ -42,15 +41,7 @@ validate_dbname(DbName, Options) ->
     false ->
         ok;
     true ->
-        case re:run(DbName, ?DBNAME_REGEX, [{capture,none}, dollar_endonly]) of
-        match ->
-            ok;
-        nomatch ->
-            case lists:member(?b2l(DbName), ?SYSTEM_DATABASES) of
-            true -> ok;
-            false -> {error, illegal_database_name}
-            end
-        end
+        couch_db:validate_dbname(DbName)
     end.
 
 generate_shard_map(DbName, Options) ->


Mime
View raw message