diff --git a/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/DeprecationAcceptanceTest.java b/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/DeprecationAcceptanceTest.java index c4b01a7102433..23711d41569d6 100644 --- a/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/DeprecationAcceptanceTest.java +++ b/community/community-it/cypher-it/src/test/java/org/neo4j/cypher/internal/javacompat/DeprecationAcceptanceTest.java @@ -24,12 +24,10 @@ import java.util.Arrays; import java.util.List; -import java.util.Map; import java.util.stream.Stream; import org.neo4j.graphdb.InputPosition; import org.neo4j.graphdb.Notification; -import org.neo4j.graphdb.QueryExecutionException; import org.neo4j.graphdb.Result; import org.neo4j.graphdb.SeverityLevel; import org.neo4j.graphdb.Transaction; @@ -37,12 +35,8 @@ import org.neo4j.procedure.Procedure; import static org.hamcrest.Matchers.any; -import static org.hamcrest.Matchers.contains; import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.equalTo; import static org.junit.Assert.assertThat; -import static org.neo4j.graphdb.impl.notification.NotificationCode.CREATE_UNIQUE_UNAVAILABLE_FALLBACK; -import static org.neo4j.graphdb.impl.notification.NotificationCode.DEPRECATED_PLANNER; public class DeprecationAcceptanceTest extends NotificationTestSupport { @@ -56,7 +50,19 @@ public void deprecatedRulePlanner() InputPosition position = InputPosition.empty; // then - assertThat( result.getNotifications(), containsItem( deprecatedPlanner ) ); + assertThat( result.getNotifications(), containsItem( deprecatedRulePlanner ) ); + result.close(); + } + + @Test + public void deprecatedCompiledRuntime() + { + // when + Result result = db().execute( "CYPHER runtime=compiled RETURN 1" ); + InputPosition position = InputPosition.empty; + + // then + assertThat( result.getNotifications(), containsItem( deprecatedCompiledRuntime ) ); result.close(); } @@ -284,10 +290,14 @@ public Stream changedProc() notification( "Neo.ClientNotification.Statement.FeatureDeprecationWarning", containsString( "The query used a deprecated function." ), any( InputPosition.class ), SeverityLevel.WARNING ); - private Matcher deprecatedPlanner = + private Matcher deprecatedRulePlanner = notification( "Neo.ClientNotification.Statement.FeatureDeprecationWarning", containsString( "The rule planner, which was used to plan this query, is deprecated and will be discontinued soon. If you did not explicitly choose the rule planner, you should try to change your query so that the rule planner is not used" ), any( InputPosition.class ), SeverityLevel.WARNING ); + private Matcher deprecatedCompiledRuntime = + notification( "Neo.ClientNotification.Statement.FeatureDeprecationWarning", containsString( "The compiled runtime, which was requested to execute this query, is deprecated and will be removed in a future release." ), + any( InputPosition.class ), SeverityLevel.WARNING ); + private Matcher deprecatedStartWarning = notification( "Neo.ClientNotification.Statement.FeatureDeprecationWarning", containsString( "START has been deprecated and will be removed in a future version. " ), any( InputPosition.class ), SeverityLevel.WARNING ); diff --git a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/Notifications.scala b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/Notifications.scala index 24371d2ab9888..7d8a5db7fe2cd 100644 --- a/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/Notifications.scala +++ b/community/cypher/cypher-planner-3.5/src/main/scala/org/neo4j/cypher/internal/compiler/v3_5/Notifications.scala @@ -63,6 +63,8 @@ case class ProcedureWarningNotification(position: InputPosition, procedure: Stri case class DeprecatedFieldNotification(position: InputPosition, procedure: String, field: String) extends InternalNotification -case object DeprecatedPlannerNotification extends InternalNotification +case object DeprecatedRulePlannerNotification extends InternalNotification + +case object DeprecatedCompiledRuntimeNotification extends InternalNotification case class ExperimentalFeatureNotification(msg: String) extends InternalNotification diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/MasterCompiler.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/MasterCompiler.scala index ab609751b557b..b7e8062b8395b 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/MasterCompiler.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/MasterCompiler.scala @@ -141,7 +141,10 @@ class MasterCompiler(graph: GraphDatabaseQueryService, } if (preParsedQuery.planner == CypherPlannerOption.rule) - logger.log(DeprecatedPlannerNotification) + logger.log(DeprecatedRulePlannerNotification) + + if (preParsedQuery.runtime == CypherRuntimeOption.compiled) + logger.log(DeprecatedCompiledRuntimeNotification) // Do the compilation innerCompile(preParsedQuery, params) diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala index e2ffe31226a4c..1e7ba8efc0450 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_1/ExecutionResultWrapper.scala @@ -251,7 +251,7 @@ object ExecutionResultWrapper { case DeprecatedProcedureNotification(pos, oldName, newName) => NotificationCode.DEPRECATED_PROCEDURE.notification(pos.withOffset(offset).asInputPosition, NotificationDetail.Factory.deprecatedName(oldName, newName)) case DeprecatedPlannerNotification => - NotificationCode.DEPRECATED_PLANNER.notification(graphdb.InputPosition.empty) + NotificationCode.DEPRECATED_RULE_PLANNER.notification(graphdb.InputPosition.empty) } private implicit class ConvertibleCompilerInputPosition(pos: frontend.v3_1.InputPosition) { diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_4/helpers.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_4/helpers.scala index 84ea6b2d32610..98bdba59c930c 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_4/helpers.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_4/helpers.scala @@ -150,7 +150,7 @@ object helpers { case nfV3_4.DeprecatedFieldNotification(position, procedure, field) => compilerv3_5.DeprecatedFieldNotification(as3_5(position), procedure, field) case nfV3_4.DeprecatedVarLengthBindingNotification(position, variable) => nfv3_5.DeprecatedVarLengthBindingNotification(as3_5(position), variable) case nfV3_4.DeprecatedRelTypeSeparatorNotification(position) => nfv3_5.DeprecatedRelTypeSeparatorNotification(as3_5(position)) - case nfV3_4.DeprecatedPlannerNotification => compilerv3_5.DeprecatedPlannerNotification + case nfV3_4.DeprecatedPlannerNotification => compilerv3_5.DeprecatedRulePlannerNotification case nfV3_4.ExperimentalFeatureNotification(msg) => compilerv3_5.ExperimentalFeatureNotification(msg) case nfV3_4.SuboptimalIndexForContainsQueryNotification(label, propertyKeys) => compilerv3_5.SuboptimalIndexForConstainsQueryNotification(label, propertyKeys) case nfV3_4.SuboptimalIndexForEndsWithQueryNotification(label, propertyKeys) => compilerv3_5.SuboptimalIndexForEndsWithQueryNotification(label, propertyKeys) diff --git a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala index c693cfc267481..cb35f8f564468 100644 --- a/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala +++ b/community/cypher/cypher/src/main/scala/org/neo4j/cypher/internal/compatibility/v3_5/runtime/helpers/InternalWrapping.scala @@ -79,8 +79,10 @@ object InternalWrapping { NotificationCode.DEPRECATED_BINDING_VAR_LENGTH_RELATIONSHIP.notification(pos.withOffset(offset).asInputPosition, NotificationDetail.Factory.bindingVarLengthRelationship(variable)) case DeprecatedRelTypeSeparatorNotification(pos) => NotificationCode.DEPRECATED_RELATIONSHIP_TYPE_SEPARATOR.notification(pos.withOffset(offset).asInputPosition) - case DeprecatedPlannerNotification => - NotificationCode.DEPRECATED_PLANNER.notification(graphdb.InputPosition.empty) + case DeprecatedRulePlannerNotification => + NotificationCode.DEPRECATED_RULE_PLANNER.notification(graphdb.InputPosition.empty) + case DeprecatedCompiledRuntimeNotification => + NotificationCode.DEPRECATED_COMPILED_RUNTIME.notification(graphdb.InputPosition.empty) case ProcedureWarningNotification(pos, name, warning) => NotificationCode.PROCEDURE_WARNING.notification(pos.withOffset(offset).asInputPosition, NotificationDetail.Factory.procedureWarning(name, warning)) case ExperimentalFeatureNotification(msg) => diff --git a/community/kernel/src/main/java/org/neo4j/graphdb/impl/notification/NotificationCode.java b/community/kernel/src/main/java/org/neo4j/graphdb/impl/notification/NotificationCode.java index f457e5189a61b..69ea737b5d473 100644 --- a/community/kernel/src/main/java/org/neo4j/graphdb/impl/notification/NotificationCode.java +++ b/community/kernel/src/main/java/org/neo4j/graphdb/impl/notification/NotificationCode.java @@ -46,13 +46,18 @@ public enum NotificationCode Status.Statement.FeatureDeprecationWarning, "Using PLANNER for switching between planners has been deprecated, please use CYPHER planner=[rule,cost] instead" ), - DEPRECATED_PLANNER( + DEPRECATED_RULE_PLANNER( SeverityLevel.WARNING, Status.Statement.FeatureDeprecationWarning, "The rule planner, which was used to plan this query, is deprecated and will be discontinued soon. " + "If you did not explicitly choose the rule planner, you should try to change your query so that the " + "rule planner is not used" ), + DEPRECATED_COMPILED_RUNTIME( + SeverityLevel.WARNING, + Status.Statement.FeatureDeprecationWarning, + "The compiled runtime, which was requested to execute this query, is deprecated and will be removed in a future release." + ), PLANNER_UNSUPPORTED( SeverityLevel.WARNING, Status.Statement.PlannerUnsupportedWarning,