-
Notifications
You must be signed in to change notification settings - Fork 2.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
feat: Add support for Insert with row alias #15790
Changes from all commits
464ed1a
c0bc78a
f710bc9
f9a607c
70e2114
5b43495
e7782d1
d1c396b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ | |
- [Delete with Subquery Support](#delete-subquery) | ||
- [Delete with Multi Target Support](#delete-multi-target) | ||
- [User Defined Functions Support](#udf-support) | ||
- [Insert Row Alias Support](#insert-row-alias-support) | ||
- **[Query Timeout](#query-timeout)** | ||
- **[Flag changes](#flag-changes)** | ||
- [`pprof-http` default change](#pprof-http-default) | ||
|
@@ -197,6 +198,16 @@ Without this flag, VTGate will not be aware that there might be aggregating user | |
|
||
More details about how to load UDFs is available in [MySQL Docs](https://dev.mysql.com/doc/extending-mysql/8.0/en/adding-loadable-function.html) | ||
|
||
#### <a id="insert-row-alias-support"/> Insert Row Alias Support | ||
|
||
Support is added to have row alias in Insert statement to be used with `on duplicate key update`. | ||
|
||
Example: | ||
- `insert into user(id, name, email) valies (100, 'Alice', '[email protected]') as new on duplicate key update name = new.name, email = new.email` | ||
- `insert into user(id, name, email) valies (100, 'Alice', '[email protected]') as new(m, n, p) on duplicate key update name = n, email = p` | ||
|
||
More details about how it works is available in [MySQL Docs](https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html) | ||
|
||
### <a id="query-timeout"/>Query Timeout | ||
On a query timeout, Vitess closed the connection using the `kill connection` statement. This leads to connection churn | ||
which is not desirable in some cases. To avoid this, Vitess now uses the `kill query` statement to cancel the query. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,7 @@ const ( | |
WrongArguments | ||
BadNullError | ||
InvalidGroupFuncUse | ||
ViewWrongList | ||
|
||
// failed precondition | ||
NoDB | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Was this code intended for debugging to see when the sharded query and the original query are different?
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 kept this for a reason to fail in future if anything goes wrong in the final query output.