launchbadge / sqlx

🧰 The Rust SQL Toolkit. An async, pure Rust SQL crate featuring compile-time checked queries without a DSL. Supports PostgreSQL, MySQL, and SQLite.
Apache License 2.0
12.36k stars 1.18k forks source link

Bug: Set statement does't support non-constant expr #3269

Closed groobyming closed 3 weeks ago

groobyming commented 3 weeks ago

Bug Description

I am simply connecting to the MySQL instance, why do I get the following error? Database(MySqlDatabaseError { code: Some("HY000"), number: 1105, message: "errCode = 2, detailMessage = Set statement does't support non-constant expr." })

Test Code:

use sqlx::{Connection, MySqlConnection};
#[tokio::test]
    async fn test_doris_direct() {
       let con = MySqlConnection::connect("mysql://root:testpwd@localhost:9030")
            .await.unwrap();
        println!("con is {:?}", con)
    }

Minimal Reproduction

A small code snippet or a link to a Github repo or Gist, with instructions on reproducing the bug.

Info

groobyming commented 3 weeks ago

Bug Description

I am simply connecting to the MySQL instance, why do I get the following error? Database(MySqlDatabaseError { code: Some("HY000"), number: 1105, message: "errCode = 2, detailMessage = Set statement does't support non-constant expr." })

Test Code:

use sqlx::{Connection, MySqlConnection};
#[tokio::test]
    async fn test_doris_direct() {
       let con = MySqlConnection::connect("mysql://root:testpwd@localhost:9030")
            .await.unwrap();
        println!("con is {:?}", con)
    }

Minimal Reproduction

A small code snippet or a link to a Github repo or Gist, with instructions on reproducing the bug.

Info

  • SQLx version: [0.7.4]
  • SQLx features enabled: ["runtime-tokio-rustls", "macros", "chrono", "mysql","postgres",]
  • Database server and version: [REQUIRED] (Apache Doris 2.0.3)
  • Operating system: [linux]
  • rustc --version: [1.79.0-nightly]

This is the message I captured when using wireshark

image
mj-jackson commented 6 days ago

I am running into the same behavior. Did you handle it?

abonander commented 6 days ago

https://github.com/launchbadge/sqlx/issues/3205#issuecomment-2181827300