pick #39308 to branch-2.1
This commit is contained in:
@ -81,6 +81,9 @@ public class MysqlChannel implements BytesChannel {
|
||||
// mysql flag CLIENT_DEPRECATE_EOF
|
||||
private boolean clientDeprecatedEOF;
|
||||
|
||||
// mysql flag CLIENT_MULTI_STATEMENTS
|
||||
private boolean clientMultiStatements;
|
||||
|
||||
private ConnectContext context;
|
||||
|
||||
protected MysqlChannel() {
|
||||
@ -95,6 +98,14 @@ public class MysqlChannel implements BytesChannel {
|
||||
return clientDeprecatedEOF;
|
||||
}
|
||||
|
||||
public void setClientMultiStatements() {
|
||||
clientMultiStatements = true;
|
||||
}
|
||||
|
||||
public boolean clientMultiStatements() {
|
||||
return clientMultiStatements;
|
||||
}
|
||||
|
||||
public MysqlChannel(StreamConnection connection, ConnectContext context) {
|
||||
Preconditions.checkNotNull(connection);
|
||||
this.sequenceId = 0;
|
||||
|
||||
@ -167,6 +167,12 @@ public class MysqlProto {
|
||||
if (capability.isDeprecatedEOF()) {
|
||||
context.getMysqlChannel().setClientDeprecatedEOF();
|
||||
}
|
||||
|
||||
// we do not save client capability to context, so here we save CLIENT_MULTI_STATEMENTS to MysqlChannel
|
||||
if (capability.isClientMultiStatements()) {
|
||||
context.getMysqlChannel().setClientMultiStatements();
|
||||
}
|
||||
|
||||
MysqlAuthPacket authPacket = new MysqlAuthPacket();
|
||||
if (!authPacket.readFrom(handshakeResponse)) {
|
||||
ErrorReport.report(ErrorCode.ERR_NOT_SUPPORTED_AUTH_MODE);
|
||||
|
||||
@ -334,7 +334,7 @@ public abstract class ConnectProcessor {
|
||||
// when client not request CLIENT_MULTI_STATEMENTS, mysql treat all query as
|
||||
// single statement. Doris treat it with multi statement, but only return
|
||||
// the last statement result.
|
||||
if (getConnectContext().getCapability().isClientMultiStatements()) {
|
||||
if (getConnectContext().getMysqlChannel().clientMultiStatements()) {
|
||||
finalizeCommand();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user