-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes neo4j/apoc#126: apoc.periodic.submit fails with schema operations (core) #208
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, just see the comment about cherry-picking. Regarding 'NOTE FOR THE REVIEWER':
- I would not create schema equivalents for the other ones (maybe not for this one either, as I think it is a good enough solution to throw an error rather than fail silently)
- I think it could be worth to make the same fix for apoc.trigger.add, either in this or a separate PR.
@Test | ||
public void testSubmitWithSchemaOperation() { | ||
try { | ||
testCall(db, "CALL apoc.periodic.submit('subSchema','CREATE INDEX periodicIdx FOR (n:Bar) ON (n.first_name, n.last_name)')", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you cherry-pick to 4.x, it would be good to also add a test for CALL db.createUniquePropertyConstraint
(that has been removed in Neo4j 5.0) to make sure this fix the original reported issue.
…ns (neo4j/apoc#208) * Fixes neo4j/apoc#126: apoc.periodic.submit fails with schema operations (core) * removed unused import
…ns (neo4j/apoc#208) (#3234) * Fixes neo4j/apoc#126: apoc.periodic.submit fails with schema operations (neo4j/apoc#208) * Fixes neo4j/apoc#126: Improve validateQuery (neo4j/apoc#218)
…ns (neo4j/apoc#208) (neo4j-contrib#3234) * Fixes neo4j/apoc#126: apoc.periodic.submit fails with schema operations (neo4j/apoc#208) * Fixes neo4j/apoc#126: Improve validateQuery (neo4j/apoc#218)
…ns (neo4j/apoc#208) (#3234) (#3246) * Fixes neo4j/apoc#126: apoc.periodic.submit fails with schema operations (neo4j/apoc#208) * Fixes neo4j/apoc#126: Improve validateQuery (neo4j/apoc#218) * removed unused imports * fixed full compilation error
Fixes #126 (core part)
Added QueryType validations in
validateQuery()
method, so as to fail if the procedure tries to execute schema operationsRefactored
apoc.periodic.submit
code in order to be reused in extended.In Fixes neo4j/apoc#126: apoc.periodic.submit fails with schema operations (extended) neo4j-contrib/neo4j-apoc-procedures#3211, added
apoc.periodic.submitSchema
procedure, equivalent but with differentvalidateQuery()
andorg.neo4j.procedure.Mode.SCHEMA
NOTE FOR REVIEWER:
apoc.trigger.add
has thevalidateQuery()
, maybe can be changed in the same way? (also in this case, perhaps in another pr)