Skip to content
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

Composite commands are not supported #774

Closed
ich-wangxf opened this issue Mar 6, 2020 · 10 comments
Closed

Composite commands are not supported #774

ich-wangxf opened this issue Mar 6, 2020 · 10 comments

Comments

@ich-wangxf
Copy link

Sorry for my misunderstanding, DRDS(Distributed Relational Database Service) supports "transaction isolation level", but the following two commands need to be executed separately. Could you please help solve this problem?

Composite commands are not supported,need to separate "set transaction" from "start transaction"

using (var cmd = new MySqlCommand("set transaction isolation level " + isolationLevelValue + "; start transaction;", this))

@bgrainger

@bgrainger
Copy link
Member

Executing those as separate commands would increase latency (and decrease performance) for databases that do support it, so I'd like it be opt in.

What does DRDS return from MySqlConnection.ServerVersion (after you've connected to it)?

@ich-wangxf
Copy link
Author

ich-wangxf commented Mar 6, 2020

Executing those as separate commands would increase latency (and decrease performance) for databases that do support it, so I'd like it be opt in.

What does DRDS return from MySqlConnection.ServerVersion (after you've connected to it)?

DRDS is a database middleware similar to MyCat, Has nothing to do with the specific MySQL database version.

When I use MySqlConnection to start a transaction, it returns "[ERR_PARSER] statement com.alibaba.fastsql.sql.ast.statement.SQLStartTransactionStatement not supported", So hope to executing those as separate commands through configuration
@bgrainger

@bgrainger
Copy link
Member

If DRDS is accepting the initial MySQL connection, then it will return some kind of server version string in the initial handshake packet it sends; this will be made available through MySqlConnection.ServerVersion.

@ich-wangxf
Copy link
Author

ich-wangxf commented Mar 6, 2020

If DRDS is accepting the initial MySQL connection, then it will return some kind of server version string in the initial handshake packet it sends; this will be made available through MySqlConnection.ServerVersion.

In fact, what I want to express is that DRDS is not a database product, it is a database middleware service product, so the final database server version may be MySQL 5.6.x or 5.7.x or ApsaraDB for PolarDB 8.0.X, ApsaraDB for PolarDB is a next-generation relational database service developed by Alibaba Cloud. It is compatible with MySQL

@bgrainger

@ich-wangxf
Copy link
Author

If DRDS is accepting the initial MySQL connection, then it will return some kind of server version string in the initial handshake packet it sends; this will be made available through MySqlConnection.ServerVersion.

Can you set the transaction isolation level when creating a new connection, so that there will be no performance degradation, then this setting is set by options, default is false, such as in Server.Session ConnectAsync

@bgrainger

@bgrainger
Copy link
Member

Per sysown/proxysql#1728 (comment) this code should probably respect the CLIENT_MULTI_STATEMENTS flag (which ProxySQL may be clearing).

@bgrainger
Copy link
Member

See PomeloFoundation/Pomelo.EntityFrameworkCore.MySql#1043 (comment)

ProxySQL doesn't clear the CLIENT_MULTI_STATEMENTS flag.

I don't know if DRDS or ApsaraDB for PolarDB do either.

@bgrainger
Copy link
Member

@ich-wangxf Do you know if DRDS clears the CLIENT_MULTI_STATEMENTS flag in its initial handshake with a client? A Wireshark packet capture of a client connection to the server would show if it does or not (if you're able to capture and provide that).

@bgrainger
Copy link
Member

Fixed in 0.64.0.

@ich-wangxf
Copy link
Author

Oh thank you so much! @bgrainger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants