From d1caf51b8eb166ce483cdf3b0935509fe88751b7 Mon Sep 17 00:00:00 2001 From: Anton Persson Date: Fri, 12 Nov 2021 13:51:10 +0100 Subject: [PATCH] Replace usage of removed db.indexes() with SHOW INDEXES --- .../cypher/MultiStatementCypherSubGraphExporter.java | 2 +- .../java/apoc/schema/SchemasEnterpriseFeaturesTest.java | 7 ++++--- full/src/test/resources/signatures.csv | 1 - 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/apoc/export/cypher/MultiStatementCypherSubGraphExporter.java b/core/src/main/java/apoc/export/cypher/MultiStatementCypherSubGraphExporter.java index a713cf2ee7..bf5e2208c4 100644 --- a/core/src/main/java/apoc/export/cypher/MultiStatementCypherSubGraphExporter.java +++ b/core/src/main/java/apoc/export/cypher/MultiStatementCypherSubGraphExporter.java @@ -229,7 +229,7 @@ private void exportSchema(PrintWriter out) { } private List exportIndexes() { - return db.executeTransactionally("CALL db.indexes()", Collections.emptyMap(), result -> result.stream() + return db.executeTransactionally("SHOW INDEXES", Collections.emptyMap(), result -> result.stream() .map(map -> { if ("LOOKUP".equals(map.get("type"))) { return ""; diff --git a/core/src/test/java/apoc/schema/SchemasEnterpriseFeaturesTest.java b/core/src/test/java/apoc/schema/SchemasEnterpriseFeaturesTest.java index 51f1328281..dd861dc476 100644 --- a/core/src/test/java/apoc/schema/SchemasEnterpriseFeaturesTest.java +++ b/core/src/test/java/apoc/schema/SchemasEnterpriseFeaturesTest.java @@ -7,14 +7,15 @@ import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; -import org.neo4j.driver.Record; -import org.neo4j.driver.Session; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.stream.Collectors; +import org.neo4j.driver.Record; +import org.neo4j.driver.Session; + import static apoc.util.TestContainerUtil.createEnterpriseDB; import static apoc.util.TestContainerUtil.testCall; import static apoc.util.TestContainerUtil.testResult; @@ -285,7 +286,7 @@ public void testIndexOnMultipleProperties() { }); String indexName = session.readTransaction(tx -> { - String name = tx.run("CALL db.indexes() YIELD name RETURN name").single().get("name").asString(); + String name = tx.run("SHOW INDEXES YIELD name RETURN name").single().get("name").asString(); tx.commit(); return name; }); diff --git a/full/src/test/resources/signatures.csv b/full/src/test/resources/signatures.csv index 84c332379e..b4d81c2b04 100644 --- a/full/src/test/resources/signatures.csv +++ b/full/src/test/resources/signatures.csv @@ -415,7 +415,6 @@ db.index.fulltext.drop,db.index.fulltext.drop(indexName :: STRING?) :: VOID db.index.fulltext.listAvailableAnalyzers,"db.index.fulltext.listAvailableAnalyzers() :: (analyzer :: STRING?, description :: STRING?)" db.index.fulltext.queryNodes,"db.index.fulltext.queryNodes(indexName :: STRING?, queryString :: STRING?) :: (node :: NODE?, score :: FLOAT?)" db.index.fulltext.queryRelationships,"db.index.fulltext.queryRelationships(indexName :: STRING?, queryString :: STRING?) :: (relationship :: RELATIONSHIP?, score :: FLOAT?)" -db.indexes,"db.indexes() :: (description :: STRING?, indexName :: STRING?, tokenNames :: LIST? OF STRING?, properties :: LIST? OF STRING?, state :: STRING?, type :: STRING?, progress :: FLOAT?, provider :: MAP?, id :: INTEGER?, failureMessage :: STRING?)" db.labels,db.labels() :: (label :: STRING?) db.propertyKeys,db.propertyKeys() :: (propertyKey :: STRING?) db.relationshipTypes,db.relationshipTypes() :: (relationshipType :: STRING?)