Merged PRs
dolt
- 7792: Fix nil write session panic
- 7790: chore: fix some function names
- 7776:
dolt_history
tables: Issue a warning when types have changed
Adding a session warning whendolt_history
tables can't create arowConverter
for a row due to a field's type having changed. In these cases, the old value can't always be returned safely as the new type, so we returnNULL
and issue a session warning. In the future, we could attempt to convert the old value to the new type.
Follow up to #7771 - 7766: chore: use errors.New to replace fmt.Errorf with no parameters
- 7760: Support for multiple schemas in a database
Companion PRs:
dolthub/vitess#338
dolthub/go-mysql-server#2466
dolthub/doltgresql#181
This PR is a proof of concept for addressing multiple table namespaces (schemas) in a database. This is to support schemas in Doltgres initially, but could also be used to implement storing multiple databases in the same Dolt commit graph if we wanted to do that. All tables are stored in the root's table map like always, but tables with non-empty schemas have that schema name prepended in its map key, surrounded by null bytes.
There are lots of things that don't work yet. This is what does work:Things I specifically want feedback on:create schema mySchema; create schema otherSchema; CREATE TABLE mySchema.test (pk BIGINT PRIMARY KEY, v1 BIGINT); insert into mySchema.test values (1,1), (2,2); CREATE TABLE otherSchema.test (pk BIGINT PRIMARY KEY, v1 BIGINT); insert into otherSchema.test values (3,3), (4,4); SELECT * FROM mySchema.test; SELECT * FROM otherSchema.test;
- I am not crazy about the sweeping changes to table-access interfaces in
root_val.go
. In particular it seems likely to cause errors over time as people forget to include schema names in code changes where necessary, silently breaking doltgres. Another option I considered was to introduce some sort ofRootReader
interface on top of root value, which you create with a particular schema name, and thereafter all table accesses reference the given schema. There may be places where we have to juggle multipleRootReader
instances at once, rather than just asking for qualified table names from a single root. But this is the pattern I used for the boundary between GMS and Dolt and it worked well, so maybe it could work forroot_val.go
as well.
- I am not crazy about the sweeping changes to table-access interfaces in
go-mysql-server
-
2482: don't check schema compatibility for
select into
fixes: #7781
-
2481: aliasExpr inputExpression case-insensitive check
This PR adds case-insensitive check foraliasExpr.InputExpression
andexpr.String()
to determine the expr is referencable. -
2473: remove re-parsing select stmt in create view stmt
Depends on dolthub/vitess#339 -
2466: Schema-qualified table names
This PR also fixes a couple unrelated issues:- IMDB query plans are brought up to date (this is most of the change lines)
- Fixed bugs in certain show statements (information_schema tests)
vitess
- 343: Exposing binary JSON encoding to SQL expression logic for testing
Exposing logic in Vitess that decodes MySQL's internal, binary JSON serialization encoding, so that we can use it to test JSON serialization. - 342: refactor and fully implement
alter table
syntax
MySQL Docs; https://dev.mysql.com/doc/refman/8.0/en/alter-table.html
fixes: dolthub/go-mysql-server#2472 - 340: improving partition parsing
partially addresses: dolthub/go-mysql-server#2472 - 339: capture select expressions that are sub statements within other expressions
- 338: Add a schema qualifier to table names
Closed Issues
- 6064: Prevent Indexing JSON Fields
- 7781: cannot convert type longtext COLLATE utf8mb4_0900_ai_ci to datetime
- 2472: Parser support for
PARTITION BY
Performance
Read Tests | MySQL | Dolt | Multiple |
---|---|---|---|
covering_index_scan | 2.07 | 3.02 | 1.5 |
groupby_scan | 13.7 | 17.63 | 1.3 |
index_join | 1.34 | 5.18 | 3.9 |
index_join_scan | 1.27 | 2.26 | 1.8 |
index_scan | 34.33 | 52.89 | 1.5 |
oltp_point_select | 0.17 | 0.51 | 3.0 |
oltp_read_only | 3.36 | 8.43 | 2.5 |
select_random_points | 0.33 | 0.8 | 2.4 |
select_random_ranges | 0.39 | 0.95 | 2.4 |
table_scan | 34.33 | 53.85 | 1.6 |
types_table_scan | 74.46 | 158.63 | 2.1 |
reads_mean_multiplier | 2.2 |
Write Tests | MySQL | Dolt | Multiple |
---|---|---|---|
oltp_delete_insert | 7.98 | 6.91 | 0.9 |
oltp_insert | 3.75 | 3.43 | 0.9 |
oltp_read_write | 8.43 | 16.12 | 1.9 |
oltp_update_index | 3.82 | 3.55 | 0.9 |
oltp_update_non_index | 3.82 | 3.43 | 0.9 |
oltp_write_only | 5.37 | 7.98 | 1.5 |
types_delete_insert | 7.7 | 7.56 | 1.0 |
writes_mean_multiplier | 1.1 |
TPC-C TPS Tests | MySQL | Dolt | Multiple |
---|---|---|---|
tpcc-scale-factor-1 | 101.61 | 4.98 | 4.2 |
tpcc_tps_multiplier | 4.2 |
Overall Mean Multiple | 2.50 |
---|