Merged PRs
dolt
- 7432: dolt_clone and --user
Previously the dolt_clone() stored procedure would take the --user flag, but not use it in a gRPC call to a sql-server. This
addresses this limitation, and adds a test to verify it works. - 7426: fix sqllogictest harness to use float rounding
When we generated the results for MySQL (specifically the float results), we used the golangfmt.Sprintf('%.3f')
string, even for decimal types. Meanwhile, the doltharness was usingdecimal.Round()
. There's evidently a difference in the way these two rounding operations work, so we had some failures due to rounding errors.
This PR makes it so decimals are rounded the same way floats are, so that results are consistent.
go-mysql-server
- 2306: Bug fix: honor database qualifier on view name for
create view
statements
Related to #7438 - 2305: [fixidx] Table function expression ids
Simplify and fixplan.TableAlias
indexing. Some table alias children have their own expression ids, butsql.TableFunction
implementations don't necessarily extend theplan.TableIdNode
interface and rely on the analyzer to populate column ids. There are a couple ways to simplify this in the future, like adding an intermediate prunable sql.Projector node for table functions, or having pruning clean up after itself by updating node and parent table alias columns.
TODO: this case is kind of hard to test, but trying to come up with something. - 2303:
float64
is larger type than decimal forcoalesce()
function
This causes 937 failures in sqllogictests - 2302: adding
@@server_uuid
system variable
This PR adds support for the@@server_uuid
system variable.
However, this just generates a random UUID on server start, and does not persist it to a file.
MySQL Docs:
https://dev.mysql.com/doc/refman/8.0/en/replication-options.html#sysvar_server_uuid
Fixes #7431 - 2301: fix coalesce
type()
Although only the first argument is returned, coalesce still examines the types of all the arguments passed in, and uses the "largest" type. - 2298: fix outermost division placement
MySQL round appends 4 places of precision to their division operators, but only on the very last division operation.
All inner divisions need to preserve as much precision as possible. To track this, we have adivScale
variable in.
We also have anopScale
to track if an operation is the outermost operator, for other rounding/precision reasons.
We were getting these values mixed up, leading to results with incorrect precision. - 2295: allow tables with self referential foreign keys to be dropped
Our logic for preventingDROP
s on a table if that table was referenced in aFOREIGN KEY
did not account for when the table was self referencing. This PR fixes that and closes the gap in our testing for this area.
fixes #7418 - 2292: Various aggregation/indexing fixes
re: dolthub/go-mysql-server#2271
Use expression ids to fix expression indexes most of the time. This makes it easier to resolve definitions once in planbuilder, rather than having to redo all that work a second time duringassignExecIndexes
. This should be more reliable for most queries and make it easier to make alias resolving refactors.
Many expressions now implementsql.IdExpression
and absorb unique expression ids. Trigger variables and stored procedure params still lack ids and fallback to string matching behavior.
The biggest lingering issue relates to how dual tables, aliases, and subquery expressions interact. Dual tables have a schema with one column named with an empty string. Subquery expressions expect the +1 column offset from a dual table parent schema (if I'm reading correctly, it might depend on other context). On the other hand, that column can make it difficult to deduplicate projections and throw off execution indexing. There is one query that I haven't been able to get working that has a combination of dual table and alias issues that I think needs a heavier lift to manage correctly.This query splits the target projection into two levels to account for the dual table column and alias dependency. One thing that does fix this is inlining the alias reference to avoid computing theSELECT "testing" AS s, (SELECT max(i) FROM (SELECT * FROM mytable) mytable RIGHT JOIN ((SELECT i2, s2 FROM othertable ORDER BY i2 ASC) UNION ALL SELECT CAST(4 AS SIGNED) AS i2, "not found" AS s2 FROM DUAL) othertable ON i2 = i) AS rj FROM DUAL`
rj
subquery a second time in the second alias. But that alias replacement breaks some of theTestOrderByGroupBy
tests that also have alias issues.
vitess
- 307: allow hexnums for
stats_auto_recalc
table option
This fixes 1 sqllogictest - 306: allow function keywords
We have some extra keywords (they aren't listed as reserved or non-reserved in MySQL), to handle the special syntax.
These keywords are allowed as table and column names without backquotes. - 305: Allow
UNIQUE
andPRIMARY KEY
to be specified on the same column
Related to: #7395
Closed Issues
- 7388: Cannot use column names containing spaces or uppercase characters as a generated primary key
- 7428: Feature request for supporting health and readiness checks in Dolt DB
- 7431:
@@server_uuid
generated bymysqlsh
. Dolt does not support that system variable. - 7417: Allow custom commit messages using
@@dolt_transaction_commit = 1
- 2296: add create table comment on table clause to table spec
- 2225: go mod tidy error
Latency
Read Tests | MySQL | Dolt | Multiple |
---|---|---|---|
covering_index_scan | 2.11 | 2.91 | 1.4 |
groupby_scan | 13.7 | 17.63 | 1.3 |
index_join | 1.32 | 5.09 | 3.9 |
index_join_scan | 1.25 | 2.18 | 1.7 |
index_scan | 34.33 | 63.32 | 1.8 |
oltp_point_select | 0.17 | 0.46 | 2.7 |
oltp_read_only | 3.36 | 8.13 | 2.4 |
select_random_points | 0.32 | 0.75 | 2.3 |
select_random_ranges | 0.39 | 0.92 | 2.4 |
table_scan | 34.33 | 63.32 | 1.8 |
types_table_scan | 74.46 | 173.58 | 2.3 |
reads_mean_multiplier | 2.2 |
Write Tests | MySQL | Dolt | Multiple |
---|---|---|---|
oltp_delete_insert | 6.09 | 6.32 | 1.0 |
oltp_insert | 2.86 | 3.07 | 1.1 |
oltp_read_write | 7.43 | 15.55 | 2.1 |
oltp_update_index | 2.97 | 3.25 | 1.1 |
oltp_update_non_index | 2.91 | 3.13 | 1.1 |
oltp_write_only | 4.18 | 7.56 | 1.8 |
types_delete_insert | 5.88 | 6.91 | 1.2 |
writes_mean_multiplier | 1.3 |
Overall Mean Multiple | 1.9 |
---|