summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoan Touzet <wohali@users.noreply.github.com>2020-01-30 04:07:12 +0000
committerGitHub <noreply@github.com>2020-01-30 04:07:12 +0000
commite180e43f375f0be42d0681ef9cbea74886c082eb (patch)
treee1f196e30bf3a651dedf78501dbeb876216bac2b
parent763000ec5e9d1014469c39158ad1993db9018c42 (diff)
parent040dca40e4829c7fb2f7131918f1592987897637 (diff)
downloadcouchdb-e180e43f375f0be42d0681ef9cbea74886c082eb.tar.gz
Merge branch 'master' into fix/clean-otp-vsn
-rw-r--r--.gitignore1
-rw-r--r--build-aux/Jenkinsfile.full26
-rw-r--r--build-aux/Jenkinsfile.pr10
-rw-r--r--rebar.config.script4
-rw-r--r--rel/overlay/etc/default.ini5
-rw-r--r--src/mango/src/mango_selector_text.erl3
-rw-r--r--src/mango/test/06-basic-text-test.py18
-rw-r--r--src/mango/test/user_docs.py1
-rw-r--r--src/setup/src/setup.erl2
9 files changed, 46 insertions, 24 deletions
diff --git a/.gitignore b/.gitignore
index 3fa860c59..e2f3df073 100644
--- a/.gitignore
+++ b/.gitignore
@@ -111,6 +111,7 @@ src/couch_tests/ebin/
src/global_changes/ebin/
src/mango/ebin/
src/mango/test/*.pyc
+src/mango/nosetests.xml
src/mango/venv/
test/javascript/junit.xml
diff --git a/build-aux/Jenkinsfile.full b/build-aux/Jenkinsfile.full
index b9067a192..b1d46e846 100644
--- a/build-aux/Jenkinsfile.full
+++ b/build-aux/Jenkinsfile.full
@@ -81,7 +81,7 @@ pipeline {
agent {
docker {
label 'docker'
- image 'couchdbdev/debian-stretch-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/debian-stretch-erlang-20.3.8.25-1:latest'
args "${DOCKER_ARGS}"
alwaysPull true
}
@@ -161,7 +161,7 @@ pipeline {
stage('CentOS 6') {
agent {
docker {
- image 'couchdbdev/centos-6-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/centos-6-erlang-20.3.8.25-1:latest'
label 'docker'
args "${DOCKER_ARGS}"
alwaysPull true
@@ -205,7 +205,7 @@ pipeline {
stage('CentOS 7') {
agent {
docker {
- image 'couchdbdev/centos-7-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/centos-7-erlang-20.3.8.25-1:latest'
label 'docker'
args "${DOCKER_ARGS}"
alwaysPull true
@@ -250,7 +250,7 @@ pipeline {
stage('CentOS 8') {
agent {
docker {
- image 'couchdbdev/centos-8-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/centos-8-erlang-20.3.8.25-1:latest'
label 'docker'
args "${DOCKER_ARGS}"
alwaysPull true
@@ -295,7 +295,7 @@ pipeline {
stage('Ubuntu Xenial') {
agent {
docker {
- image 'couchdbdev/ubuntu-xenial-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/ubuntu-xenial-erlang-20.3.8.25-1:latest'
label 'docker'
args "${DOCKER_ARGS}"
alwaysPull true
@@ -339,7 +339,7 @@ pipeline {
stage('Ubuntu Bionic') {
agent {
docker {
- image 'couchdbdev/ubuntu-bionic-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/ubuntu-bionic-erlang-20.3.8.25-1:latest'
label 'docker'
alwaysPull true
args "${DOCKER_ARGS}"
@@ -383,7 +383,7 @@ pipeline {
stage('Debian Stretch') {
agent {
docker {
- image 'couchdbdev/debian-stretch-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/debian-stretch-erlang-20.3.8.25-1:latest'
label 'docker'
alwaysPull true
args "${DOCKER_ARGS}"
@@ -427,7 +427,7 @@ pipeline {
stage('Debian Buster amd64') {
agent {
docker {
- image 'couchdbdev/debian-buster-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/debian-buster-erlang-20.3.8.25-1:latest'
label 'docker'
alwaysPull true
args "${DOCKER_ARGS}"
@@ -471,7 +471,7 @@ pipeline {
stage('Debian Buster arm64v8') {
agent {
docker {
- image 'couchdbdev/arm64v8-debian-buster-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/arm64v8-debian-buster-erlang-20.3.8.25-1:latest'
label 'arm64v8'
alwaysPull true
args "${DOCKER_ARGS}"
@@ -515,7 +515,7 @@ pipeline {
stage('Debian Buster ppc64le') {
agent {
docker {
- image 'couchdbdev/ppc64le-debian-buster-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/ppc64le-debian-buster-erlang-20.3.8.25-1:latest'
label 'ppc64le'
alwaysPull true
args "${DOCKER_ARGS}"
@@ -584,12 +584,12 @@ pipeline {
}
stage('Pull latest docker image') {
steps {
- sh "docker pull couchdbdev/arm64v8-debian-buster-erlang-20.3.8.24-1:latest"
+ sh "docker pull couchdbdev/arm64v8-debian-buster-erlang-20.3.8.25-1:latest"
}
}
stage('Build from tarball & test & packages') {
steps {
- withDockerContainer(image: "couchdbdev/arm64v8-debian-buster-erlang-20.3.8.24-1:latest", args: "${DOCKER_ARGS}") {
+ withDockerContainer(image: "couchdbdev/arm64v8-debian-buster-erlang-20.3.8.25-1:latest", args: "${DOCKER_ARGS}") {
unstash 'tarball'
withEnv(['MIX_HOME='+pwd(), 'HEX_HOME='+pwd()]) {
sh( script: build_and_test )
@@ -629,7 +629,7 @@ pipeline {
agent {
docker {
- image 'couchdbdev/debian-buster-erlang-20.3.8.24-1:latest'
+ image 'couchdbdev/debian-buster-erlang-20.3.8.25-1:latest'
label 'docker'
alwaysPull true
args "${DOCKER_ARGS}"
diff --git a/build-aux/Jenkinsfile.pr b/build-aux/Jenkinsfile.pr
index cf287b225..8c9cbd930 100644
--- a/build-aux/Jenkinsfile.pr
+++ b/build-aux/Jenkinsfile.pr
@@ -12,7 +12,6 @@
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
-
build_and_test = '''
mkdir -p ${COUCHDB_IO_LOG_DIR} ${ERLANG_VERSION}
cd ${ERLANG_VERSION}
@@ -46,11 +45,12 @@ pipeline {
// npm config cache below deals with /home/jenkins not mapping correctly
// inside the image
DOCKER_ARGS = '-e npm_config_cache=npm-cache -e HOME=. -v=/etc/passwd:/etc/passwd -v /etc/group:/etc/group'
- // Also be sure to change these values in the matrix below...
+ // *** BE SURE TO CHANGE THE ERLANG VERSION FARTHER DOWN S WELL ***
+ // Search for ERLANG_VERSION
// see https://issues.jenkins-ci.org/browse/JENKINS-40986
LOW_ERLANG_VER = '20.3.8.11'
- MID_ERLANG_VER = '20.3.8.24'
- HIGH_ERLANG_VER = '22.2'
+ MID_ERLANG_VER = '20.3.8.25'
+ HIGH_ERLANG_VER = '22.2.3'
}
options {
@@ -106,7 +106,7 @@ pipeline {
axes {
axis {
name 'ERLANG_VERSION'
- values "20.3.8.11", "20.3.8.24", "22.2"
+ values "20.3.8.11", "20.3.8.25", "22.2.3"
}
}
diff --git a/rebar.config.script b/rebar.config.script
index 3356c83b5..d356ac20e 100644
--- a/rebar.config.script
+++ b/rebar.config.script
@@ -144,8 +144,8 @@ DepDescs = [
%% Independent Apps
{config, "config", {tag, "2.1.7"}},
{b64url, "b64url", {tag, "1.0.1"}},
-{ets_lru, "ets-lru", {tag, "1.0.0"}},
-{khash, "khash", {tag, "1.0.1"}},
+{ets_lru, "ets-lru", {tag, "1.1.0"}},
+{khash, "khash", {tag, "1.1.0"}},
{snappy, "snappy", {tag, "CouchDB-1.0.4"}},
%% Non-Erlang deps
diff --git a/rel/overlay/etc/default.ini b/rel/overlay/etc/default.ini
index 3f72b605a..599942d44 100644
--- a/rel/overlay/etc/default.ini
+++ b/rel/overlay/etc/default.ini
@@ -69,8 +69,9 @@ default_engine = couch
; is 10GiB. A value of 0 or less will disable partition size checks.
;max_partition_size = 10737418240
;
-; Start node in single_node mode so default databases are created immediately.
-;single_node = true
+; When true, system databases _users and _replicator are created immediately
+; on startup if not present.
+;single_node = false
[purge]
; Allowed maximum number of documents in one purge request
diff --git a/src/mango/src/mango_selector_text.erl b/src/mango/src/mango_selector_text.erl
index 9e1116de6..b3b61ff26 100644
--- a/src/mango/src/mango_selector_text.erl
+++ b/src/mango/src/mango_selector_text.erl
@@ -366,7 +366,8 @@ value_str(Value) when is_binary(Value) ->
true ->
<<"\"", Value/binary, "\"">>;
false ->
- mango_util:lucene_escape_query_value(Value)
+ Escaped = mango_util:lucene_escape_query_value(Value),
+ <<"\"", Escaped/binary, "\"">>
end;
value_str(Value) when is_integer(Value) ->
list_to_binary(integer_to_list(Value));
diff --git a/src/mango/test/06-basic-text-test.py b/src/mango/test/06-basic-text-test.py
index db7cf32cb..a3fe383d6 100644
--- a/src/mango/test/06-basic-text-test.py
+++ b/src/mango/test/06-basic-text-test.py
@@ -95,6 +95,9 @@ class BasicTextTests(mango.UserDocsTextTests):
assert len(docs) == 1
assert docs[0]["company"] == "Affluex"
+ docs = self.db.find({"foo": {"$lt": "bar car apple"}})
+ assert len(docs) == 0
+
def test_lte(self):
docs = self.db.find({"age": {"$lte": 21}})
assert len(docs) == 0
@@ -113,6 +116,10 @@ class BasicTextTests(mango.UserDocsTextTests):
for d in docs:
assert d["user_id"] in (0, 11)
+ docs = self.db.find({"foo": {"$lte": "bar car apple"}})
+ assert len(docs) == 1
+ assert docs[0]["user_id"] == 14
+
def test_eq(self):
docs = self.db.find({"age": 21})
assert len(docs) == 0
@@ -156,6 +163,13 @@ class BasicTextTests(mango.UserDocsTextTests):
docs = self.db.find({"company": {"$gt": "Zialactic"}})
assert len(docs) == 0
+ docs = self.db.find({"foo": {"$gt": "bar car apple"}})
+ assert len(docs) == 0
+
+ docs = self.db.find({"foo": {"$gt": "bar car"}})
+ assert len(docs) == 1
+ assert docs[0]["user_id"] == 14
+
def test_gte(self):
docs = self.db.find({"age": {"$gte": 77}})
assert len(docs) == 2
@@ -178,6 +192,10 @@ class BasicTextTests(mango.UserDocsTextTests):
assert len(docs) == 1
assert docs[0]["company"] == "Zialactic"
+ docs = self.db.find({"foo": {"$gte": "bar car apple"}})
+ assert len(docs) == 1
+ assert docs[0]["user_id"] == 14
+
def test_and(self):
docs = self.db.find({"age": 22, "manager": True})
assert len(docs) == 1
diff --git a/src/mango/test/user_docs.py b/src/mango/test/user_docs.py
index e0495353b..f6a33960e 100644
--- a/src/mango/test/user_docs.py
+++ b/src/mango/test/user_docs.py
@@ -343,6 +343,7 @@ DOCS = [
"city": "Axis",
"address": {"street": "Brightwater Avenue", "number": 1106},
},
+ "foo" : "bar car apple",
"company": "Pharmex",
"email": "faithhess@pharmex.com",
"favorites": ["Erlang", "Python", "Lisp"],
diff --git a/src/setup/src/setup.erl b/src/setup/src/setup.erl
index 12a3f4351..3d23229b8 100644
--- a/src/setup/src/setup.erl
+++ b/src/setup/src/setup.erl
@@ -75,7 +75,7 @@ is_single_node_enabled(Dbs) ->
end.
cluster_system_dbs() ->
- ["_users", "_replicator", "_global_changes"].
+ ["_users", "_replicator"].
has_cluster_system_dbs([]) ->