blackbeam / rust-mysql-simple

Mysql client library implemented in rust.
Apache License 2.0
652 stars 145 forks source link

Incompatible version of MySQL Async and MySQL Simple #374

Closed altmannmarcelo closed 4 months ago

altmannmarcelo commented 4 months ago

My App uses mysql-async in the core functions and tests we use mysql-simple to execute tests. Currently the version of mysql-async uses mysql_common v0.31 and mysql-simple uses mysql_common v0.30 which causes some errors due to two versions of mysql_common been used:

error[E0308]: `?` operator has incompatible types
   --> app-mysql/tests/vertical.rs:596:82
    |
596 |                 .exec::<mysql_async::Row, _, _>(query, mysql::Params::Positional(to_values(key)?))
    |                                                                                  ^^^^^^^^^^^^^^^ expected `mysql::Value`, found `mysql_async::Value`
    |
    = note: `?` operator cannot convert from `std::vec::Vec<mysql_async::Value>` to `std::vec::Vec<mysql::Value>`
    = note: `mysql_async::Value` and `mysql::Value` have similar names, but are actually distinct types
note: `mysql_async::Value` is defined in crate `mysql_common`
   --> /Users/marcelo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mysql_common-0.31.0/src/value/mod.rs:59:1
    |
59  | pub enum Value {
    | ^^^^^^^^^^^^^^
note: `mysql::Value` is defined in crate `mysql_common`
   --> /Users/marcelo/.cargo/registry/src/index.crates.io-6f17d22bba15001f/mysql_common-0.30.6/src/value/mod.rs:59:1
    |
59  | pub enum Value {
    | ^^^^^^^^^^^^^^
    = note: perhaps two different versions of crate `mysql_common` are being used?

Updating rust-mysql-simple to use mysql_common 0.31.0 fixes the issue