mirror of
https://github.com/actiontech/dble.git
synced 2026-05-19 14:19:09 -05:00
This commit is contained in:
@@ -12,7 +12,6 @@ import com.actiontech.dble.config.ServerPrivileges;
|
||||
import com.actiontech.dble.config.ServerPrivileges.CheckType;
|
||||
import com.actiontech.dble.config.model.SchemaConfig;
|
||||
import com.actiontech.dble.config.model.TableConfig;
|
||||
import com.actiontech.dble.singleton.ProxyMeta;
|
||||
import com.actiontech.dble.meta.protocol.StructureMeta;
|
||||
import com.actiontech.dble.net.ConnectionException;
|
||||
import com.actiontech.dble.plan.common.ptr.StringPtr;
|
||||
@@ -25,6 +24,7 @@ import com.actiontech.dble.server.ServerConnection;
|
||||
import com.actiontech.dble.server.handler.ExplainHandler;
|
||||
import com.actiontech.dble.server.util.SchemaUtil;
|
||||
import com.actiontech.dble.server.util.SchemaUtil.SchemaInfo;
|
||||
import com.actiontech.dble.singleton.ProxyMeta;
|
||||
import com.actiontech.dble.singleton.SequenceManager;
|
||||
import com.actiontech.dble.util.StringUtil;
|
||||
import com.alibaba.druid.sql.SQLUtils;
|
||||
@@ -119,6 +119,11 @@ public class DruidInsertParser extends DruidInsertReplaceParser {
|
||||
MySqlInsertStatement insert) throws SQLException {
|
||||
String noShardingNode = RouterUtil.isNoSharding(schemaInfo.getSchemaConfig(), schemaInfo.getTable());
|
||||
if (noShardingNode != null) {
|
||||
// table with single datanode and has autoIncrement property
|
||||
TableConfig tbConfig = schemaInfo.getSchemaConfig().getTables().get(schemaInfo.getTable());
|
||||
if (tbConfig != null && tbConfig.isAutoIncrement()) {
|
||||
return false;
|
||||
}
|
||||
StringPtr noShardingNodePr = new StringPtr(noShardingNode);
|
||||
Set<String> schemas = new HashSet<>();
|
||||
if (insert.getQuery() != null) {
|
||||
|
||||
@@ -136,6 +136,11 @@ public class DruidReplaceParser extends DruidInsertReplaceParser {
|
||||
private boolean parserNoSharding(ServerConnection sc, String contextSchema, SchemaInfo schemaInfo, RouteResultset rrs, SQLReplaceStatement replace) throws SQLException {
|
||||
String noShardingNode = RouterUtil.isNoSharding(schemaInfo.getSchemaConfig(), schemaInfo.getTable());
|
||||
if (noShardingNode != null) {
|
||||
// table with single datanode and has autoIncrement property
|
||||
TableConfig tbConfig = schemaInfo.getSchemaConfig().getTables().get(schemaInfo.getTable());
|
||||
if (tbConfig != null && tbConfig.isAutoIncrement()) {
|
||||
return false;
|
||||
}
|
||||
StringPtr noShardingNodePr = new StringPtr(noShardingNode);
|
||||
Set<String> schemas = new HashSet<>();
|
||||
if (replace.getQuery() != null) {
|
||||
|
||||
Reference in New Issue
Block a user