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

sql_mode=ANSI_QUOTES causes UnknownStatusFlags(32770) error when trying to connect to MariaDB 11.2 #274

Closed
wilsonzlin opened this issue Dec 21, 2023 · 1 comment

Comments

@wilsonzlin
Copy link

I've been experiencing this error when I try to connect to MariaDB with a pool:

Io(Io(Custom { kind: InvalidData, error: UnknownStatusFlags(32770) }))

I think I have narrowed it down to the sql_mode option, and only when it has ANSI_QUOTES set.

To reproduce:

pushd "$(mktemp -d)"
cat <<'EOD' >mariadb.cnf
[mariadb]
sql_mode=ANSI_QUOTES
EOD

docker run --name repro --rm -d \
  -e MARIADB_ROOT_PASSWORD=test \
  -e MARIADB_DATABASE=test \
  -e MARIADB_USER=test \
  -e MARIADB_PASSWORD=test \
  -v ./mariadb.cnf:/etc/mysql/conf.d/repro.cnf \
  -p 3306:3306 \
  mariadb:11.2

cargo init --bin --name a .
cargo add tokio --features full
cargo add mysql_async
cat <<'EOD' >src/main.rs
#[tokio::main]
async fn main() {
  let pool = mysql_async::Pool::new("mysql://test:test@127.0.0.1:3306/test");
  let mut conn = pool.get_conn().await.unwrap();
}
EOD
cargo run

docker rm -fv repro

I'm not sure if this also applies to MySQL. Once ANSI_QUOTES is removed, everything works great, including other sql_mode options, mutual TLS, etc.

@blackbeam
Copy link
Owner

Thanks for report. I'll add the flag

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

No branches or pull requests

2 participants