dolthub / dolthub/dolt

Missing insert source aliases parsing

Open
#6,500 0 comments 0 reactions 1 assignee Claimed by @zachmu View on GitHub
analyzer enhancement sql
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 5h
Merged PRs (30d)
108

Description

Insert statements should be able to alias sources for use in on duplicate expressions:
```sql
INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6) AS new(m,n,p)
ON DUPLICATE KEY UPDATE c = m+n;
```
We should support the optional `[AS row_alias[(col_alias [, col_alias] ...)]]` in between the values list and on duplicate clause.

The workaround right now uses `VALUES(field)` rather than disambiguating, but this is discouraged in mysql.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.