vladErmakov07 commented on a change in pull request #613:
URL: https://github.com/apache/ignite-3/pull/613#discussion_r803616522
##########
File path:
modules/sql-engine/src/main/java/org/apache/ignite/internal/sql/engine/exec/ExecutionServiceImpl.java
##########
@@ -230,12 +234,33 @@ public void start() {
plan = prepareSingle(qry0, pctx);
}
+ checkQueryType(plan.type(), isQuery);
+
cursors.add(executePlan(UUID.randomUUID(), pctx, plan));
}
return cursors;
}
+ /**
+ * Check expected statement type (when it is set by JDBC) and given
statement type.
+ *
+ * @param qryType Query type.
+ * @param isQuery {@code null} if not applicable, {@code true} for select
queries,
+ * otherwise (DML/DDL queries) {@code false}.
+ */
+ private static void checkQueryType(Type qryType, Boolean isQuery) {
+ if (isQuery == null || qryType == Type.EXPLAIN) {
+ return;
+ }
+ if (isQuery && qryType != Type.QUERY) {
+ throw new IgniteInternalException("Given statement type does not
match that declared by JDBC driver");
Review comment:
I refactored error handling and moved all JDBC related messages to
JdbcQueryEventHandler. Thnx.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]