-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix Using unsupported buffer type: 253 (parameter: 1) when trying to use the CLI #3981
Conversation
diesel/src/mysql/connection/bind.rs
Outdated
@@ -154,6 +154,11 @@ impl From<u32> for Flags { | |||
} | |||
} | |||
|
|||
#[cfg(target_os = "linux")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How to fix the ugly FALSE
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use ffi::my_bool::default()
?
diesel/src/mysql/connection/bind.rs
Outdated
@@ -154,6 +154,11 @@ impl From<u32> for Flags { | |||
} | |||
} | |||
|
|||
#[cfg(target_os = "linux")] | |||
static FALSE: ffi::my_bool = 0; | |||
#[cfg(any(target_os = "macos", target_os = "windows"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Conditional compilation supported mysql_client_version
is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try cargo::rustc-cfg=KEY[="VALUE"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for opening this PR. This is a good starting point for seeing what might need to change here.
That written: I need to raise a few constrains for a potential fix here:
- We do not want to break compatibility with older mysqlclient versions. That means it should be possible to use mysqlclient 8.1 or older on macos.
- We do not want to depend on bindgen by default as that pulls in a rather heavy (and problematic) dependency on libclang.
diesel/Cargo.toml
Outdated
@@ -17,7 +17,7 @@ byteorder = { version = "1.0", optional = true } | |||
chrono = { version = "0.4.20", optional = true, default-features = false, features = ["clock", "std"] } | |||
libc = { version = "0.2.0", optional = true } | |||
libsqlite3-sys = { version = ">=0.17.2, <0.29.0", optional = true, features = ["bundled_bindings"] } | |||
mysqlclient-sys = { version = "0.2.5", optional = true } | |||
mysqlclient-sys = { git = "https://github.com/xiangzhai/mysqlclient-sys.git", branch = "rust-bindgen", optional = true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not possible to depend on a forked git version here. These patches need to be included into the mysqlclient-sys repo.
(Open a PR there and we can discuss the changes there)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any other solution? |
@WumaCoder Such questions are highly discouraged at WIP PR's. If you want to contribute a fix feel free to open a new PR. |
Hi @weiznich
brew install mysql-client
for macOS will install mysql-client 8.3, butdiesel
CLI thrown such error to Apple fans: #3929I autogen mysqlclient-sys by rust-bindgen to support new and old versions about MySQL. And adjusted
diesel
to meet thediff
.Could you review the patch please?
Thanks,
Leslie Zhai