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
13.15k stars 1.24k forks source link

mysql create trigger return a error ,someting `Database(MySqlDatabaseError { code: Some("HY000"), number: 1295, message: "This command is not supported in the prepared statement protocol yet" }) ` #3305

Closed yuyang-ok closed 3 months ago

yuyang-ok commented 3 months ago

Bug Description

I want to create tigger use sqlx. mysql kindof like this.

CREATE TRIGGER after_insert_test_create_trigger
            AFTER INSERT ON test_create_trigger
            FOR EACH ROW
            BEGIN
                INSERT INTO test_create_trigger_update (data)
                VALUES (NEW.data);
            END

And I get this error.

called `Result::unwrap()` on an `Err` value: Database(MySqlDatabaseError { code: Some("HY000"), number: 1295, message: "This command is not supported in the prepared statement protocol yet" }) 

Minimal Reproduction

Info