-
Notifications
You must be signed in to change notification settings - Fork 41
Bump deps #22
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
Bump deps #22
Conversation
PsiACE
commented
Jul 28, 2021
- bump deps
- make test work
- make clippy happy
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
===========================================
- Coverage 81.19% 70.55% -10.65%
===========================================
Files 10 10
Lines 2159 2007 -152
===========================================
- Hits 1753 1416 -337
- Misses 406 591 +185
Continue to review full report at Codecov.
|
|
Hi @jonhoo , would you like to take some time to review this PR? |
jonhoo
left a comment
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.
Sorry, I've been away on vacation :)
Overall this looks great, thanks for taking the time! I left some notes inline.
tests/async.rs
Outdated
| // Create the runtime | ||
| let rt = tokio::runtime::Runtime::new().unwrap(); | ||
|
|
||
| rt.spawn_blocking(move || { |
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.
Why does this need spawn_blocking?
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 remove the dependency on tokio. I checked it and we don't need tokio.
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.
Oh, that's weird. I wasn't actually proposing you remove tokio. Instead, I was just questioning the use of spawn_blocking specifically. I would think that rt.block_on would be sufficient if you remove the call to .wait(). The .wait() is just a utility function inside the mysql library that does that blocking for you. But using .wait() is also okay if you prefer that, it's just a bit less idiomatic.
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.
Sorry, I will fix it later :( I was not thinking that much.
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 guess we'll have to rely on wait() for now. Is it okay to change it to this?
let rt = tokio::runtime::Runtime::new().unwrap();
rt.block_on(async move {
mysql_async::Conn::new(format!("mysql://127.0.0.1:{}", port))
.and_then(|conn| c(conn))
.wait()
.unwrap()
});Or would you like to commit a patch telling me what to do? cc @jonhoo
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 was thinking:
rt.block_on(async move {
mysql_async::Conn::new(format!("mysql://127.0.0.1:{}", port))
.and_then(|conn| c(conn))
.await.unwrap()
});The wait method is just a helper method that mysql_async provides, but since we actually execute in async context here, we can do it properly and use await.
src/value/utils.rs
Outdated
| @@ -0,0 +1,254 @@ | |||
| #[cfg(test)] | |||
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'm not sure I follow this file — what is it testing? It seems to also contain a bunch of implementation, but that's only used for tests? If this is an orthogonal change, would you mind making it in a separate PR?
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.
Here's some code to help the tests run correctly, migrated from the old mysql_common. I don't think this is considered orthogonal :(
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 this comes from mysql_common, why move it in here? Does it test anything that actually relates to this crate? Why was it removed from mysql_common in the first place?
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.
This is because mysql_common removed functions like write_bin_value. In fact, this is just to ensure that the existing tests work properly.
It looks like mysql_common is now updated with serialization/deserialization.
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.
Hmm, I don't think they actually removed those functions, they just renamed them. For example, decimal decoding is now in Decimal::parse_bytes. I think we should just switch to those methods instead of inlining the old implementation (which may have been replaced because it was buggy).
|
Also note that the Postgres version was already bumped by #24, so you may need to merge from master :) |
Signed-off-by: Chojan Shang <[email protected]>
Signed-off-by: Chojan Shang <[email protected]>
|
By the way — it's easier to review the PR as it changes over time if you avoid force-pushing. We can always squash at the end to clean up the history :) |
|
After blackbeam/rust_mysql_common#43 is merged. |
|
I'll just add that I don't think we should need to have tests for |
|
Do we still then need to wait for blackbeam/rust_mysql_common#43? I don't see a failing test, which suggests either that we do not, or that we should add a test to catch the issue represented by blackbeam/rust_mysql_common#43. |
|
Ah, no, I think we've talked past each other. What I was object to originally was the code introduced here. The |
Yes, I've added the There are 2 problems with
The author did not think it's buggy, I still did not figure out why. |
|
Thinking some more about this, I wonder if what we should do is change What do you think? |
|
This landed in #31. |