TeslaCN commented on a change in pull request #14148:
URL: https://github.com/apache/shardingsphere/pull/14148#discussion_r773709851
##########
File path:
shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/ProxySQLExecutor.java
##########
@@ -112,7 +115,16 @@ private boolean
isExecuteDDLInPostgreSQLOpenGaussTransaction(final SQLStatement
String schemaName =
backendConnection.getConnectionSession().getSchemaName();
Collection<ShardingSphereRule> rules =
ProxyContext.getInstance().getContextManager().getMetaDataContexts().getMetaData(schemaName).getRuleMetaData().getRules();
int maxConnectionsSizePerQuery =
ProxyContext.getInstance().getContextManager().getMetaDataContexts().getProps().<Integer>getValue(ConfigurationPropertyKey.MAX_CONNECTIONS_SIZE_PER_QUERY);
- boolean isReturnGeneratedKeys =
executionContext.getSqlStatementContext().getSqlStatement() instanceof
MySQLInsertStatement;
+ final SQLStatement stmt =
executionContext.getSqlStatementContext().getSqlStatement();
+ boolean isReturnGeneratedKeys = stmt instanceof MySQLInsertStatement;
+ if (stmt instanceof MySQLUpdateStatement) {
+ for (final AssignmentSegment segment : ((MySQLUpdateStatement)
stmt).getSetAssignment().getAssignments()) {
Review comment:
The value of `isReturnGeneratedKeys` controls whether we get generated
key from ResultSet. Maybe looking for function `last_insert_id` in statement is
not right.
--
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]