-
-
Notifications
You must be signed in to change notification settings - Fork 195
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
On conflict do nothing for MySql #684
Conversation
tests/mysql/query.rs
Outdated
[ | ||
r#"INSERT INTO `glyph` (`aspect`, `image`)"#, | ||
r#"VALUES ('04108048005887010020060000204E0180400400', 3.1415)"#, | ||
r#"ON DUPLICATE KEY UPDATE `id` = VALUES(`id`)"#, |
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.
Can you make it id
= id
?
src/query/on_conflict.rs
Outdated
/// ] | ||
/// .join(" ") | ||
/// ); | ||
pub fn do_nothing_mysql<C, I>(&mut self, pk_cols: I) -> &mut Self |
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.
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.
Yes, may be do_nothing_on
and add MySQL only
in the doc? e.g.
Line 384 in 336bf95
/// Set column type as interval type with optional fields and precision. Postgres only |
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 agree with it
@@ -1161,7 +1183,7 @@ fn insert_on_conflict_0() { | |||
[ | |||
r#"INSERT INTO `glyph` (`aspect`, `image`)"#, | |||
r#"VALUES ('04108048005887010020060000204E0180400400', 3.1415)"#, | |||
r#"ON DUPLICATE KEY UPDATE `aspect` = VALUES(`aspect`), `image` = VALUES(`image`)"#, | |||
r#"ON DUPLICATE KEY UPDATE `aspect` = `aspect`, `image` = `image`"#, |
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 sad, this is wrong. ON DUPLICATE KEY UPDATE id = id
should only applies to do_nothing_on
.
While the behaviour of update_columns()
should not be changed.
The two expressions have different semantics.
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.
As stated
PR Info
New Features
Bug Fixes
Breaking Changes
Changes