diff --git a/repository/src/test/java/org/alfresco/AllDBTestsTestSuite.java b/repository/src/test/java/org/alfresco/AllDBTestsTestSuite.java
index 6dddc58bbe..ec7aa1105a 100644
--- a/repository/src/test/java/org/alfresco/AllDBTestsTestSuite.java
+++ b/repository/src/test/java/org/alfresco/AllDBTestsTestSuite.java
@@ -77,6 +77,9 @@ import org.junit.runners.Suite;
// From MiscContextTestSuite
org.alfresco.repo.domain.query.CannedQueryDAOTest.class,
+ // ACS-1907
+ org.alfresco.repo.search.impl.querymodel.impl.db.ACS1907Test.class,
+
// REPO-2963 : Tests causing a cascade of failures in AllDBTestsTestSuite on PostgreSQL/MySQL
// Moved at the bottom of the suite because DbNodeServiceImplTest.testNodeCleanupRegistry() takes a long time on a clean DB.
org.alfresco.repo.node.db.DbNodeServiceImplTest.class,
diff --git a/repository/src/test/java/org/alfresco/repo/search/impl/querymodel/impl/db/ACS1907Test.java b/repository/src/test/java/org/alfresco/repo/search/impl/querymodel/impl/db/ACS1907Test.java
new file mode 100644
index 0000000000..cf70867f74
--- /dev/null
+++ b/repository/src/test/java/org/alfresco/repo/search/impl/querymodel/impl/db/ACS1907Test.java
@@ -0,0 +1,197 @@
+/*
+ * #%L
+ * Alfresco Repository
+ * %%
+ * Copyright (C) 2005 - 2021 Alfresco Software Limited
+ * %%
+ * This file is part of the Alfresco software.
+ * If the software was purchased under a paid Alfresco license, the terms of
+ * the paid license agreement will prevail. Otherwise, the software is
+ * provided under the following open source license terms:
+ *
+ * Alfresco is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Alfresco is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with Alfresco. If not, see .
+ * #L%
+ */
+package org.alfresco.repo.search.impl.querymodel.impl.db;
+
+import junit.framework.TestCase;
+import org.alfresco.model.ContentModel;
+import org.alfresco.repo.cache.TransactionalCache;
+import org.alfresco.repo.security.authentication.AuthenticationComponent;
+import org.alfresco.repo.security.authentication.AuthenticationUtil;
+import org.alfresco.repo.security.authentication.MutableAuthenticationDao;
+import org.alfresco.repo.security.permissions.AccessControlList;
+import org.alfresco.repo.transaction.RetryingTransactionHelper;
+import org.alfresco.service.cmr.repository.NodeRef;
+import org.alfresco.service.cmr.repository.NodeService;
+import org.alfresco.service.cmr.repository.StoreRef;
+import org.alfresco.service.cmr.search.ResultSet;
+import org.alfresco.service.cmr.search.ResultSetRow;
+import org.alfresco.service.cmr.search.SearchParameters;
+import org.alfresco.service.cmr.search.SearchService;
+import org.alfresco.service.cmr.security.MutableAuthenticationService;
+import org.alfresco.service.cmr.security.PermissionService;
+import org.alfresco.service.namespace.QName;
+import org.alfresco.service.transaction.TransactionService;
+import org.alfresco.util.ApplicationContextHelper;
+import org.springframework.context.ApplicationContext;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ACS1907Test extends TestCase
+{
+
+ private ApplicationContext ctx;
+
+ private NodeService nodeService;
+ private AuthenticationComponent authenticationComponent;
+ private MutableAuthenticationService authenticationService;
+ private MutableAuthenticationDao authenticationDAO;
+ private SearchService pubSearchService;
+ private PermissionService pubPermissionService;
+ private TransactionService transactionService;
+ private RetryingTransactionHelper txnHelper;
+
+ private TransactionalCache aclCache;
+ private TransactionalCache aclEntityCache;
+ private TransactionalCache permissionEntityCache;
+
+ private NodeRef rootNodeRef;
+
+ @Override
+ public void setUp() throws Exception
+ {
+ setupServices();
+ this.authenticationComponent.setSystemUserAsCurrentUser();
+ rootNodeRef = nodeService.getRootNode(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
+ setupTestUsers();
+ setupTestContent();
+ dropCaches();
+ }
+
+ @Override
+ protected void tearDown() throws Exception
+ {
+ authenticationComponent.clearCurrentSecurityContext();
+ }
+
+ private void setupServices()
+ {
+ ctx = ApplicationContextHelper.getApplicationContext();
+ nodeService = (NodeService) ctx.getBean("dbNodeService");
+ authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
+ authenticationService = (MutableAuthenticationService) ctx.getBean("authenticationService");
+ authenticationDAO = (MutableAuthenticationDao) ctx.getBean("authenticationDao");
+ pubSearchService = (SearchService) ctx.getBean("SearchService");
+ pubPermissionService = (PermissionService) ctx.getBean("PermissionService");
+ transactionService = (TransactionService) ctx.getBean("TransactionService");
+ aclCache = (TransactionalCache) ctx.getBean("aclCache");
+ aclEntityCache = (TransactionalCache) ctx.getBean("aclEntityCache");
+ permissionEntityCache = (TransactionalCache) ctx.getBean("permissionEntityCache");
+ txnHelper = transactionService.getRetryingTransactionHelper();
+ }
+
+ private void setupTestUser(String userName)
+ {
+ if (!authenticationDAO.userExists(userName))
+ {
+ authenticationService.createAuthentication(userName, userName.toCharArray());
+ }
+ }
+
+ private void setupTestUsers()
+ {
+ txnHelper.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback