Dolthub Go Mysql Server Versions Save

A MySQL-compatible relational database with a storage agnostic query engine. Implemented in pure Go.

v0.18.1

1 month ago

This is a patch release on the Q2 release to remove the NewDefaultServer method, which was was panicking at query time when used.

go-mysql-server's sql interfaces are not guaranteed to settle until 1.0.

Merged PRs

go-mysql-server

  • 2437: lowercase when looking up self referential foreign key columns fixes: https://github.com/dolthub/dolt/issues/7700
  • 2436: Making @@server_id default value match MySQL
  • 2434: Fixing the default value for the binlog_checksum system variable Small change to make the default value of the global binlog_checksum system variable match MySQL's default value (i.e. "CRC32").
  • 2433: NULL to nil The SHOW FIELDS/COLUMNS FROM <table> query would return the string "NULL" for Default column rather than nil. This mattered for Knex, which relied on it being NULL and not "NULL". fixes: https://github.com/dolthub/dolt/issues/7692
  • 2432: support Threads_connected and Threads_running status variables This PR adds support for Threads_connected and Threads_running status variables. Additionally, the local enginetest are flaking consistently in dolt ci, so those have been removed; we have handler tests for com_delete, com_insert, and com_update anyway. Related: https://github.com/dolthub/dolt/issues/7646
  • 2431: Setting Innodb_buffer_pool_pages_total to 1, to avoid an issue with Datadog's collector Datadog's metric collector errors out with a divide by zero error if the Innodb_buffer_pool_pages_total status variable is 0; changing it to 1 avoids this and allows the agent to collect metrics from Dolt.
  • 2430: have status variables use go routines This PR changes Status Variables to update through go routines, to avoid slowing down query execution due to the mutexes present.
  • 2429: server trace time includes parsing
  • 2427: support Com_delete, Com_insert, Com_update status variables related: https://github.com/dolthub/dolt/issues/7646
  • 2426: use @@session.collation_server during create database ... This PR makes it so create database ... actually reads the @@session.collation_server variable. Additionally, this ensures that settings @@character_set_server sets @@collation_server and vice versa. Interestingly, it seems like MySQL actually ignores the global scope of these system variables, and reads the session scope instead. fixes https://github.com/dolthub/dolt/issues/7651
  • 2423: Adding test for preparing time.Time types This PR adds tests for using time.Time, some tests have to be skipped because we don't support Timespan correctly. companion pr: https://github.com/dolthub/vitess/pull/327 https://github.com/dolthub/vitess/pull/328 test for https://github.com/dolthub/dolt/issues/7665
  • 2422: Support Questions status variable This PR adds logic to update status variable Questions. This only works in the server context, probably doesn't through dolt sql cli. https://github.com/dolthub/dolt/issues/7646
  • 2421: [stats] costed index scan perf Histogram copying is expensive. Instead pass and mutate references. We have to use a different struct type to load stats from JSON in order to support histogram interface generalization. related Dolt-side: https://github.com/dolthub/dolt/pull/7666
  • 2420: support case-insensitive LIKE for show status/variables MySQL stores session and global variables in a performance_schema database, and these tables have a case-insensitive collation on the variable names. This PR emulates that behavior by hard coding the collation the schemas for ShowStatus and ShowVariables nodes.
  • 2419: Bug fix: Allow JSON scalar comparison between int64 and float64 When comparing JSON values, numbers may be represented internally as an int64 or float64, but our comparison code wasn't casting an int64 to a float64 in order to compare it with a float64 value. Fixes https://github.com/dolthub/dolt/issues/7656
  • 2418: fix show create database to actually show charset/collation This PR fixes the SHOW CREATE DATABASE ... statement to actually show the charset/collation that the db is under instead of always default. Additionally, this PR parses the charset database option, instead of ignoring it like before. partially fixes: https://github.com/dolthub/dolt/issues/7651
  • 2416: /{.github,go.mod,go.sum}: bump go version
  • 2414: stubbing out status variables This PR adds the initial implementation of Status Variables. There are 682 status variables, and are very similar to System Variables. Every variable is read-only (and can only be updated by the server itself), and there are session-specific variables. MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/server-status-variable-reference.html Related: https://github.com/dolthub/dolt/issues/7646
  • 2412: New interface for binlog primary callbacks First pass on connecting the GMS layer with the Dolt layer for handling callbacks when the SQL server is acting in binlog primary mode, through the new BinlogPrimaryController interface. This new interface pretty closely mirrors the existing callback interface for replica callbacks, the BinlogReplicaController interface. Related to https://github.com/dolthub/dolt/issues/7512
  • 2411: implement json_search() MySQL Docs: https://dev.mysql.com/doc/refman/8.3/en/json-search-functions.html#function_json-search
  • 2410: Adding system variable innodb_autoinc_lock_mode We currently only support innodb_autoinc_lock_mode = 2, not 0 or 1. MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/innodb-auto-increment-handling.html related: https://github.com/dolthub/dolt/issues/7634
  • 2404: Improve handling of unsigned and decimal types in JSON Fixes https://github.com/dolthub/go-mysql-server/issues/2391 MySQL's JSON type differs from standard JSON in some important ways. It supports types not supported in standard JSON, such as separate types for integers and floats, an unsigned int type, and a decimal type. Prior to this PR, we would convert values to JSON by using the encodings/json package to marshall the value to a JSON string and then unmarshall it to a go map. This is not only slow, but it's incorrect for these additional types. The main purpose of this PR is to add special handling for these types that allow them to be stored in JSON documents. We also avoid generating and parsing JSON in places where it's not actually necessary, and fix bugs where decimals get incorrectly converted into strings, or unsigned ints get converted into signed ints. Finally, this fixes an issue where we send incorrect bytes for JSON-wrapped decimal values along the wire.
  • 2403: fix dbName not being used in the example This PR makes sure that dbName in the example is actually being used, instead of having a hardcoded "mydb" in createTestDatabase. fixes #2402
  • 2401: refactor and parse table options, support auto_increment table option Table Options are now parsed as structs, so we can read/use some of the variables. Character Sets, Collations, Create Table, TableSpec, etc. have been refactored. Additionally, this PR adds support to parse and use the auto_increment table option. TODO:
    • CREATE TABLE ... LIKE ... needs to preserve table opts, like comments
    • alter table add column ... auto_increment does not work when there are already rows Companion PR: https://github.com/dolthub/vitess/pull/322
  • 2399: fix custom insert ordering for pk fixes https://github.com/dolthub/go-mysql-server/issues/2397
  • 2398: fix in-memory implementation of RenameTable to read from session The in-memory implementation of RenameTable uses data from the BaseDatabase, instead of reading it from the session. This is problematic when there are multiple alter statements. Additonally, includes some small refactor so all functions are pointer receiver instead of a mix. fixes https://github.com/dolthub/go-mysql-server/issues/2396
  • 2394: Bug fix: Set non-boolean system variable enum values to 'ON' or 'OFF' We were automatically converting ON and OFF values to to true and false when setting a system variable, which made it impossible to set system variables to those enum values. For example:
    SET @@GLOBAL.gtid_mode='ON';
    Variable 'gtid_mode' can't be set to the value of 'true'
    
  • 2393: Restored and refactored missing functionality required by Dolt
  • 2392: implement sql_mode = 'NO_AUTO_VALUE_ON_ZERO' This PR implements the sql_mode NO_AUTO_VALUE_ON_ZERO. This makes it so that 0 values (not NULL) do not increment the auto_increment counter. MySQL Docs: https://dev.mysql.com/doc/refman/8.3/en/example-auto-increment.html fixes https://github.com/dolthub/dolt/issues/7600
  • 2390: Remove the NewDefaultServer, which doesn't work for any included session implementation Fixes https://github.com/dolthub/go-mysql-server/issues/2364 Added a memory.NewSessionBuilder method, now used in the example code.
  • 2387: exit early when IF NOT EXISTS and table exists This PR addresses various issues related to CREATE TABLE IF NOT EXISTS ... queries. Before, we simply ignored the table exists error, and continued creating indexes, foreign keys, and checks. This led to errors when attempting to create indexes/foreign keys/checks that already exists. Additionally, it would errorneously create indexes/foreng keys/checks that did exist. The correct behavior is to do nothing if IF NOT EXISTS is specified and the table exists. Also this contains some refactors and simplifications. fixes https://github.com/dolthub/dolt/issues/7602
  • 2386: ignore large tokens in fulltext indexes We were panicking when attempting to insert/delete tokens that exceed the column type length. It appears as though MySQL simple ignores these tokens. fixes: https://github.com/dolthub/dolt/issues/7593
  • 2385: optimize sql.HashOf
    • pool *xxhash.Digest objects
    • use fmt.Fprintf to write to hash benchmark stats
    oos: linux
    goarch: amd64
    pkg: github.com/dolthub/go-mysql-server/sql
    cpu: AMD Ryzen 9 7900 12-Core Processor
    │     b1      │                 b2                  │
    │   sec/op    │    sec/op     vs base               │
    HashOf-24           79.65n ± 4%   70.86n ±  7%  -11.03% (p=0.002 n=6)
    ParallelHashOf-24   10.47n ± 4%   11.85n ± 19%        ~ (p=0.368 n=6)
    geomean             28.88n        28.98n         +0.32%
    │     b1     │                   b2                   │
    │    B/op    │    B/op     vs base                    │
    HashOf-24           4.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
    ParallelHashOf-24   4.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
    geomean             4.000                    ?                      ¹ ²
    ¹ summaries must be >0 to compute geomean
    ² ratios must be >0 to compute geomean
    │     b1     │                   b2                   │
    │ allocs/op  │ allocs/op   vs base                    │
    HashOf-24           2.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
    ParallelHashOf-24   2.000 ± 0%   0.000 ± 0%  -100.00% (p=0.002 n=6)
    geomean             2.000                    ?                      ¹ ²
    ¹ summaries must be >0 to compute geomean
    ² ratios must be >0 to compute geomean
    
  • 2383: promote string lookup range types When performing range lookups, we convert the key to the type of the column. The conversion throws an error when the key doesn't fit within the type for the index. The fix is to promote these (only for StringType) so the ranges fit. There were issues with type.Promote() for all types. Additionally, there are some inconsistencies with MySQL when performing these checks with NUL characters (\0). They are skipped tests for now. related https://github.com/dolthub/dolt/issues/7588
  • 2382: add support for json_pretty MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/json-utility-functions.html#function_json-pretty
  • 2381: [memory] force mutating the editAcc AutoInc because tableEditor is unreliable I can't figure a clean way to get the insert editor's edit accumulator and table editor data in sync when a self-referential foreign key initializes the session editor during analysis. So I just forced us to mutate the edit accumulator's auto increment id, which should prevent bugs of the kind we've been seeing. Zach might have a better understanding of how this should work. fixes: https://github.com/dolthub/go-mysql-server/issues/2369
  • 2380: Stubbing out support for COM_BINLOG_DUMP_GTID command Stubbing out support for two new mysql.Handler methods to support streaming binlog events from a server to a client. Depends on Vitess PR: https://github.com/dolthub/vitess/pull/317 Related to https://github.com/dolthub/dolt/issues/7512
  • 2378: map straight join to inner join This PR temporarily remaps STRAIGHT_JOIN operator to INNER_JOIN operator. fixes https://github.com/dolthub/dolt/issues/7580
  • 2377: fix binary cast to maintain length We were improperly dropping CAST node during comparison. It might be fine in many cases, but it is definitely not for comparing BINARY column types.
  • 2376: return errors for charset/collation mismatch
  • 2375: create system variable interface This PR creates SystemVariable and SystemVariableScope interfaces. This allows doltgres to use these interfaces for defining and handling all the configuration parameters. The SystemVariable struct is renamed to MysqlSystemVariable. The SystemVariableScope byte is renamed to MysqlSVScopeType.
  • 2373: charset table option tests In GMS, we reparse table options with a regular expression, but we only cover CHARACTER SET and not its synonym CHARSET. As a result, we just ignore table options for CHARSET. The fix is in https://github.com/dolthub/vitess/pull/315 TODO: maybe should just address this TODO instead...
  • 2372: implement JSON_QUOTE() MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/json-creation-functions.html#function_json-quote
  • 2371: don't use all caps for engines info table Some clients rely on the correct casing of column names For some reason, the casing is different when performing SHOW ENGINES; vs select * from information_schema.engines; Fortunately, the way we do SHOW ENGINES; is actually a SELECT ... under the hood. So the hacky fix is to just use an alias :) related https://github.com/dolthub/dolt/issues/7574
  • 2368: support JSON_MERGE() and JSON_MERGE_PATCH() MySQL Docs:
  • 2367: implement JSON_OVERLAPS() MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-overlaps
  • 2366: Update README with latest sample code from _example/main.go The latest release of go-mysql-server requires a different way of instantiating the database server. Notably, a function that provides sessions must now be provided. This change updates our README with the latest working example code from _example/main.go. Related to https://github.com/dolthub/go-mysql-server/issues/2364
  • 2365: implement random_bytes() MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/encryption-functions.html#function_random-bytes
  • 2362: Feature: last_insert_uuid() function UUIDs are often used in place of auto_increment IDs, but MySQL doesn't provide an easy way to get the last generated UUID that was used in an insert. This change introduces a new function, last_insert_uuid() that operates similarly to last_insert_id(). For a column identified as a UUID column, callers can use last_insert_uuid() to retrieve the last generated UUID value that was inserted into that column. In order to be considered a UUID column, a column must be part of the primary key and it must meet one of the following type signatures:
    • VARCHAR(36) or CHAR(36) with a default value expression of UUID()
    • VARBINARY(16) or BINARY(16) with a default value expression of UUID_to_bin(UUID()) (optionally, the swap_flag for UUID_to_bin may also be specified)

    Example usage:

    create table t (pk binary(16) primary key default (UUID_to_bin(UUID())), c1 varchar(100));
    insert into t (c1) values ("one"), ("two");
    select last_insert_uuid();
    select c1 from t where pk = uuid_to_bin(last_insert_id());
    
    Related to https://github.com/dolthub/dolt/issues/7547
  • 2361: implement ADDDATE() MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_adddate
  • 2360: fix special case for now() string The BATS tests import-mysqldump.bats was failing due to a recent string replace case added by https://github.com/dolthub/go-mysql-server/pull/2357. I didn't account for when NOW() would be used with other functions inside a DEFAULT column expression, and was replacing the "NOW(" with "CURRENT_TIMESTAMP(". This was causing problems as we reparse ColumnDefaultExprs, resulting in unparenthesized default expressions, which threw an error.
  • 2359: unskip fixed tests There are some tests that are fixed, but we haven't unskipped them. Additionally, this cleans up the way we skip certain tests so that it is more consistent.
  • 2357: fix ON UPDATE CURRENT_TIMESTAMP precision I had mistaken assumed that MySQL did not allow any precision arguments for NOW() (and synonyms) for column DEFAULT and ON UPDATE expressions. It turns out MySQL only requires that the column type precision match the expression. Additionally, we did not perform these error checks for DEFAULT expression, so now we do. fixes https://github.com/dolthub/dolt/issues/7555
  • 2351: implement JSON_TYPE() MySQL Docs: https://dev.mysql.com/doc/refman/8.0/en/json-attribute-functions.html#function_json-type Companion PR: https://github.com/dolthub/vitess/pull/314

vitess

  • 329: Changes to binlog event creation functions
    • Exposing the Length() function in the BinlogEvent interface so calling code can access the event size present in a binlog event's header. Needed for calculating binlog file position.
    • Renaming FakeBinlogStreamBinlogStream so calling code can use it when serializing binlog events.
  • 328: revert decimals issue: https://github.com/dolthub/vitess/pull/328
  • 327: add case for time.Time and decimal in bindvars We were unable to use time.Time and decimal type variables bind vars, so they couldn't be used as arguments to prepare statements. This PR addresses that issue. fixes: https://github.com/dolthub/dolt/issues/7665
  • 325: /{.github,go.mod,go.sum}: bump go version
  • 324: Ensure that float values parsed into expressions will always be parsed back into floats, not decimals.
  • 323: Parser support for SOURCE_AUTO_POSITION When acting as a replica, Dolt implicitly assumes SOURCE_AUTO_POSITION is set to 1. This adds parser support so that it can be explicitly specified. Adding this so that when we're configuring a MySQL replica, we can use the same setup code without having to special case this parameter.
  • 322: parse table options into struct Instead of just making a large string that is reparsed in GMS, parse table_options into a list of structs similar to how we handle index_options and constraint_options.
  • 321: [ast] walk tableFuncExpr for bind variables
  • 320: Updates for binlog primary protocol
    • Porting over more code from vitess.io/vitess – support for the COM_REGISTER_REPLICA command.
    • Fixing a bug in Vitess' deserialization of the COM_BINLOG_DUMP_GTID command.
    • Adding some String functions to help with debugging.
    • Exposing the ability to flush a connection's buffer, as a short-term workaround for needing to flush the buffer more frequently than at the end of the connection in order to support `COM_BINLOG_DUMP_GTID'.
  • 319: make constraint name optional for primary key fixes https://github.com/dolthub/dolt/issues/7601
  • 318: Support for more binlog statements Adding parsing support for:
    • show replicas
    • show binary logs
    • show binary log status
  • 317: Port: Support for Vitess server to send binlog events Porting over support from the main Vitess repo for a server to send back binlog events over a connection. Also includes support for handling the COM_BINLOG_DUMP_GTID command. Related to https://github.com/dolthub/dolt/issues/7512
  • 315: support binary charset in table option This PR adds binary as a valid charset option. Additionally, this changes CHARSET to expand to synonym CHARACTER SET for parsing in GMS. fixes https://github.com/dolthub/dolt/issues/7576
  • 314: support casting to year
  • 313: supports FROM s.account, in which account is non-reserved keyword

Closed Issues

  • 2402: Consistent usage of variables in the example
  • 2391: Potential regression: number cast to JSON no longer read as float
  • 2396: Running multiple migrations in a transaction
  • 2397: Primary key column order changes column order on insert
  • 2369: Self-referencing foreign key constraint breaks auto-incrementing ids in memory mode
  • 2341: Does it support Functional Key Parts index ?
  • 2349: Foreign key constraints break auto-incrementing ids in memory mode
  • 1157: show index from table_name doesn't include primary key
  • 1340: Hangs on TPC-H Query 1
  • 399: sql.FilteredTable usage and implementation
  • 514: benchmark memory db
  • 807: Documentation of some interfaces and some important concepts
  • 1567: navicat connect DB but can not edit
  • 2213: UPDATE statements are Noop
  • 2215: any plan to build new release?

v0.18.0

2 months ago

v0.17.0

8 months ago

This is our ~quarterly rollup release, containing many new features, bug fixes, and performance improvements. See the merged PRs for details. Interfaces are not guaranteed stable before 1.0.0.

This release includes dramatic changes to parsing and the query planner. Users running a test server are expected to be unaffected, but integrators building their own backend may need to make changes.

Merged PRs

go-mysql-server

  • 1965: Add error test for ambiguous column name query close https://github.com/dolthub/dolt/issues/6395
  • 1963: Fixed type hashing for Full-Text Fixes the reopened issue: https://github.com/dolthub/dolt/issues/6543 Not all types were covered by the default case.
  • 1961: engine: Make ReadOnly a toggleable atomic.Bool.
  • 1960: Fixed Full-Text NULL handling and ALTER TABLE case Fixes https://github.com/dolthub/dolt/issues/6540 and https://github.com/dolthub/dolt/issues/6541
  • 1959: Bug fix: Prevent panic when reading non-existent user and system vars Fixes https://github.com/dolthub/dolt/issues/6546 We have enginetests that cover both of these queries, but because we don't run them with the full wire request/response processing code, we didn't catch these bugs during testing. Happy to add more tests here if there are suggestions, but I think the right way to test both of these is to get our existing test suite running over a SQL server connection, instead of just using the internal interfaces to the engine (i.e. https://github.com/dolthub/dolt/issues/3646), which Zach started on last week.
  • 1958: Don't parse queries twice Local profile for oltp_point_select (query with smallest time spent in execution) is 5-15% speedup. Impact on queries with longer-runtime will be smaller, proportional to the fraction of time spent in analysis vs execution. results here: https://github.com/dolthub/dolt/pull/6547#issuecomment-1686795603
  • 1957: Fixed relevancy ordering for Full-Text Fixes https://github.com/dolthub/dolt/issues/6530
  • 1956: Removed unused AutoIncrementGetter interface Related to https://github.com/dolthub/dolt/issues/6543. The AutoIncrementGetter was moved from the editor to the table years ago, however the interface remained. I debated deleting this during my Full-Text implementation, however decided to leave it. Now, we've encountered an error with an integrator making use of the interface, so it has been removed here and the interface was moved into the integrator since it's an internal detail now.
  • 1955: adding catalog table function interface
  • 1954: Lateral join uses prepend row on RHS
  • 1952: GMS tests have to resolve defaults Force GMS to resolve column defaults, fix bugs exposed by additional testing. Dolt enginetests pass locally.
  • 1951: Fixed collation display in SHOW CREATE TABLE Originally, we didn't display the collation in SHOW CREATE TABLE when the collation was the default collation. Now, it doesn't display it if it's the same as the table collation, which mimics MySQL's behavior.
  • 1950: Honor precision for datetime and timestamp, default to 0 (no fractional seconds)
  • 1949: Revert "Merge pull request #1944 from dolthub/zachmu/timestamp" This reverts commit ca69015243946a0a42a0ec6a225da9c4551a0e12, reversing changes made to c11b504a18c48671c29c1494460f662e1f13f712.
  • 1948: Name resolution refactor Accumulation of:
  • 1944: Changed datetime and timestamp types to honor precision and default to 0 digit precision This matches the MySQL behavior. Partial fix for https://github.com/dolthub/dolt/issues/6503
  • 1942: Full-Text Fixes Pt. 3
  • 1941: Bug fix for JSON_ARRAY function with binary arguments Binary args are now treated as character strings Also added a testing path to ScriptTests that let you inject Vitess bindvars to exercise more server logic Fixes https://github.com/dolthub/go-mysql-server/issues/1855
  • 1940: Add SECURITY.md.
  • 1938: Create interface for indexible tables in IndexedTableAccess Currently, only ResolvedTables are allowed to have indexes. There exists an interface, sql.IndexAddressable, which any node or table can implement in order to be a candidate for index-based optimization. But in practice, implementing that interface won't actually do anything because the IndexedTableAccess struct explicitly requires a ResolvedTable. This PR replaces the ResolvedTable field in IndexedTableAccess with a new interface tentatively called TableNode, although a more specific name would probably be better. In order for a node to be used for index-based optimization, it must implement this interface, and the table returned by the UnderlyingTable method must implement sql.IndexAddressable
  • 1937: Remove do-nothing logic from pushdown.go This code is for an optimization that "pushes" filters deeper into the tree so that they're adjacent to the tables they modify. I've simplified the logic in two ways:
    • Removed handling of IndexedTableAccess nodes. This analysis pass used to run after these nodes were generated, but now runs before, so this code path will never be hit. Removing this logic makes it easier to make future changes to IndexedTableAccess
    • Removed the withTable subfunction, which never actually does anything, because the only table it will attempt to assign to a ResolvedTable is the table already on the node. This was likely leftover from a previous cleanup.
  • 1935: Allow timestamps when encoding json As reported on discord, Nautobot, through DJango, puts time stamp data into a json object. This fails because:
    db> select JSON_OBJECT("a", Now());
    unsupported type: time.Time
    
    This change enables the encoding of a time stamp into a string.
  • 1933: Fixed case sensitivity bugs in various statements
  • 1930: leave aliases in projection We convert expression.Alias into expression.GetField with the name replaced in the top-level projection. When aliasing two different columns with the same name, we fail to properly distinguish them and end up rewriting the GetField indexes for both columns to be the same; this leads to incorrect results. A simple fix appears to be simply allowing the top-level projection to remain as an expression.Alias. This fix does not work for prepared statements in the old name resolution path. fix for: https://github.com/dolthub/dolt/issues/6455
  • 1929: Add support for json_contains_path()
  • 1928: Generated stored columns prototype Looking for feedback. The approach is a little bit wonky: it uses the same code paths as column defaults since they behave so similarly, but this has some weird consequences:
    • For generated columns, we fill in the column.DefaultValue field with the Generated expression
    • In various places, we now have to consider whether to use either column.DefaultValue, or column.Generated Overall I think I'm favorable on this approach, but keeping the two values more separate might be better for maintainability, not sure. Thoughts?
  • 1926: Use EvaluateCondition for conditions in join statements Fixes https://github.com/dolthub/dolt/issues/6412 Use the given EvaluateCondition util function to determine whether a join condition is satisfied, which accounts for truthy integer values as mentioned in the linked issue.
  • 1925: Fix load data check constraint indexing bug fix show tests
  • 1924: Makes several new kinds of alter table statements involving auto_increment columns work correctly Also: makes several kinds of ALTER TABLE statements with multiple clauses more lenient in their error checking than MySQL. These statements will now succeed instead of being rejected. Fixes https://github.com/dolthub/dolt/issues/6218
  • 1922: Render enum/set variables as strings after they are set Fixes https://github.com/dolthub/dolt/issues/6370 Ensure that when getting all session variables, if any of them is of an enum/set type, we convert them back to their string value. The SET command would amend the value in the session variables map to its numerical representation, which we need to translate back.
  • 1921: Use a custom iterator when building HashJoin Lookups. Previously we were gathering all the child rows into a CachedResults node, and then iterating over the cached results to build the lookup. Cutting out the CachedResults and filling the lookup as we iterate simplifies the plan tree and also prevents a potentially large slice allocation. Benchmarking this showed no measurable impact on runtime, suggesting that the time taken populating/iterating over the cache was negligible. But the hash join used in the benchmark allocated 20% less memory.
  • 1920: Allow AntiHashJoins to distinguish between empty and non-empty secondary tables. AntiHashJoin and LeftOuterHashExcludeNullsJoin should always evaluate at least one secondary row if the secondary table is nonempty. This guarentees the same behavior as MySQL for where x not in (...) expressions when x is nullable. Some joins (AntiJoins and some joins converted from AntiJoins) have an "excludes NULL" property, which means that if a filter condition on the join evaluates to NULL, the corresponding primary row can't be included in the result set. This means that if the primary row has a NULL value used in a filter, we need to know whether or not the secondary table has at least one row. Using a HashJoin makes that impossible without special handling. We had a test designed to catch this, but the test wasn't actually using a HashJoin, so this was missed. This PR also fixes the test to use a hash join.
  • 1919: JSON_ARRAY correctly handles CHAR bindvar params The JSON_ARRAY function wasn't able to handle a []byte literal expression in a bind var. I also noticed that although our script tests can specify Bindings, they weren't getting used by our prepared query runners. I also fixed that, so that I could add a new test for this issue. Fixes: https://github.com/dolthub/go-mysql-server/issues/1855 Related Vitess change: https://github.com/dolthub/vitess/pull/261 Dolt CI Checks: https://github.com/dolthub/dolt/pull/6441
  • 1917: More name res tests Fix JSON_TABLE and stored procedures on new name resolution path. edit: Added on duplicate update rewrite
  • 1915: ANSI_QUOTES support for go-mysql-server Now that our parser has support for parsing in ANSI_QUOTES mode and treating double quotes as identifier quotes, this PR starts using that support when we parse queries. The main changes in this PR are:
    • a new SqlMode type to make it easier to load SQL_MODE and inspect enabled modes.
    • tracks SQL_MODE when a procedure/trigger/view is created.
    • passes ParserOptions to the parser, to enable parsing in ANSI_QUOTES mode.
    • connects the Vitess error logger to GMS' error log, so that errors in Vitess aren't swallowed (currently if a statement in a ComPrepare message doesn't parse, GMS doesn't log anything). Dolt has a similar, corresponding PR: https://github.com/dolthub/dolt/pull/6465 Related to: https://github.com/dolthub/dolt/issues/6305
  • 1914: More Full-Text fixes More bugs found and fixed for FULLTEXT indexes. The ordering bug is fairly major, as it could require a drop/readd of the index, so I want to get this out now rather than waiting until I've gotten more tests/fixes in.
  • 1913: Adjust range heap coster to ensure we don't choose it over a strong lookup join. This improves the performance for a client query by ensuring that we don't us a HeapRangeJoin when there's a good LookupJoin candidate, but we do use a HeapRangeJoin when there isn't. In larger queries, the time spent generating and evaluating candidate rows dominates. Using seqIOCostFactor feels like a bit of a misnomer, but cpuCostFactor is too low to reflect this behavior, and this is what costInnerJoin uses.
  • 1912: Normalized handling of ALTER TABLE statements This PR normalizes the handling of all ALTER TABLE statements to use the same code path. Previously some used convertDDL instead. Also changes DDL processing to generate multiple plan nodes for statements that need them. Currently tested with add column .. unique, but the same approach should also work with auto_increment and other clauses. Relies on changes in https://github.com/dolthub/vitess/pull/260
  • 1909: Show variables panic
  • 1908: Some Full-Text fixes Adds a few additional tests, along with fixes. This is primarily for Sakila compatibility. More tests and fixes are forthcoming, and will arrive in a second PR.
  • 1907: support joins on using syntax Relevant MySQL docs This PR adds an implementation for the USING clause during joins. It is mostly equivalent to creating a conjunction over equality statements over each column in an ON clause. Additionally, this properly supports NATURAL LEFT/RIGHT JOINs. So we now have
  • 1906: Fix ErrBinaryCollation in queries with []byte argument Binding arguments of type []byte have been converted to string literals with the default collation (utf8mb4_0900_bin) by types.CreateStringWithDefaults(). I think types.CreateBinary() should be used, which generates literals with binary collation.
  • 1905: When estimating the cardinality of an outer join, bound the cardinality below. For instance, left outer joins can never have a smaller cardinality than their left child. This should let us get more accurate estimates on the cardinality of outer joins and choose better plans.
  • 1904: sql/mysql_db: Rework how we store and access table data for users, grants and replica_source_info. In general, we keep the same structure of storing the data in structs, keyed in multimaps, and having converters for going to and from sql.Rows. We change the following important things:
    1. We more explicitly model a multimap and an indexed set of entities with multiple keyers.
    2. We add read and write locking around edits and reads of the data table.
    3. We explicitly do not expose the raw indexed set or multimap from the MySQLDb instance itself. The unprincipled access of the various *Data instances in the old implementation was somewhat problematic.
  • 1896: Stubbing out new Handler function to prep for supporting ANSI_QUOTES SQL mode PR https://github.com/dolthub/vitess/pull/256 adds support at the Vitess layer for parsing SQL statements using ANSI_QUOTES SQL mode, where double quotes are used as identifier quotes, and not string literal quotes. This change updates the implementations of mysql.Handler for the new function needed to parse prepared statement commands with ANSI_QUOTES mode. A future PR will enable the ability to turn on the ANSI_QUOTES support in Vitess.
  • 1892: Fix panic for WHERE filter over SHOW VARIABLES Fix for: https://github.com/dolthub/dolt/issues/6379
  • 1891: Left pad odd length hex strings Fixes https://github.com/dolthub/dolt/issues/6351 If hex string v is of odd length, prepend an "0" before passing it to Go's DecodeString. I've changed the implementation to use DecodeString, but if keeping this as a byte array is preferred, I'll switch back.
  • 1890: Fix panic when selecting unsigned number columns via driver Calling the reflect.Value.Int() on an unsigned typed value will panic. The reflect.Value.Uint() must be used.
  • 1889: Recost LookupJoins to remove special casing for indexes where every column is used in a filter. The only joins that are affected by this recosting are joins that use an index where every column in the index has a key expression, but we can't prove that lookups are constant. We currently special case this, giving these a slightly elevated priority over joins that don't use every column in the index (and we can't prove that lookups are constant.) So for example a lookup with one key expression on an index with one column ends up being preferred over say, a lookup with three key expressions on an index with four columns, even though it looks like in practice the latter is a more efficient join. Removing this special casing resulted in improved plans in specific client queries. Most of the changed plans in this PR are workarounds for https://github.com/dolthub/go-mysql-server/issues/1893, https://github.com/dolthub/go-mysql-server/issues/1894, and https://github.com/dolthub/go-mysql-server/issues/1895. A few are actually better plans than we were previously generating.
  • 1887: have plan.EmptyTable implement sql.DeletableTable We throw an error when trying to delete from EmptyTable. This error is partially caused by https://github.com/dolthub/go-mysql-server/pull/1885 The error didn't show up in GMS as there are Exchange nodes that appear in dolt side that don't appear here.
  • 1886: Apply index optimization to Offset nodes and drop 0 Offsets This PR applies the index sort optimization to plans that look like LIMIT(OFFSET(SORT())). Additionally, this PR drops OFFSET nodes that start at 0, as they don't change the output. Fix for: https://github.com/dolthub/dolt/issues/6347
  • 1885: have plan.EmptyTable implement sql.Updatable interface In order to not throw table doesn't support UPDATE error, the EmptyTable node should implement the Updatable interface. Additionally, there are other private noop iterators to prevent nil panics. Fix for: https://github.com/dolthub/dolt/issues/5397
  • 1884: Fix data race in processlist map Do a deep copy of maps and any nested maps to prevent concurrent read/write access. Fix for: https://github.com/dolthub/dolt/issues/6332
  • 1882: Add dynamic privilege CLONE_ADMIN
  • 1880: Add "Sliding Range Join" execution plan (The original PR was accidentally merged. I fixed the history but there doesn't seem to be a way to "unmerge" the PR) This is the draft implementation of the "Sliding Range Join" execution plan. This allows for more performant joins when the join condition checks that the column on one table is within a range specified by two columns on the other table.
  • 1877: Add "Sliding Range Join" execution plan This is the draft implementation of the "Sliding Range Join" execution plan. This allows for more performant joins when the join condition checks that the column on one table is within a range specified by two columns on the other table. TODO: Elaborate in this description before making this PR not a draft.
  • 1875: match notation for decimal parsing Follow up to https://github.com/dolthub/go-mysql-server/pull/1874 Turns out it is possible to specify floats using scientific notation, which caused some issues with conversions especially around large decimals.
  • 1874: avoid scientific notation for floats/decimals We use some string comparison logic to find precision loss and determine if something should be float/decimal type. When printing very large floats, the %v format option in the fmt packages defaults to scientific notation, so like 1.234e567. This does not work well with our (hacky) string code. The %f option doesn't work very well, as it likes to append .00000. It appears strconv.FormatFloat does what we want, so I just picked that. fmt package docs: https://pkg.go.dev/fmt Format Float docs: https://pkg.go.dev/strconv#FormatFloat fix for: https://github.com/dolthub/dolt/issues/6322
  • 1873: Supporting mysql.help_ tables This first pass adds the table schemas to the mysql database for help_keyword, help_category, help_topic, and help_relation. There is no support for data in the tables yet; we're starting with just table schemas to see if that's enough for tool compatibility. Related to: https://github.com/dolthub/dolt/issues/6308 I still need to do acceptance testing with the exact repro in the issue linked above. I'll follow up with Max on that tomorrow to confirm. I'm hoping just supporting the schema will be enough for the FusionAuth tool, but we may end up needing to populate these tables, too.
  • 1871: Full-Text Indexes This is a partial implementation of Full-Text indexes. There is still quite a bit to finish on the GMS side (as can be seen from the copious amount of TODOs), but this shows the broad strokes of how it's implemented, along with most of the "difficult" design choices being implemented. The major choice that has not yet been finalized is how to deal with FTS_DOC_ID, as it's an AUTO_INCREMENT column in MySQL, but that would not play well with Dolt merging. I already have ideas on how to handle that (taking into account remotes, etc.), but that would come from a later PR. https://docs.google.com/document/d/1nGyYg461AhxQjFLzhEEj01XMz0VaTBaBaA44WNu0fc4/edit Quite a few things have changed from the initial design doc, mostly based on feedback during the meeting, however some of it was post-meeting. There are three tables instead of 1: Config (stores table-specific information shared across all indexes), WordToPos (maps words to an ID and position, not fully used in the default search), and Count (used to calculate relevancy, also not fully used in the default search). I was planning on converting MATCH ... AGAINST ... to a join between the tables, which would work when fetching results, but MATCH ... AGAINST ... may also be used as a result, which necessitated writing all of the functionality anyway, so the join plan was dropped. Last thing to mention, is that I'm pretty sure that Full-Text indexes actually do a full table scan. It seems weird, but AFAICT the indexes are used to quickly calculate relevancy for each search mode. It seems that, for overly large tables, the search time increases even when other index operations continue to operate nearly instantaneously. I've tagged two people for review to make it a bit easier. Of course, feel free to take a look at more if you desire. @reltuk The sql/fulltext/fulltext.go file is an expansion of the file you've previously reviewed (all still kept to a single file for now). To complement it and see how it'll be implemented on the Dolt side, you can look at memory/table.go. Dolt's table editor will be similar, and the merge paths will only use the FulltextEditor, which special logic to interface with it from those paths. @max-hoffman Take a look at the analyzer changes, along with the sql/plan/ddl.go file. You'll probably need to reference sql/fulltext/fulltext.go as well.
  • 1869: Migrate most enginetests for new name resolution This doubles most of the enginetests to add versions with new name resolution. As a result testing takes ~2x as long, temporarily. Gets majority of those enginetests working with a couple bigger exceptions:
    • plans projections are subtly different in a way that should be optimized but is probably not priority
    • stored procedures need their custom resolution logic ported
    • on duplicate update expressions are buggy, going to rewrite those for new format
    • skipping one derived table alias test, where we do not have expression memoization or lateral joins to help us execute a resolved plan (related https://github.com/dolthub/dolt/issues/6407)
    • many tests throw "column not found" instead of "table not found" errors. I tried to bookkeep those with Skips, but the skipped suites may accumulate other differences in the meantime.
    • I'll need to revert our prepared statement logic before the final switch
    • Various validators work a bit differently, might end up skipping some error tests to get the final switch in sooner Other suites:
    • TestJSONTableScripts_Experimental -- json_table still broken
    • TestRenameColumn_Exp -- error test has different error A couple other discoveries:
    • We have to hallucinate unknown table, column, and procedure names in trigger bodies on CREATE, and only fail on execution
    • Column default expressions appear to be resolved at execution time
    • Alter statements are only resolved at execution time
    • The precedence for ASOF in nested views and procedure calls is a bit hairy
    • json_array w/ and w/o distinct appears to be untested
    • ORDER BY in UNION seems pretty flaky and lightly tested, we resolve names from the left Dolt PR: https://github.com/dolthub/dolt/pull/6414
  • 1868: Fix bug in OrderedDistinct over Projection A mistype was checking the table name twice for column equality, rather than table and column name. The bug led to using OrderedDistinct in inappropriate cases.
  • 1867: Support for USING character set expressions Fixes https://github.com/dolthub/dolt/issues/6291
  • 1865: Add CustomValidator interface In many places we expect to see a commit hash in our result. Since the hashes take into account the system time when computing, it is difficult to predict what they will be. This PR adds a new interface that can be implemented on the dolt side to check for commit hashes.
  • 1864: No parallelism for children of ordered distinct We permitted parallelism into an OrderedDistinct node, which is a specialized Distinct node that expects results sorted on a specific index key. This change prevents parallelizing children of OrderedDistinct.
  • 1863: Bump google.golang.org/grpc from 1.37.0 to 1.53.0 Bumps google.golang.org/grpc from 1.37.0 to 1.53.0.
    Release notes

    Sourced from google.golang.org/grpc's releases.

    Release 1.53.0

    API Changes

    • balancer: support injection of per-call metadata from LB policies (#5853)
    • resolver: remove deprecated field resolver.Target.Endpoint and replace with resolver.Target.Endpoint() (#5852)

    New Features

    • xds/ringhash: introduce GRPC_RING_HASH_CAP environment variable to override the maximum ring size. (#5884)
    • rls: propagate headers received in RLS response to backends (#5883)

    Bug Fixes

    • transport: drain client transport when streamID approaches MaxStreamID (#5889)
    • server: after GracefulStop, ensure connections are closed when final RPC completes (#5968)
    • server: fix a few issues where grpc server uses RST_STREAM for non-HTTP/2 errors (#5893)
    • xdsclient: fix race which can happen when multiple load reporting calls are made at the same time. (#5927)
    • rls: fix a data race involving the LRU cache (#5925)
    • xds: fix panic involving double close of channel in xDS transport (#5959)
    • gcp/observability: update method name validation (#5951)

    Documentation

    • credentials/oauth: mark NewOauthAccess as deprecated (#5882)

    Release 1.52.3

    Bug Fixes

    • Fix user-agent version

    Release 1.52.2

    Bug Fixes

    • xds: fix panic involving double close of channel in xDS transport (#5959)

    Release 1.52.1

    Bug Fixes

    • grpclb: rename grpclbstate package back to state (#5963)

    Release 1.52.0

    New Features

    • xdsclient: log node ID with verbosity INFO (#5860)
    • ringhash: impose cap on max_ring_size to reduce possibility of OOMs (#5801)

    Behavior Changes

    ... (truncated)

    Commits
    • dba26e1 Change version to 1.53.0 (#5983)
    • 2a1e934 server: after GracefulStop, ensure connections are closed when final RPC comp...
    • e2d69aa tests: fix spelling of variable (#5966)
    • a6376c9 xds/resolver: cleanup tests to use real xDS client 3/n (#5953)
    • bf8fc46 xds/resolver: cleanup tests to use real xDS client 5/n (#5955)
    • 3930549 resolver: replace resolver.Target.Endpoint field with Endpoint() method (#5852)
    • 894816c grpclb: rename grpclbstate package back to state (#5962)
    • e5a0237 encoding: fix duplicate compressor names (#5958)
    • 4adb2a7 xds/resolver: cleanup tests to use real xDS client 2/n (#5952)
    • 52a8392 gcp/observability: update method name validation (#5951)
    • Additional commits viewable in compare view

    [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=google.golang.org/grpc&package-manager=go_modules&previous-version=1.37.0&new-version=1.53.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) ---
    Dependabot commands and options
    You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/dolthub/go-mysql-server/network/alerts).
  • 1862: implementing lateral joins
  • 1861: chore: remove refs to deprecated io/ioutil
  • 1850: Name resolution correctness tests This fixes many of the remaining correctness tests for TestSimpleQueries, TestsJoinOps, TestJoinPlanning, TestColumnAliases, TestDerivedTableOuterScopeVisibility, TestAmbiguousColumnResolution, TestReadOnlyVersionedQueries with the new name resolution strategy. Many of the query plans are slightly different but mostly equivalent. Join rearrangements and un-nesting in particular are better after this change, because I needed the transform logic work for both. There are a variety of other bugs the slight plan differences exposed that are fixed now. This does not fix every set of enginetests, there is still a lot to do. But I'm locking in compatibility for most of the core tests to prevent backsliding. The next follow-up is probably replacing the old name resolution. I will need to figure out if triggers, procs, prepared statements need any sort of special treatment.

vitess

  • 265: upgraded YAML library
  • 264: Revert https://github.com/dolthub/vitess/pull/261 Change in description breaks prepared statements that send a value with character data above the max size of a CHAR column (256 bytes). Fixes https://github.com/dolthub/dolthub-issues/issues/489
  • 263: Add SECURITY.md.
  • 262: Prepared query statement round trip Changes to aliases and json_table to make the AST string formatters round-trip. Biggest change to tests is that useSelectExpressionLiteral seems to behave differently.
  • 261: Preserving bind var type for sqltypes.Char params When a caller executes a prepared statement, they send the parameters as well as parameter type information to the sql-server. Vitess populates bindvars type information that go-mysql-server uses to execute the query. Vitess is currently converting many SQL types to VARBINARY, including CHAR, which makes it look like binary data was sent and not a char string, like the caller indicated. This change stops converting sqltypes.Char bind var type info into VARBINARY, which enables go-mysql-server to see that a char string was passed. Without this type information, go-mysql-server doesn't seem able to differentiate between legitimate binary data sent by the client versus a character string. Since these types need to be handled differently, and we can't assume that all VARBINARY types can be converted into strings, it seems like we need to respect the SQL type the caller indicated for the bind var and pass that up to integrators. It seems like this change could be helpful for other SQL types, too, but I wanted to start with just sqltypes.Char to see if this approach causes any other issues. Fixes: https://github.com/dolthub/go-mysql-server/issues/1855 Related go-mysql-server PR: https://github.com/dolthub/go-mysql-server/pull/1919 Related Dolt PR: https://github.com/dolthub/dolt/pull/6441
  • 260: Rename MultiAlterDDL to AlterTable and return it for all ALTER TABLE statements This normalization makes it easier to handle building a plan
  • 259: Bug fix for round tripping parsed cast function calls When formatting a parsed cast node back into a SQL string, we were using the form CAST(<arg>, <arg>), but that won't roundtrip back to MySQL. It needs to be either CONVERT(<arg>, <arg>) or CAST(<arg> as <arg).
  • 258: Adding new keywords to the non-reserved list so they don't need to be… … quoted
  • 257: Support for all temporal query forms in SQL 2011 These are the parser changes necessary to support https://github.com/dolthub/dolt/issues/6353 In addition to the 3 forms of temporal query in SQL 2011 (AS OF, FROM .. TO, BETWEEN), this PR also implements support for the 2 extensions added by SQLServer, ALL and CONTAINED IN. https://learn.microsoft.com/en-us/sql/relational-databases/tables/temporal-tables?view=sql-server-ver16 Additionally, VERSION is now a synonym for SYSTEM_TIME, a Dolt pseudo-extension.
  • 256: Support ANSI_QUOTES parsing mode The ANSI_QUOTES SQL mode changes the behavior of the double quote character. By default in MySQL, ANSI_QUOTES is not enabled and the double quote character is used to quote string literals. When ANSI_QUOTES is enabled, the double quote character may only quote identifiers. The ANSI_QUOTES mode does not change the behavior for backtick quote chars (they always quote identifiers) or single quote chars (they always quote string literals). MySQL Reference Docs for ANSI_QUOTES Related to: https://github.com/dolthub/dolt/issues/6305 (This is the first step towards supporting ANSI_QUOTES mode in Dolt/GMS) GMS PR https://github.com/dolthub/go-mysql-server/pull/1896 stubs out the new Handler interface function, but actually using ANSI_QUOTES mode in Dolt or GMS won't be possible until a few more changes to Dolt/GMS.
  • 254: Fix for using unqouted reserved words ('count' specifically) in the VALUES function
  • 253: Automatically concatenate adjacent string literals Fixes https://github.com/dolthub/dolt/issues/5232 This is to match the mysql behavior:
    mysql> select "a" 'b'   "c";
    +-----+
    | a   |
    +-----+
    | abc |
    +-----+
    
    The grammar can't accommodate this so it has to go in the lexer. It doesn't work if the strings are broken up by a mysql special comment, so we still have to special case that. Also removed support for using string literals as table aliases. MySQL has a mode to support using double-quoted strings only as identifiers, but it's not on by default and isn't supported anywhere else in the grammar.
  • 252: Fixed keyword usage in primary key clauses Fixes https://github.com/dolthub/dolt/issues/6290
  • 251: Fixed missing support for collations as strings Fixes issue https://github.com/dolthub/dolt/issues/6192 We only allowed collations to be declared after the CREATE TABLE portion in their non-string form. This adds support for the string form.
  • 250: support LATERAL syntax syntax for: https://github.com/dolthub/dolt/issues/6194

Closed Issues

  • 1855: GORM JSONArrayQuery.Contains isn't compatible
  • 1902: Valid join query erroneously reported as ambiguous
  • 1881: duplicate column names in a table alias should be prevented.
  • 1753: "SELECT * FROM tbl" has incorrect schema when table has default values.
  • 1745: Allow table names with special characters when MySql allows them

v0.16.0

10 months ago

v0.15.0

1 year ago

v0.14.0

1 year ago

v0.12.0

1 year ago

v0.11.0

2 years ago

This is a normally scheduled quarterly release of the library with many improvements and feature additions.

APIs are not guaranteed to settle until 1.0.

Merged PRs

go-mysql-server

  • 594: sql/plan: Fix join iterators to always Close() their secondary RowIter. Fix Subquery to Dispose its subquery.
  • 593: Make some update queries determinate
  • 591: Introduced a ViewProvider extension As part of this, got rid of the IndexRegistry and ViewRegistry on the context, put them on the Session instead. These changes significantly simplify the process of constructing an engine and running queries.
  • 590: Add dolt discord to readme
  • 588: Made it possible to use variables in AS OF expressions As part of this, also pulled resolving variables out of the resolve_columns step into its own rule.
  • 583: Update INNER JOIN Alpha
  • 582: sql/plan: exchange.go: Make Exchange's RowIter wait for all goroutines to shutdown cleanly. If we do not block on shutting down the goroutines that are handling the partitions, we cannot guarantee that we will not race with later uses of the sql.Session, for example. This converts the implementation to x/sync/errgroup and restructures things quite a bit.
  • 581: Skip fk validation on CREATE TABLE when fks are disabled
  • 579: Fixed panic on using an alias of a subquery expression in a where clause (now just an error)
  • 578: enginetest: Add BrokenQueries tests for projections in group by nodes not handling subquery expressions well.
  • 577: sql/analyzer: validation_rules: Disable validateSubqueryColumns, which was enabled in the latest releases but is still broken in some cases.
  • 576: Add Read Only transaction functionality
  • 575: Fixed bug in indexed joins When a query had two copies of the same table, and it could use an index to join them, it was non-deterministic which of the tables' (identical) indexes would be used. This choice doesn't matter for some implementations or even most queries, but in Dolt, if a query involves the same table at two different revisions (because of AS OF), it was arbitrary which table's index got returned. Because the dolt index implementation gets its data from its parent table, if it chose the wrong index it got the wrong data. This change restricts the choice of index to a single table name. Need tests demonstrating the bug, but those will have to live in Dolt for the time being.
  • 573: Add several features that unblock mysql workbench This pr implements
    1. Show STATUS
    2. Set CHARACTER SET
  • 572: Add the EXISTS Operator for Select Where Filters Adds the exists operator as described here: https://dev.mysql.com/doc/refman/8.0/en/exists-and-not-exists-subqueries.html
  • 568: sql/analyzer: indexed_joins: Keep searching for usable indexes when there are NOT(? = ?) and NOT(? <=> ?) clauses in a join conjunction. The indexed join logic is perfectly happy to go forward with a join plan if it doesn't find a perfect index, or even a usable index at all, for one or more table factors in the join. This logic is probably left over from when that was not the case, but for now we make it a little more liberal to cover some cases we need to cover for a customer.
  • 567: sql/plan,analyzer: Fix HashLookup for cases where there is a schema prefix not visible to the direct join parent. This adds a TransformUpCtx function that passes along a SchemaPrefix in the TransformContext if the schema prefix is scrutable from resolved children at that point in the analysis. apply_hash_lookup makes use of this to make the transformed expressions in the HashLookup lookup node refer to the right place, even when JoinNode.Left().Schema() doesn't have the whole prefix. This schema prefix is probably useful in other places and I am exploring rationalizing certain places where the analyzer makes use of the schema by using it or something like it. In the mean time, converted some of the more obscure transform variants (UpWithParent, UpWithSelector) to use TransformUpCtx as well. Held off on moving TransformUp to TransformUpCtx. Very open to suggestions on names for TransformUpCtx.
  • 566: sql/analyzer: Make SubqueryAlias nodes always cacheable.
  • 565: sql: Removing ctx parameter from Expression.WithChildren. Also removes it from FunctionFn types, TransformExpression... functions, and Aggregation.NewBuffer. We think this ctx parameter might have been added a few months ago as part of some optimization work which never made it across the line. Instead of threading a *sql.Context everywhere, if we have need of a *sql.Context during analysis or to precompute or materialize a certain result in the future, I think I'm going to advocate for a specific optional interface that the analyzer is aware of. It could then pass the context through at a specific analyzer phase and the function/expression node would have the opportunity to get ready to do what it needs to.
  • 564: sql/plan: Defer returning error from IndexedInSubqueryFilter.RowIter until the Next() call. Fixes some interactions between INSERT IGNORE INTO and expressions which will fail on evaluation. This might be a credible strategy everywhere we .Eval within RowIter, for example, in indexed_table_access.
  • 563: Added an extension point for custom function providers As part of this, embarked on a major refactor:
    • Extracted interfaces for sql.Catalog and sql.ProcessList
    • Moved existing sql.Catalog to analyzer package
    • Moved ProcessList and MemoryManager out of Catalog
    • Changed Analyzer and Engine to take a DatabaseProvider instead of a Catalog
  • 560: Update some analyzer rules and expression behavior to deal with tuples in a more principled way. Subquery expression nodes can now return tuples. InSubquery expression nodes can work with tuples as expected. An analyzer validation step now returns operand errors in more cases, expecting almost all expressions to return one column, but special casing certain operators and functions which support tuples. Added some TODO tests for cases where our tuple comparisons are still not behaving as we want them to. In particular, null safe vs. non-null safe comparisons and type coercion of tuple subtypes in comparisons still need work.
  • 559: sql/analyzer: aliases.go: Make sure we add the right table alias when traversing a DecoratedNode.
  • 557: sql/analyzer/optimization_rules.go: moveJoinConditionsToFilter: Fix small inaccuracy where computed topJoin could be wrong. This could result in the optimization pass adding the same Filter node to multiple places in the join tree.
  • 556: sql/plan/indexed_table_access.go: Change static index lookup nodes to not keep returning their unused key expressions. These needs take key expressions, but they do not evaluate them. They are not part of the evaluation tree, but they cause some problems with things like FixFieldIndexes and prune_columns, where all GetField expressions in the plan tree are expected to resolve to fields that are actually in scope and resolvable at the node that is being evaluated. This fixes a particular evaluation bug where a subquery expression in a join condition gets moved to the filter above the joins. If the moved subquery expression made use of a static index table lookup, the moved expression would fail to rewrite its field indexes appropriately and the query would return incorrect results.
  • 555: Fix handling of secure_file_priv for LOAD DATA
  • 554: Added locks, todo to mutable session state
  • 553: Wrote proper number conversion logic Previously we were relying on the cast library, which had a few issues with how we expect SQL numbers to function. One such issue was how number strings were handled (such as interpreting "01000" as a binary number rather than in decimal). There have been more issues in the past that have gone undocumented, but this should fix them (or allow for an easy fix since it's all custom logic now).
  • 552: Fixed actual default collation representative
  • 551: Check Error when building Session
  • 549: Mutable DatabaseProvider refactor
  • 548: Fix Resolve Defaults
  • 547: Expose CREATE DATABASE to integrators Remove AddDatabase functionality from Catalog and DatabaseProvider. Must have a DatabaseProvider with a static set of Databases to construct a Catalog. New Databases can be created with CreateDatabase, which is now an integrator function.
  • 544: sql/plan: exchange_test.go: Sometimes these tests fail under -race because they are racey. Fix that.
  • 540: sql/expression/function/aggregation: Change aggregation functions to work better with group by expressions. The existing code seems to be expecting rows to arrive in order of the group by expression. But the analyzer does not arrange for that to happen. Instead, this PR changes the approach so that each aggregation function duplicates its Child expression(s) as part of its per-aggregation state. That way it can Eval against its per-group-by Child and get the correct results out of Distinct for example. This PR updates AVG, FIRST, LAST, MAX, MIN and SUM to do this. COUNT(DISTINCT ...) is handled by a special expression node instead, and nothing has been changed in Count or CountDistinct. group_concat also seems to handle DISTINCT itself, and so I have not changed anything there. Json aggregation did not look immediately amenable to combining with DISTINCT, because the Update functions seemed to error when the child expression returned nil, so I have not changed them either.
  • 538: sql/datetimetype.go: Handle parsing dates like 2021-8-3 correctly.
  • 537: server/handler.go: Have ComPrepare correctly return null result schema metadata for write statements. This fixes our server's interaction with clients which expect the result metadata for a write statement to be NULL. One such client is RMariaDB. See: https://github.com/dolthub/dolt/issues/2084.
  • 536: Zachmu/logger
  • 535: Added function to parse column type strings to SQL types
  • 534: server/server: Support configuring TLSConfig in the vitess Listener.
  • 532: Implement the CONVERT_TZ() SQL function
  • 530: add engine tests for dateparse Follow-up to https://github.com/dolthub/go-mysql-server/pull/523
  • 529: Vinai/load file
  • 528: Hacky version of read committed isolation level, which begins a new t… …ransaction on every statement. Basically it's read committed, but without the ability to turn off auto commit
  • 523: implement built-in function str_to_date Closes #518 This PR implements the STR_TO_DATE MySQL function. In places where the spec is ambiguous, I'm attempting to match the behavior of MySQL version 8 from my manual testing. I need to implement a few more parsers and add more test cases to cover the expected behavior.
    go test  -cover github.com/dolthub/go-mysql-server/sql/parse/dateparse
    ok    github.com/dolthub/go-mysql-server/sql/parse/dateparse  0.163s  coverage: 89.3% of statements
    
    cc @zachmu
  • 519: Fix explicit DEFAULT value in insert query It seems that go-mysql-server is not compatible with insert query like:
    INSERT INTO `users` (`id`, `deleted`) VALUES (1, DEFAULT)
    
    Whereas DEFAULT is just to specify deleted columns should use column default value explicitly. The issue could be demostrated using below code:
    package main
    import (
    dbsql "database/sql"
    sqle "github.com/dolthub/go-mysql-server"
    "github.com/dolthub/go-mysql-server/auth"
    "github.com/dolthub/go-mysql-server/memory"
    "github.com/dolthub/go-mysql-server/server"
    _ "github.com/go-sql-driver/mysql"
    )
    func main() {
    db, _ := dbsql.Open("mysql", "root:@tcp(127.0.0.1:3307)/test")
    defer db.Close()
    query := `CREATE TABLE users (
    id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
    deleted tinyint(1) unsigned NOT NULL DEFAULT '0',
    PRIMARY KEY (id)
    ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4`
    stmt, _ := db.Prepare(query)
    stmt.Exec()
    _, err := db.Exec("INSERT INTO `users` (`id`, `deleted`) VALUES (1, DEFAULT)")
    if err != nil {
    panic(err.Error())
    }
    stmtOut, _ := db.Prepare("SELECT `deleted` FROM `users` WHERE `id` = 1")
    defer stmtOut.Close()
    deleted := true
    err = stmtOut.QueryRow().Scan(&deleted)
    if err != nil {
    panic(err.Error())
    }
    if deleted == true {
    panic("Wrong deleted value")
    }
    }
    var engine *sqle.Engine
    func init() {
    engine = sqle.NewDefault()
    db := memory.NewDatabase("test")
    engine.AddDatabase(db)
    config := server.Config{
    Protocol: "tcp",
    Address:  "localhost:3307",
    Auth:     auth.NewNativeSingle("root", "", auth.AllPermissions),
    }
    s, _ := server.NewDefaultServer(config, engine)
    go s.Start()
    }
    
    `db.Exec("INSERT INTO `users` (`id`, `deleted`) VALUES (1, DEFAULT)")` will result in error:
    Error 1105: plan is not resolved because of node '*plan.Values'
    
    This pull request should avoid such issue by turning explicit DEFAULT in insert query to implicit.
  • 516: Vinai/add drop pks
  • 512: Changed FILTER expressions to consider ENUM/SET types Previously a statement such as UPDATE test SET col = 2 WHERE col = 1; would fail for ENUM and SET types. For the FILTER node, we only consider the values for comparison, but the aforementioned types can match 'horse' with the number 50, so we have to consider the column type. Now this PR only affects ENUM and SET, although it's probably correct that all types should be used, with direct literal comparisons being used only when no other type can be derived from a column or variable. However, either MySQL has context-aware comparisons (my guess), or our comparison logic is wrong for other types, so I'm leaving those alone for now.
  • 510: Accept limit / offset as BindVar This should fix #509
  • 508: adds the time.Time utc format For some reason time.Time.UTC does not have a standard format defined in the time.go package. This adds the functionality here. cc. https://stackoverflow.com/questions/33119748/convert-time-time-to-string Fixes: https://github.com/dolthub/dolt/issues/1903
  • 507: Delete From support for Empty Table Addressed bug found in https://github.com/dolthub/dolt/issues/1923
  • 505: Vinai/ai noop
  • 503: Fix json number conversion
  • 502: From unixtime Extension of #490
  • 501: Fixed bug in alias resolution for aliases defined in group by and used in order by This fixes #499
  • 497: Add transactions test Adds tests for transactions and auto increment values.
  • 493: Fix Children() function of IndexedTableAccess Fix #478
  • 488: Modify ReadOnlyDatabaseHarness
  • 487: Andy/read only database
  • 486: Andy/database provider Adds a DatabaseProvider abstraction, allowing integrators to add their own logic to database resolution
  • 485: sql/plan: {update,delete}.go: Correctly return an error for unsupported UPDATEs and DELETEs against joins and subqueries.
  • 484: Add CLIENT_FOUND_ROWS functionality to INSERT on DUP. Also makes the capabilities flag a part of the client
  • 483: added JSON_OBJECT() sql function
  • 482: Vinai/fix bit type parsing Fixes parsing for bit type
  • 475: Fix JSON string comparison. Fix when a JSON is compared with a string, and apply unquote as MySQL does. Fixes #474
  • 473: sql/analyzer: indexed_joins: Use indexes in more cases where join condition includes AND ... IS [NOT] NULL.
  • 472: Fixed a bug involving aliases in filter pushdown, and made partial pushdown of filter predicates possible
  • 471: sql/analyzer: Add support for using indexes in joins where ON condition includes top level OR clauses. This adds support for concatenating the results from two more index lookups against a subordinate table in order to find the rows matching a join condition structured as indexed_col = ... OR different_indexed_col = ....
  • 470: More accurate validation of GROUP BY expressions This pr resolves many ErrValidationGroupBy arising from SQLLogicTests
  • 469: add ctx to WithFilters
  • 468: Parse empty bytes Fixes: https://github.com/dolthub/dolt/issues/1818
  • 467: Add FIRST_VALUE
  • 465: cleanup locks parsing
  • 464: sql/analyzer: finalize_unions: Fix bug where we avoided finalizing union query plans.
  • 461: json array contains single element, and conversion fixes fixes json_contains issue where checking a single element in an array fails, and conversion from json to string.
  • 459: Add transaction status flag to handler
  • 458: extract_json quotation fix uses fork of oliveagle/jsonpath to fix issues with quotation marks in json paths. This will need to be revisited to fix some mysql incompatibilities.
  • 457: Datetime fixes
  • 456: Fixed MEDIUMINT over the server not returning negative values Super simple fix. We should make some Script tests that work over the server, but we can do that at some later point.
  • 455: thread context through to function creation
  • 454: sql/analyzer/aliases.go: getTableAliases: Appropriately handle scope in recursive calls.
  • 453: Fix functionality for CLIENT_FOUND_ROWS
  • 450: Vinai/wire protocol updates
  • 449: Vinai/create table select This PR Support CREATE TABLE SELECT AS syntax as well an interface for copying tables.
    1. It does not support more sophisticated queries such as CREATE TABLE mytable(pk int) AS SELECT.... That is tables with their own schemas are not interpreted due to parsing limitations.
  • 448: initial comparison and like calcs based on collation Currently the LIKE operator always does a case sensitive match. This should be based on the collation. This puts initial support in for doing per collation comparison and like calculations. Currently the comparison changes are disabled as the codebase uses the compare function for more than just WHERE clause calculations which sometimes need to be case sensitive.
  • 447: sql/analyzer: Fix index search for certain expressions which were not using table aliases appropriately.
  • 445: Allow limits and offsets to use value args (? in prepared statements) This fixes #439
  • 442: Vinai/temporary tables

vitess

  • 86: Add transaction characteristic to begin transaction
  • 85: can use status w/o quotes for insert statement re: https://github.com/dolthub/dolt/issues/2195
  • 84: support for value and status keywords needed two features for mlflow:
    • column named value (alter table t modify value float(53) not null)
    • check named status (alter table a drop check status)
  • 83: Max/drop pk
  • 82: Max/status Status can be used as a constrain name and referenced from a constraint expression.
  • 81: Max/pk constraint
    sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (1105, "syntax error at position 205 near 'PRIMARY'")
    [SQL:
    CREATE TABLE experiments (
    experiment_id INTEGER NOT NULL AUTO_INCREMENT,
    name VARCHAR(256) NOT NULL,
    artifact_location VARCHAR(256),
    lifecycle_stage VARCHAR(32),
    CONSTRAINT experiment_pk PRIMARY KEY (experiment_id),
    CONSTRAINT experiments_lifecycle_stage CHECK (lifecycle_stage IN ('active', 'deleted')),
    UNIQUE (name)
    )
    
  • 80: Vinai/lock tables
  • 79: Add transaction flag
  • 78: Add the found rows connection flag to the protocol
  • 77: Vinai/create table select
  • 76: Disallow non integer values for limit and offset, allow value args

Closed Issues

  • 586: memory/provider.go doesn't use a pointer receiver causing the struct to be copied* 570: Add support for read-only transactions
  • 499: "ORDER BY" expressions behaviour compatible with MySQL?
  • 569: Outdated example
  • 531: implement auto increment ddl support
  • 518: Implement built-in STR_TO_DATE
  • 480: any performance benchmark for dolt?
  • 517: can someone pls provide the instructions on how to port rocksdb as storage backend?
  • 509: Bug where using parameter for limit in prepare statement
  • 477: Cannot convert JSON number to number
  • 478: Cannot transform IndexedTableAccess nodes
  • 172: Support for prepared statements
  • 474: JSON string comparison seems broken (change in behavior from v0.6.0 and v0.10.0)
  • 251: LastInsertId always returns 0
  • 173: Better error message on syntax errors
  • 443: Support Insert opeartion for sqlx.
  • 439: Error: Unsupported feature: LIMIT with non-integer literal

v0.10.0

2 years ago

This is a development release, including several new features and performance improvements.

Merged PRs

go-mysql-server

  • 445: Allow limits and offsets to use value args (? in prepared statements) This fixes #439
  • 441: Test fixes for savepoints
  • 440: /{.github,go}: bump min go version to 1.15
  • 437: /.github/workflows/format.yml: enable autoformatting
  • 435: /.github/workflows/bump-dependency.yaml: remove working dir, doesnt exist
  • 434: Rewrote transaction tests to be much more succinct, and added several more
  • 433: Fixed non-deterministic test query
  • 432: Repro test case for ErrFieldMissing bug
  • 431: Fixed foreign key errors in NTC test setup
  • 430: Fixed bug in field indexes related to pushdown of indexes in subqueries
  • 429: Added statement boundaries
  • 427: Initial percent_rank fn
    • percent_rank function implemented, which is basically the step function quantile of column-sorted rows within a partition.
    • moved helpers to window/window.go
    • created WindowExpression interface to facilitate helper function re-use (there are multiple ways of doing that, extra interface isn't super necessary but made sense to me at the time) todo:
    • bats with great expectation specific query
  • 426: added ErrIndexOutOfBounds test
  • 425: Bug fixes for date comparisons This fixes https://github.com/dolthub/dolt/issues/1572
  • 424: Transaction support This change:
    • Moves a bunch of transaction and other session management code out of Handler into Engine
    • Introduces a new set of tests around transactions
    • Fixes the error message for duplicate key violations
    • Removes AsyncNode and related code
    • Eliminates duplicate query parsing
  • 423: Vinai/distinct expressions This pr does the following
    1. Fix incorrect behavior with AVG
    2. Enable the use of DISTINCT within aggregation eg. SUM(DISTINCT )
    3. Enables the use of DISTINCT on aggregation that is grouped
  • 422: Fix for hanging joins when the secondary table is empty using an in-memory strategy This fixes #222
  • 421: fix bug in join search
  • 420: Update sqlogic test harness and bump sqllogic dependency This pr enables users of gms to run and parse the sqllogic harness against all of the sqlogictests (with filtering). It also bump the sqllogic dependency
  • 419: [WIP]: LastIncrementId and name resolution collision fix
  • 418: Add ISNULL(expr) and compatible with Navicat Premium When I use Navicat Premium 15.0.28 to design tables. Get error: 1105 - function: 'isnull, maybe you mean ifnull?' not found After I implement ISNULL(expr). Get error: 1105 - column "PARTITION_DESCRIPTION" could not be found in any table in scope This RP is fixed this problem.
  • 417: set autocommit status flag
  • 416: ReleaseSavepoint fix
  • 415: Rollback and savepoint support
  • 414: Vinai/show create table check constraints This pr allow for the printing of check constraints during "SHOW CREATE TABLE"
  • 410: Commit transactions without beginning them, to support commit without a selected database
  • 409: Add the partitions table Adds the empty partition table
  • 404: sql/analyzer: Push filters under SubqueryAliases which they apply to. This allows optimizations to be applied to the filter clauses within the SubqueryAlias node, including pushdown and index lookup.
  • 403: sql/analyzer: Split analysis of subqueries so that once-after rules are applied uniformly. This makes is so that rules through default-rules get applied as part of analyzing the subquery. Later, early in the once-after phase, union and subquery queries get their own once-after processing. This allows us to keep the node tree in a state where we can apply transformations and optimizations across Opaque node boundaries, and come back for further processing later.
  • 402: Added _binary support & REGEXP_LIKE Removed REGEXP_MATCHES as it does not exist in MySQL. It is a PostgreSQL function. 5.7 documentation: https://dev.mysql.com/doc/search/?d=12&p=1&q=regexp_matches 8.0 documentation: https://dev.mysql.com/doc/search/?d=201&p=1&q=regexp_matches PostgreSQL: https://www.postgresql.org/docs/9.6/functions-matching.html It was added before we forked the project, so I removed it. Not sure why it was ever added to begin with, as no MySQL client will ever expect it nor know how to interact with the results.
  • 401: Vinai/json contains Adds the json_contains function
  • 400: Support for transactions. Start transaction and Commit implemented so far, as well as @@autocommit handling Needs tests, which are harder to write than standard engine tests
  • 398: Fixed view test script
  • 397: Changed default handling & delay fk table resolution
  • 396: /server: Unwrap netutil.ConnWithTimeouts in pollForClosedConnection
  • 395: Refactor nil check handling nil responses won't throw check constraint errors anymore
  • 394: Fixed bug that only allowed some select statements as view definitions
  • 392: Fixed REPLACE logic to now match MySQL Previously we thought that REPLACE was a DELETE then INSERT, but this is not the actual order that MySQL takes. According to the MySQL documentation (https://dev.mysql.com/doc/refman/8.0/en/replace.html):
    MySQL uses the following algorithm for REPLACE (and LOAD DATA ... REPLACE):
    Try to insert the new row into the table
    While the insertion fails because a duplicate-key error occurs for a primary key or unique index:
    Delete from the table the conflicting row that has the duplicate key value
    Try again to insert the new row into the table
    
    Special emphasis on the While, as you have to keep trying until you either get a different error, or it succeeds. So this has now been duplicated.
  • 391: Install a format checker script and workflow
  • 390: Adds the key column usage table https://dev.mysql.com/doc/refman/8.0/en/information-schema-key-column-usage-table.html
  • 389: Vinai/constraints table Created new pr due to past problems
  • 388: Added savepoint no-ops
  • 387: server/handler.go: Use exposed mysql.Conn.Conn instead of trying to track it through Accept.
  • 385: fix deadlock with exchange node go routines This fixes deadlocks in exchange node go routines which can happen when the exchange node is closed before all the data is read as occurs with a query that includes a limit clause. This also can occur if the context is canceled. These deadlocked go routines will retain references and prevent garbage collection.
  • 382: Fixed system variables
  • 381: Vinai/insert ignore into This PR adds support for INSERT IGNORE INTO. It is currently missing functionality for ignoring typer errors. After scoping the type errors component of this it looked to a lot of work to capture all of them with the correct MySQL notation I also noticed a lack of partition support in MySQL terms as well so I ignored that.
  • 380: add existing row to unique constraint failure
  • 379: sql/plan/if_else.go: Handle conditional expressions evaluating to null as false.
  • 378: sql/{plan,analyzer}: Add hash lookup functionality for equality condition joins on already cached results.
  • 377: sql/plan/join.go: Improve correctness and testing of right joins with scope rows available.
  • 376: Bug fix: check constraints were being marked invalid for tables with upper case letters
  • 375: Missing table name for error
  • 374: Added Means To Make This Work on Android This change has the netstat ability of the MySQL server assume that if it can't access /proc/sys/kernel/osrelease, then it'll be unlikely to be able to access any other /proc files such as /proc/net/tcp and /proc/net/tcp6. For a more specific check for Android, one can check if the getprop command exists in the PATH environment as getprop is an Android specific command to check the build properties for the system.
  • 373: Added new file full of session variables, plus new types I'm sure there are mistakes in here. This was like 85% manually done, and I had lots of mental TODOs while working through it, so I very well may have forgotten to edit a variable, add a note, or change the type. Either way, the majority of variables are here. I did exclude some as I couldn't find any GLOBAL/SESSION or Dynamic information for them, but this is like 98% of the variables. Now to hook them up and replace our current variable handling.
  • 372: Fixed incorrect TestModifyColumn tests Altering the type and such shouldn't change the index properties, but our tests were enforcing the removal of primary keys, which is incorrect. This has been fixed.
  • 371: Added ALTER COLUMN DEFAULT
  • 370: sql/analyzer/life_ctes.go: Add an analyzer rule to lift CTEs so they are visible across unions and distinct nodes.
  • 369: sql/expression/case.go: Add DebugString.
  • 368: Improvements and corrections for check constraints Biggest changes:
    1. Better validation
    2. Checks in CREATE TABLE statements work as expected now (poor validation before)
    3. ALTER TABLE DROP CONSTRAINT works as expected (doesn't assume a foreign key)
    4. Unnamed checks are expected to be named by integrators now
  • 367: Support multiple statements per ALTER
  • 366: Vinai/group concat This PR adds support for the Group_Concat Aggregation Function
  • 365: Fix SELECT INTO ... bug for AUTO_INCREMENT columns
  • 364: Driver improvements for Dolt It turns out Dolt needs to have control over how sql.Sessions are created, and it needs to modify the *sql.Context prior to query execution. This MR adds two interfaces:
    • driver.SessionBuilder
    • driver.ContextBuilder When a driver is created, with driver.New, if the provider implements either of these interfaces, then the provider's implementation will be used for creating sessions/contexts. Otherwise, a default implementation is used. The Dolt provider can then implement those two interfaces and do the necessary work to setup the session/context:
    • New SQL session
    • Create a dolt session (wrapping a sql session)
    • For each Dolt database in the SQL catalog:
    • Call doltSession.AddDB
    • New SQL context
    • Create a sql context
    • For each Dolt database in the SQL catalog:
    • Get the working root of the corresponding Dolt env
    • Call doltDatabase.SetRoot
    • Call sqle.RegisterSchemaFragments Prior to adding SessionBuilder, attempting to execute a query would panic, when Dolt attempts to coerce the session into a Dolt session. Prior to adding ContextBuilder, some features would not work - for example, queries had no access to uncommitted changes. For reference, this is the Dolt driver implementation I'm working on.
  • 363: sql/expression/case.go: Type a CASE expression by considering all its branches. Implements a lot of the typing behavior described here: https://dev.mysql.com/doc/refman/8.0/en/flow-control-functions.html#operator_case
  • 362: Give correct error code for duplicate database. Return a Vitess error with code ERDbCreateExists(1007) when trying to create a database that already exists
  • 360: Brought sql.PushdownTable back to memory.Table And made its implementation not reduce its schema (same as dolt). sql.FilteredTable has significant issues, so that one is still disabled by default.
  • 359: Added IsGenerated to sql.Index
  • 358: sql/analyzer/indexes.go: Avoid N^2 behavior in index merge for large indexed InTuple expressions.
  • 356: Implement a stdlib SQL driver This PR implements a basic database/sql/driver.Driver. With this driver, sqle.Engines can be queried via database/sql. Also closes #361
  • 354: Fixed procedure params not being used in INSERT/REPLACE values Fixes https://github.com/dolthub/dolt/issues/1496

vitess

  • 76: Disallow non integer values for limit and offset, allow value args
  • 74: add parsing for create temporary table
  • 73: go/vt/sqlparser: Follow MySQL in making ORDER BY/LIMIT on left hand of UNION a syntax error.
  • 72: Added savepoint and friends
  • 71: go/mysql/conn.go: Expose underlying net.Conn of the mysql.Conn.
  • 70: Changed SET syntax
  • 69: Added ALTER COLUMN DEFAULT
  • 68: Support multiple statements per ALTER
  • 67: fix separator parser for Group_Concat

Closed Issues

  • 439: Error: Unsupported feature: LIMIT with non-integer literal
  • 361: memory database with JSON column cannot be updated

v0.9.0

3 years ago

This is a development release. It contains many features and performance improvements added since the last release.

Merged PRs

  • 353: Column aliases for subqueries
  • 342: Added partial SIGNAL and DECLARE CONDITION support
  • 341: JSON_OBJECTAGG This pr adds JSON_OBJECTAGG functionality: https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_json-objectagg
  • 340: Vinai/UUID This pr adds UUID support cc: https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html#function_is-uuid
  • 339: Wrap all select expressions in aliases with their original string expression This makes the result set schema exactly match the select expressions in the query.
  • 338: Vinai/dbeaver fixes This pr allows for queries like CREATE TABLE x.table(pk int) when the mysql client is not set to x.
  • 337: Vinai/more table status fixes This pr fixes some mistakes in show table status where
    1. memory/table.go did not implement StatisticsTable
    2. ShowTableStatus is a part of Engine InformationSchema Tests
  • 335: Updates to SHOW TABLE STATUS
  • 334: Fixed procedure parameters missing in subqueries
  • 333: SHOW CHARSET & SHOW ENGINE First step in getting some sql engines
  • 332: JSON Values This change moves the engine towards representing JSON values as Go values rather than strings. I'm strongly considering a
    type JSONValue interface{}
    
    There seems to be no precedent for this
  • 331: sql/{plan,analyzer}: {join,indexed_join}: Update join logic to work within subqueries when query scope is non-empty.
  • 330: Support for WITH clauses (common table expressions)
  • 329: sql/analyzer: join_search: Update indexed join search to respect structural requirements on left and right joins. Only commute join nodes when they are actually safe to commute.
  • 328: Vinai/load data quick fixes Add quick fixes from testing load data on the Dolt side.
  • 327: Add functionality and tests for JSON_ARRAGG. This pr does not include window function capabilities
  • 326: Added function stubs for unimplemented JSON functions 31 unimplemented JSON functions, including two aggregation functions JSON_ARRAYAGG and JSON_OBJECTAGG.
  • 325: sql/analyzer/indexed_joins.go: Use partial indexes for indexed joins when a full index isn't available.
  • 324: sql/analyzer/filters.go: Never push a filter expression with a subquery down.
  • 323: sql/analyzer/prune_columns.go: Fix scope parameter in fixRemainingFieldsIndexes when fixing Child of a subquery alias.
  • 322: sql/{plan,analyzer}: Cache subquery results when joining against a subquery.
  • 321: Bug fix for parallelization We have been parallelizing Filter and Project nodes, but this is a problem for such nodes that contain a Subquery expression, since the query plan for that subquery may not tolerate parallelization. This fixes that bug and adds tests.
  • 320: Added proper PROCEDURE nested SELECT behavior + tests
  • 319: sql/analyzer: Avoid pruning columns of nodes under an IndexedJoin, since the IndexedJoin expression itself is inscrutable.
  • 318: sql/analyzer/pushdown.go: Push down appropriate filter predicates to sit right on top of a SubqueryAlias when appropriate.
  • 317: Max/check constraint check constraints in memory engine depends on https://github.com/dolthub/vitess/pull/53 TODOs maybe:
    • in mysql, an ALTER TABLE ADD CHECK fails if any of the existing rows fail the check. This is what the current implementation does, I'm not sure if toggling that off should be supported.
    • when an INSERT row that fails a constraint, mysql errors and does not write any of the values. The current implementation defaults to INSERT IGNORE's behavior, where warnings are issues for failed checks but good rows are still included. TODOs in future:
    • DropColumn, RenameColumn, ModifyColumn should error if touching a constraint-protected columns
  • 316: Vinai/load data - Part 1 very basic functionality review This PR introduces basic functionality for LOAD DATA.
  • 315: Added SHOW & DROP PROCEDURE, along with basic IF/ELSE support
  • 315: Added SHOW & DROP PROCEDURE, along with basic IF/ELSE support
  • 314: sql/analyzer/prune_columns.go: Turn off pruneColumns when a Subquery expression exists.
  • 312: Added INOUT/OUT params to procedures & nested procedures Stored procedures now work with INOUT/OUT directions for their parameters. Not only is this critical for nested CALL statements to work properly, but additional changes were made to handle nested CALLs. Stored procedures are now loaded before analyzing the query body.
  • 311: sql/analyzer/resolve_subqueries.go: Make subqueries which include subqueryaliases cacheable.
  • 310: sql/plan/subquery.go: Make certain that analyzed nodes below a subquery that includes a subquery alias node see the row results they are expecting.
  • 309: Max/float53 Follow specific rules for mysql float/double/error depending on the float ops.
  • 308: Window functions This is a full implementation of window functions, with only the ROW_NUMBER() function supported. Partitions and order-by work for the OVER() clause, but other constructs (PRECEDING, FOLLOWING, etc.) are not supported. Other limitations:
    • Can't use window functions with GROUP BY
    • Can use non-window aggregates with window functions, but only if they are declared with an empty OVER clause
  • 307: Bump vitess
  • 306: Roughest implementation of stored procedures No need to go into detail regarding what doesn't work (a lot), but it's groundwork to iterate on.
  • 305: sql/analyzer: resolve_subqueries.go: Add a missing stripQueryProcess in resolveSubqueries.
  • 304: pass the context into Close calls
  • 303: sql/analyzer: Make join_search faster This helps the analyzer actually complete analyzing some of the example queries we're working on that have 9+ table joins. The basic idea is to recursively build every binary tree that has the in-order traversal we want and then attempt to apply join conditions to those trees. Performance here can be further improved by coupling visitJoinSearchNodes and assignConditions so that we can prune large portions of the subspace as being impossible from a join conditions standpoint. I may work on that next depending upon how further benchmarking goes. Currently a previous query which failed to analyze before take 30s.
  • 301: Naive/hacky show grants hard-coded SHOW GRANTS handling:
    > dolt sql -q "show grants for current_user"
    +-------------------------------------------------------------+
    | Grants for root@%                                            |
    +-------------------------------------------------------------+
    | GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION |
    +-------------------------------------------------------------+
    
  • 300: Added Stored Procedure interface for integrators
  • 299: sql/{plan,analyzer}: Add IndexedInSubqueryFilter for selecting the subquery results first and then making indexed lookups into the child.
  • 298: Vinai/create database Add functionality for CREATE DATABASE
  • 297: Max/sqlerror codes Append error codes/sql state to error messages for downstream clients.
  • 296: Fixed BEGIN/END blocks with embedded SET statements BEGIN/END blocks did not return their results, and also did not build off of previous statements within the block. In addition, they were panicking by carrying a nil context that was assumed to be non-nil elsewhere, so this fixes those issues.
  • 295: Changed analysis to isolate the values side of an INSERT statement Also cleaned up create trigger analysis, which broke when I did this at first. Now catches more errors than before.
  • 294: Fixed a bug in join planning for Inserts. Table reordering was leaving nodes above the join with incorrect field indexes. This was getting fixed by other analyzer steps for some top-level nodes, but not Inserts.
  • 293: Implement NullSafeEquals: The <=> operator in MySQL.
  • 292: Make join planning work for insert statements
  • 291: Consider SubqueryAlias nodes when planning indexed joins.
  • 290: pushdown to indexed tables
  • 288: remove slow span tag
  • 287: Update README.md to reference Dolt
  • 286: Fixed several bugs preventing indexes from being used in some joins
  • 285: Implemented JOIN_ORDER optimizer hints Also:
    • Got rid of expensive comment stripping pass in the parser
    • Fixed test behavior of MySQL executed comment statements like /*!40101 SET NAMES utf8 */
    • Made SHOW VARIABLES output sorted
  • 284: Updated copyright headers and added missing ones
  • 283: Fixed type bugs
  • 282: Bug fix for pushing a projection down to a table in a subquery more than once
  • 66: Support for subquery / values column aliases
  • 65: go/vt/sqlparser/ast.go: SplitStatementToPieces: Avoid appending an empty "query" when splitting an incoming ComQuery.
  • 64: Strip quotes and backticks from select expressions
  • 63: VALUES statements
  • 62: Added SQL_CALC_FOUND_ROWS keyword
  • 61: Added SIGNAL companion statements
  • 60: add better parsing for show table status
  • 59: Add vitess support for show charset
  • 58: Add json aggregate functions to ast.go
  • 57: Implemented common table expressions (WITH) Also removed a bunch of unused vitess-only constructs from the grammar.
  • 56: Capture the verbatim expression for select statements This is a bit hacky and currently breaks on embedded comments. But in general this lets us faithfully reproduce the verbatim select expression in the return schema, which is required for compatibility with some clients. Also makes expressions such as MAX(a as b) illegal, allowed before.
  • 55: Small parser fixes for stored procedures
  • 54: Vinai/load data basic network handling. Basic steps for packet management. Have text with files up to 1gb. Definitely some more work to be done here in the future. Is it optimal to write everything to a file or can we do something better? Regardless, I think this is a good enough start for Max to get unblocked while I continue to build more functionality.
  • 53: Add check constraint support Parser changes to handle CHECK statements.
  • 52: Allow reserved words as column names for CREATE TABLE statements Needs tests
  • 51: Vinai/load data p1
  • 50: Removed CODE keyword
  • 49: Max/float53 adds support and tests for FLOAT(prec), which will help with pandas table creation.
  • 48: Add the constants Updates our vitess with a bunch of constants
  • 47: add support for if exists and if not exists for create database
  • 46: Added CREATE PROCEDURE & FUNCTION This adds:
    CREATE PROCEDURE
    SHOW PROCEDURE STATUS
    SHOW FUNCTION STATUS
    DROP PROCEDURE
    CALL
    
    The SHOW...CODE statements are being skipped for now, as they're relatively unused compared to the above statements. Additionally, the CREATE statements do not have a fully fleshed-out routine body, as we currently do not parse all valid statements anyway.
  • 45: Zachmu/window funcs

Closed Issues

  • 346: Start/Stop not propagating errors?
  • 336: will porting to lmdb / boltdb backend be on the roadmap?