Merged PRs
dolt
go-mysql-server
- 2016: Bug fix: Preserve column name case for views
Fixes #6683
Dolt CI Checks: #6684 - 2015: GROUP BY identifiers should prefer binding to table columns over projections.
This also means an expression is allowed to project from the GROUP BY column multiple times.
Fixes #6676 - 2012: Insert on dup col ordinal bug
A certain set of conditions causes an error for indexingon duplicate update
expressions:- The source is a SELECT statement (not a VALUES row)
- All columns are specified by the INSERT (not sure why, but partial columns seems to get rearranged correctly. I think we must insert a compensating projection to handle column defaults)
- The source columns are not the same order as the destination table schema
- On duplicate update expression references a column from the new row
For the query below, we were indexing the on duplicate expression in the wrong order, causing the output row to be two zero types:
The way we resolve inserts is still a bit weird. We resolve the source, and then afterwards add a projection to rearrange columns to match the target schema. I ran into a lot of problems trying to rearrange that ordering (first add projection, then analyze), mostly due to our inability to fix indexes on the source node's projection (VALUE nodes don't have a schema, and it isn't obvious when walking a tree that a given projection is going to be special). When we add the projection afterwards, however, it avoids the indexing rule so we can inline the values safely.create table xy (x int primary key, y datetime); insert into xy (y,x) select * from (select cast('2019-12-31T12:00:00Z' as date), 0) dt(a,b) on duplicate key update x=dt.b+1, y=dt.a;
My current fix is to mimic the projection mapping inside indexing. Index the duplicate expression values based on the ordinal of the destination schema. LOAD DATA for some reason needs its insert columns to not be specified, which will probably the source of different issues at some point.
fixes: #6675
Closed Issues
- 6676: MySQL allows duplicate column names, but Dolt doesn't
- 6675: dolt table import -u fails to properly parse order of columns
- 6663: Dolt uses incorrect type for result of
SUM
andAVG
Latency
Read Tests | MySQL | Dolt | Multiple |
---|---|---|---|
covering_index_scan | 2.11 | 2.91 | 1.4 |
groupby_scan | 12.98 | 17.95 | 1.4 |
index_join | 1.27 | 4.74 | 3.7 |
index_join_scan | 1.21 | 2.22 | 1.8 |
index_scan | 32.53 | 57.87 | 1.8 |
oltp_point_select | 0.14 | 0.4 | 2.9 |
oltp_read_only | 2.71 | 7.3 | 2.7 |
select_random_points | 0.31 | 0.72 | 2.3 |
select_random_ranges | 0.37 | 0.95 | 2.6 |
table_scan | 33.12 | 57.87 | 1.7 |
types_table_scan | 74.46 | 167.44 | 2.2 |
reads_mean_multiplier | 2.2 |
Write Tests | MySQL | Dolt | Multiple |
---|---|---|---|
bulk_insert | 0.001 | 0.001 | 1.0 |
oltp_delete_insert | 4.74 | 5.57 | 1.2 |
oltp_insert | 2.35 | 2.76 | 1.2 |
oltp_read_write | 5.99 | 13.95 | 2.3 |
oltp_update_index | 2.3 | 2.81 | 1.2 |
oltp_update_non_index | 2.3 | 2.71 | 1.2 |
oltp_write_only | 3.3 | 7.04 | 2.1 |
types_delete_insert | 4.65 | 6.09 | 1.3 |
writes_mean_multiplier | 1.4 |
Overall Mean Multiple | 1.9 |
---|