Releases: dolthub/doltgresql
Releases · dolthub/doltgresql
0.50.1
Merged PRs
doltgresql
- 1439: Added WHEN support for triggers
This adds support forWHEN
on triggers, which is probably the last major trigger addition that we'll need for now. - 1437: Fixes for prepared statements, removed custom literal type
Removes doltgres's custom Literal type, uses the GMS version everywhere. This fixes various incompatibilities in GMS where anexpression.Literal
is expected.
This is an alternate approach to the first attempt here:
#1406 - 1436: Added dropping triggers when dropping a table
- 1433: Add skipped test for erroring prepared query with offset
- 1432: Add support for
UPDATE ... RETURNING
Adds support for basic usage ofUPDATE
with aRETURNING
clause.
Limitations:- Does not support
*
as an expression yet – an additional analyzer change is needed to expand*
into column names.
Fixes: #1421
Depends on: dolthub/go-mysql-server#2955
- Does not support
- 1426: Added support for triggers
This adds partial support for triggers. This should cover a decent chunk of the functionality that will be expected. Notably, this is still missing:- FOR EACH STATEMENT
- TRUNCATE
- INSTEAD OF timing
- Deferring
- Specific column triggers for UPDATE
- CONSTRAINT TRIGGERS
- Referenced tables (seemingly used for the internal foreign key implementation?)
- Transition tables
- String arguments
- The rest of the variables available inside a trigger interpreted function
- 1417: Unskipping tests
- 1411: Fixed interpretation calls within DML
This implements the changes necessitated by the following fix:- dolthub/go-mysql-server#2949
We had a bug where calls to any DML statements that included an interpreted function would remove the DML's ability to actually affect the data. The GMS PR implements the core fix, and this PR implements the companion changes.
- dolthub/go-mysql-server#2949
- 1408: Bug fix for dolt_ tables with incompatible types
Fixes #1405
This works by placing a typecast on unconverted dolt_ table fields so that they work in any expression that requires a doltgresType. - 1403: Add support for
SET DEFAULT
foreign key referential action
Fixes: #798
Depends on: dolthub/go-mysql-server#2944
Depends on: dolthub/dolt#9121 - 1401: typo in README
- 1400: Updated readme for beta
- 1399: Add auto gc behavior interface to avoid breakage
- 1392: Add skipped tests for insert...returning bugs, fix referenced schema in column name error
Fixes #1394
Closed Issues
- 1421:
UPDATE...RETURNING
not yet supported - 759:
TSVECTOR
support - 797: Allow
TEXT
columns in keys (without prefix length) - 32: Event errors in log
- 1063: Weird behavior with
WHERE
clause - 1043: using column in function when creating view panics
- 1402: Unable to create FK on
TEXT
column to a non-pkTEXT
column - 1405: Limit on dolt_branches table returns
plan is not resolved because of node '*plan.Limit'
error - 1410:
undefined: reservedKeywords
error during Android cross-compilation on Termux - 798: Support for
ON UPDATE/DELETE SET DEFAULT
- 1142: Panic on converting regclass to string
- 1394:
INSERT
withRETURNING
doesn't work with referenced schema in column name
0.50.0
Merged PRs
doltgresql
- 1395: Slight README tweak
- 1390: support for array subscript
Only supports one-dimension subscripts and no slices - 1385: Support for ArrayFlatten and string_agg functions
Also added stubs for a couple functions used by various psql commands - 1384: Add support for
ALTER TABLE ... DROP CONSTRAINT IF EXISTS
Depends on: dolthub/go-mysql-server#2936
Depends on: dolthub/vitess#411 - 1383: Add support for
default_with_oids
Postgres docs
A few sample Postgres dumps setdefault_with_oids
. This change allows them to set the parameter without triggering an error. Note that Doltgres does not support creating tables with OID columns, even if this parameter is set to true. - 1381: Add support for
ANALYZE;
without any tables specified
When Postgres processes anANALYZE;
statement without any tables explicitly specified, it analyzes all tables.
Postgres docs - 1378: Remove implicit prefix length now that we support adaptive inlining
Removes the Doltgres custom analyzer rule that added an implicit prefix length toTEXT
columns when they were used in a key. - 1375: Compatibility with psql commands
This PR adds a couple compatibility features for commands issued by psql:- Support for the
operator(...)
syntax for built-in postgres operators - Support for collation expressions, currently ignored
These two things get us to near 100% coverage for psql commands without special casing. The last piece is thearray(select ...)
syntax.
Relies on dolthub/go-mysql-server#2931
- Support for the
- 1373: Add skipped tests for bugs hit from testing js frameworks, fix
current_setting
For #1366 - 1370:
CREATE TABLE
formatter support
This letsdolt_merge
correctly handle tables with column default values, constraints, etc. As part of the merge, Dolt generates and then parses theCREATE TABLE
statement for the table being merged. - 1367: Upgrade pganalyze/pg_query_go to v6.1.0
v6.1.0 includes a fix for building on MacOS 15.4 - 1363: Fixed index performance regression
I've left a fairly detailed comment for the future, but it doesn't quite explain the exact issue here. It's more so to prevent making a change that would lead to the issue again.
In a nutshell, we were always adding boolean literal expressions in ourstart
andstop
expressions, which define the start and stop positions for the underlying tuple iterator. With the Dolt change to fix a case of incorrect results, we were met with even worse results in some circumstances. With the original logic, these literals were harmless to include in multi-expression ranges, but they fundamentally changed the behavior of the stop position with the new logic. They're required to be there though if there are no other expressions, hence it made sense to just always include them. The behavioral change isn't obvious at first glance, hence the need for the long comment (which should make it appear relatively obvious after reading).
This also makes use ofQuickFunction
where possible, which should always be true for tuple-level filtering, and should provide a small speedup in those cases. - 1349: turn off stats by default for doltgres launch
- 1347: Bug fix for multi-column indexes
Fixes #1331
Also fixes an encoding bug: limited length varchar columns were always being encoded out of band.
Tests for the changes in dolthub/dolt#9061
Also fixes a bug in parsing --prof args - 1344: Changing how a constraint addition is structured, to match what Dolt/GMS does
We were previously modeling an inline constraint definition as a separate DDL command. This changes it to be consistent with how GMS and Dolt works, by using a single DDL command, and setting the constraint action. - 1336: Infer types when clients specify a bind argument with OID zero
When specifying parameters for a prepared query, callers can specify OID zero to instruct the server to infer the type. Doltgres was error'ing out in this case, because it couldn't find a valid OID registered for zero. This changes Doltgres to infer types when the specified parameter OIDs contains a zero.
Found while testing a basic Rails app with Doltgres. - 1333: More lenient handling of unsupported options in CREATE INDEX
- 1332: Account for new server config interfaces. NoOp
- 1329:
GENERATED BY DEFAULT AS IDENTITY
inCREATE TABLE
statement
Fixes #1328 - 1326: Initial support for advisory lock functions
Adds support for three Postgres advisory lock functions:pg_try_advisory_lock()
pg_advisory_lock()
pg_advisory_unlock()
A couple TODOs call out follow-ups to makeLockSubsystem
work better with Postgres' behavior, such as supporting reentrant locking.
Fixes: #1262
- 1325: Bug fix: parsing iso8601 date strings
Fixes #1323 - 1319: New tests and removed errors for various
ALTER .. OWNER
statements, which are no-ops - 1313: Add support for adaptive inline storage
- 1312: Relaxed collation restrictions (reduced to warnings) in CREATE DATABASE
Also improved the error message for certain type errors. - 1299: Allow
ALTER TABLE ADD COLUMN
to specify an inline FK constraint
The regressions listed below are caused by us now honoring the inline check constraint definition, instead of ignoring them. GMS doesn't update the scope with the new column, so check constraints that use the column at the same time as adding it don't work properly. MySQL also supports this behavior, but we don't support it in GMS yet, so the fix for these regressions will be in GMS. - 1298: Fix spelling
- 1295: Support for
INSERT .. RETURNING
- 1294: Add tests for
ALTER COLUMN
to assert that column default expressions are resolved
Altering a column with an existing column default expression was triggering a panic in Doltgres, because Doltgres'TypeSanitizer
was finding anUnresolvedColumnDefault
instance in theplan.ModifyColumn
instances'scolumn
field.
This is not an issue from Dolt or GMS, because they don't support MySQL's syntax to alter a single component of an existing column, without requiring its full column definition to be respecified. (And also because they don't use Doltgres'TypeSanitizer
.)
Depends on dolthub/dolt#8994
Depends on dolthub/go-mysql-server#2895 - 1291: Log stack traces when panics are caught
- 1289: Support
ENCODING
inCREATE DATABASE
Fixes #1261 - 1288: Unskip node test for
INSERT INTO ... ON CONFLICT
- 1285: Avoid name collisions for generated FK names
Matches Postgres' behavior where default foreign key name collisions are resolved by adding an integer suffix to the name to make it unique.
Also includes a bug fix for setting the target schema when dropping a primary key.
Fixes a couple more issues with supporting DoltHub's schema in Doltgres. - 1277: Allow different but compatible types in foreign key constraints
Relies on dolthub/go-mysql-server#2888 - 1267: testing(sql): fix typo in code comment
- 1265: Root Object Rework
This reworks root objects so that they actually work, as they previously did not (outside of the session cache).
Closed Issues
0.18.0
Merged PRs
doltgresql
- 1270: Bug fixes for primary and foreign key naming
Addresses several issues around primary key and foreign key naming:- ability to drop a primary key using its default postgres name
- declaring a foreign key reference inline in a column definition
- default foreign key names now match postgres
- fix for
pg_constaints
incorrectly listing non-unique and non-pk indexes
Note that the regressions listed are all related to now honoring foreign key references inline in a column definition. Before, these statements were executing, but the FK reference was ignored. Now that we honor the FK reference, several tests broke for the following reasons: DROP TABLE
doesn't automatically sort multiple tables by FK dependencies- A required index didn't exist or wasn't automatically created
- FKs aren't currently supported for temp tables
- A new FK references a generated column, which we don't support yet, so FK checks failed on insert
- 1255: Support for
RAISE
in PL/pgSQL
Adds initial support forRAISE
statements in PL/pgSQL functions. There are still a few edge case TODOs (e.g. using theclient_min_messages
config param to determine what level of notices to send to clients), and this initial pass does not include any exception handling.
Notice messages are queued in the current session, then sent to the client from the connection handler, right before results are sent to the client. Support for setting notices in the DoltSession is added in dolthub/dolt#8974.
PostgreSQL Docs - 1244: Support for text keys in ALTER TABLE statements
Stacked on top of #1243, relies on dolthub/go-mysql-server#2871 - 1243: Implemented a couple jsonb functions
- 1239: Fixed bug with generated values not being properly quoted
This wasn't due to a bug in GMS, but rather a bug in our CreateTable wrapper node. This wasn't caught earlier because column default values in postgres can't contain column references, only generated columns can.
Fixing this bug exposed others, namely when using functions in check constraints. - 1233: Bug fix for generated columns when creating a primary key
This PR implements the parser changes in dolthub/go-mysql-server#2861 and adds tests.
There are still bugs around quoting in generated columns that need to be fixed in GMS, which will come in a follow-up PR. - 1230: go.mod: Bump go version to 1.24.0.
- 1228: Add support for
CASE ... WHEN
in PL/pgSQL - 1226: Unskip a dataloader BATS test now that a unique index bug was fixed
- 1224: Allow primary keys to contain address columns sorted by their resolved values, anf add always-disabled AutoGCConfig to get doltgresql compiling
This is a merge of #1219 and #1214
Due to concurrent changes in Dolt, these PRs need to be combined in order to get a clean CI. - 1222: Initial support for
DROP FUNCTION
Adds initial support forDROP FUNCTION
. (PostgreSQL Docs)
Two of the main features not supported yet are: cascading deletes of function dependencies, and restricting deletes when function dependencies are detected. The resolution of a type from its name also needs to fleshed out more to support types outside of thepg_catalog
schema. - 1221: json_build_array and json_build_object functions
- 1219: servercfg: Add always-disabled AutoGCConfig to get doltgresql compiling.
Goes with dolthub/dolt#8849, which adds a config stanza like:for now, this just gets doltgresql compiling and always disables auto_gc.behavior: auto_gc_behavior: enable: true
- 1214: Allow primary keys to contain address columns sorted by their resolved values.
This is the Doltgres part of this change.
GMS PR: dolthub/go-mysql-server#2854
Dolt PR: dolthub/dolt#8870
The goal of the change is to allow for indexes to use an out-of-line variable-length type (like TEXT or BLOB) as a primary key while still storing just the address in the index (instead of being forced to store a prefix of the value).
As a result of this change, any tuple comparison operation may need to resolve a hash in the NodeStore. This poses two complications:- The tuple logic exists at a much lower level than the node store and can't depend on it without creating a dependency cycle. We get around this with a new
ValueStore
interface that can store and retrieve variable-length bytestrings by their content hash.NodeStore
is the only implementation of this interface, but decoupling the interface from the implementation allows us to not depend onNodeStore
's internals when passing it to lower-level code. - Tuple comparison operations can now end up doing disk IO, which means they need a context parameter.
- The tuple logic exists at a much lower level than the node store and can't depend on it without creating a dependency cycle. We get around this with a new
- 1213: Changed created functions to persist on the root
This changes created functions such that they're now written to the root value, instead of being added to the global function list. This also supports overloading created functions.
Closed Issues
0.17.1
Merged PRs
doltgresql
- 1206: Added loop structures and label support
This adds the rest of the "non-FOR" loops, along with loop control flow and labels. I also noticed that we weren't usingOperationSizeForStatements
, which will properly calculate offsets for theGoto
operations, so I fixed that. Just so happened that our tests weren't running into the issue. - 1200: Fix backup restore auth for super user
Dolt PR: dolthub/dolt#8860 - 1199:
NULL
support in PL/pgSQL
We get support forNULL
statements frompg_query_go
since it automatically filters them out. This change adds a test of their usage. - 1197:
WHILE
statements in PL/pgSQL
Adds basic support forWHILE
statements in PL/pgSQL. No support for labels yet. - 1196: Fixed CREATE FUNCTION not executing some statements
Simple bug, but was difficult to spot. Some statements work without needing to advance the returnedRowIter
, while others require advancing it. I changed it so that we're always advancing the iterator. I also unskipped the skipped tests, and removed the temporary one since the original now works. - 1193: Added SELECT ... INTO and PERFORM, plus bugfixes
Hoped to get a few more statements in, but there's an issue where some statements that are ran from the interpreter are seemingly being discarded. It was a roadblock even for these two, hence the skipped tests. That's the next thing I'mma look into, as it's a pretty big issue (especially since there's no error, just no effect which is even worse). - 1171: Bug fixes for using various types in keys
This PR allows various types to be used in keys that were not possible before. This comes down to two things:- Swap out the validateCreateTable analyzer rule
- Change the determination for the max width of a type to be more accurate, which influences whether we choose standard extended encoding or extended address encoding
- Alter the way we determine the encoding type for extended columns in keys to more closely match the non-key case (dolthub/dolt#8817)
This PR also has a couple small regressions in tests. I'm punting on these because we're about to completely overhaul how we store these types (to implement toast semantics).
Closed Issues
0.17.0
Merged PRs
doltgresql
- 1194: Fix SSP linker errors for Windows build
Pulling in thepg_query_go
library added a CGO dependency, and the Windows build requires the stack smash protection library to be linked in. Unix builds do not, because it's built into Clang. - 1183: Bug fix: Function variable reference substitution
In function bodies, when replacing variable names with variable reference IDs, we were replacing any text matching the variable name, which wasn't always correct. This new approach tokenizes the expression and replaces only the tokens that exactly match a known variable name. There is still at least one more edge case we can fix in a follow up. - 1177: Can now call created functions
This makes a simple change so that we're now able to call user-created functions. This is intended as a temporary measure, as we ultimately want functions to be tied to commits (similar to how sequences and types are currently handled). That also entails changing how function calls are altogether handled, so rather than doing the larger change now, this is a stop-gap so that we can continue making progress onCREATE FUNCTION
. - 1174: Parse CREATE FUNCTION into runnable functions
This implements parsing ofCREATE FUNCTION
into the same expected set of operations as the handcoded examples. This means that we are able to writeCREATE FUNCTION
statements that are runnable, and the interpreter is able to properly execute said functions.
At the moment, the function provider used in GMS does not allow for adding new functions, so the test is skipped. I've confirmed it does work though if we hack around the provider limitation. It's also worth noting that we have to rely on the newpg_analyze
package in order to handle PL/pgSQL. I attempted to add support within our parser, but the syntax conflicts with regular SQL syntax in ways that can't really be reconciled, so this was the only choice. - 1169: PL/pgSQL: Add support for the
ALIAS
statement
Adds support for the execution logic for theALIAS
statement in user defined functions. - 1158: Add an interpreter base for function creation
This adds the base of an interpreter, upon whichCREATE FUNCTION
andCREATE PROCEDURE
will convert their contents to. Only the interpreter portion is partially implemented, along with a temporary example function and accompanying test to ensure that it works.
The next major step is to add parsing support for all of the statements that we'll need, as they do not yet exist (hence why the temporary example function's operations were manually created, although the conversion should result in the same output). The last major step will be to convert from the PL/pgSQL code to the operations that our interpreter expects.
The original intention was to implement as much of this in GMS as possible, however for now, the bulk of it will exist in Doltgres as I couldn't quite reconcile the proper way to implement it there without diving more fully into MySQL'sCREATE FUNCTION
andCREATE PROCEDURE
support (rather than simply relying on memory). This is something that I'll revisit in a later PR, as I feel it'll be easier to do once I have a relatively complete implementation done in Doltgres.
Related PR: - 1157: Fixed several bugs related to column default expressions and generated columns
Fixes a parser bug that disallowed calling a function with no arguments.
Implements a missing form of the substring() function.
Diff includes #1154 - 1154: Env var to ignore all unsupported DDL operations / commands
- 1152: bug fix for column defaults with function values
Removed the GMS validateColumnDefaults rule in favor of our own, and also made it run on CreateTable statements (it wasn't before due to an oversight in a type assertion).
Also implemented the gen_random_uuid function. - 1145: use cockroach errors.Errorf for one-off errors
This PR changes all uses of fmt.Errorf() to use the equivalent cockroach library instead. This gives us stack traces for all errors constructed this way during testing and debugging. - 1143: Tests for various column default values
Bug fix for new tests in dolthub/go-mysql-server#2825 - 1120: Support for parsing VACUUM statements, as a no-op
- 1113: Implementing new methods from
servercfg.DoltgresConfig
Implements the newIsUserSpecified()
andSkipRootUserInitialization()
methods fromservercfg.DoltgresConfig
, added in dolthub/dolt#8690 - 1108: Wrap function expressions for generated columns in parens
- 1107: Created wrappers around Internal IDs for consistency and added an ID dispatch registry
Currently, anInternal
ID requires one to know the exact format for constructing an ID of a specific type. For example,Internal
table IDs have the following format:Not only would you need to know that this is the format, but when retrieving values, you'd have to make sure that you accessed index 0 for the schema, and index 1 for the table. This opens up a potential for hard-to-find bugs. Wrappers help with this. Internally, the wrappers will call index 0 or 1, but one now just calls[ Schema_Name, Table_Name ]
SchemaName()
orTableName()
. In addition, they don't need to know the format, callingNewInternalTable
gives you the parameters that you need.
Additionally, this adds a registry where schema elements may register callbacks to respond to ID changes. For example, rather than having a table column explicitly handle all locations that depend on the column, it instead broadcasts that the column has changed, and all locations that have registered for that broadcast will modify themselves. This helps with scaling, as Postgres is far more inter-dependent than MySQL/Dolt, and reduces the knowledge burden required by developers.
Currently it's only used by sequences in this PR, and that's primarily due to most actions being handed off to GMS and Doltgres having no record of them. For example, deleting a column is completely handled by GMS, but Doltgres needs to broadcast that the column was deleted. For now, the idea is to wrap all such nodes in a Doltgres node at the end of the analyzer step (inReplaceNode
), but I'm open to another idea since it essentially means we're making a wrapper for the majority of GMS nodes. That's a separate issue from this PR though. - 1103: Implemented a no-op node for statements that can be safely ignored
Used for OWNER ddl statements for now, and will extend to VACUUM next. - 1097: CliContext interface update. NoOp
Account for interface change in Dolt: dolthub/dolt#8708 - 1095: Better support for COPY FROM statements
This change makes it possible to load data into tables without the full set of columns specified. pg_dump will not include generated columns in its output.
Also fixes a bug for the load from file use case, which only supported CSV files before (now supports the same set of formats).
Closed Issues
0.16.0
Merged PRs
doltgresql
- 1086: Implement metrics,
describe
system table tests
GMS PR: dolthub/go-mysql-server#2800 - 1083: Go tests for the COPY command
These are all lifted from the bats tests. I'm gearing up to make major changes to how COPY works to support more customer schemas and want to these tests to help. - 1081: support enum type cast
- 1077: select from functions
Depends on: dolthub/go-mysql-server#2795 - 1076: Added Internal ID representation
This adds an internal ID that is used instead of OIDs. - 1069: Update CONTRIBUTING.md
The unicode char at the end of the request for stars wasn't rendering. replaced with a ⭐ - 1065: Removed ownership, added DROP privilege
This removes ownership and related information, so that now users must be granted appropriate privileges by either a superuser or another user with the appropriateWITH GRANT OPTION
permission. In addition, this adds a brand newDROP
privilege, so that there's now a way to allow non-superusers to delete tables. - 1064: Add skipped test for where clause bug, README fix
- 1055: Removed unused config params
- 1045: support create shell and enum types
This PR adds support forCREATE TYPE
forENUM
andSHELL
types. It adds only parsing support forCOMPOSITE
type, functionality support for it is coming after it. - 1044: Lots of bug fixes discovered in engine testing
Replaces #1015
Includes bug fixes for:- Certain limit/offset queries
- Parenthesized table expressions
- Table renames
- Better harness support
- 1042: .github: Some small workflow fixes
- 1040: Release v0.15.0
Created by the Release workflow to update DoltgreSQL's version - 1015: Fixed bug in certain limit .. offset queries
- 997: support explicit cast to domain type
Regressed tests are tables used as type for casting, which was not supported. The insert statement that makes use of it fails currently. It will be supported as an extension after upcoming CREATE TYPE composite type support. - 987: reapply DoltgresType changes with performance improvement
Regressed CREATE VIEW test is tracked here. - 969: Add support for
pg_get_serial_sequence(text,text)
Adds support for thepg_get_serial_sequence(text,text)
function, which returns the sequence owned by a column.
Example usage:create table t1 (id SERIAL PRIMARY KEY); SELECT pg_get_serial_sequence('t1', 'id');
Closed Issues
0.15.0
Merged PRs
doltgresql
- 1035: Tests and schema fixes for
dolt.status
,dolt.merge_status
anddolt_constraint_violations_*
- 1033: switch DoltgresType to be used as pointer
- 1029: Fix schemas for dolt system tables with boolean columns
Dolt PR: dolthub/dolt#8634 - 1014: Reworked DoltgresType function access
This reworks how functions are accessed withinDoltgresType
, in addition to adding a faster path for functions that fall under specific criteria. - 1004: Add tests for dolt_statistics
GMS: dolthub/go-mysql-server#2762
Dolt: dolthub/dolt#8589 - 1003: Add diff tests for dolt.docs
- 998: implement
to_char
for timestamp (mostly)
This PR adds support for most of the date format specifiers mentioned here: https://www.postgresql.org/docs/current/functions-formatting.html - 996: Support dolt.rebase, add tests
- 995: Tests for dolt_ignore per schema
Dolt PR: dolthub/dolt#8581 - 994: Tests and fixes for dolt_rebase and dolt_ignore
Dolt PR: https://github.com/dolthub/dolt/pull/8578/files - 988: Added a mini sysbench test that runs on PRs
This adds a new workflow that runs on every PR, similar to the regression tests. This runs a small version of the sysbench tests, primarily to detect large performance changes that a PR may unexpectedly introduce. For now, the variance is set to ±10%. That is, if it's under 10% in either direction, it'll just display as a white color. If it's greater, then it'll display as green or red respectively to indicate a possible performance regression. There's variability in the tests, that we'll want to account for, but perhaps the 10% window is too large. Or maybe we should run the tests for longer. - 986: Revert "Merge pull request #904 from dolthub/jennifer/type"
This reverts commit 40dba4f, reversing changes made to 165c30e.
Reverting this change because of performance regression. - 983: Major improvements to auth
This adds a myriad of tests, in addition to:- Schema-Wide Table Privileges
- Schema Privileges
- Database Privileges
- Role Memberships
There are also many smaller changes, such as disallowing non-superusers from modifying superusers, and many more.
- 981: support insert
DEFAULT VALUES
This is postgres special syntax that allows you to just insert all default values.
This is equivalent toinsert into <tbl> values ()
in MySQL. - 979: support
EXCEPT
set operation - 978: support
EXISTS
subquery
This PR adds support forEXISTS <subquery>
clause.
Additionally, we have to add a bunch of skips namely in the setup queries in thetesting/go/regression/results
directory; these queries encounter performance issues for joins overpg_catalog
tables discussed here: #940 - 977: update Regression test to display 50 tests each at most with total number of tests
- 970: catch more unsupported
partition of
queries
These were panicking before, but now we throw unsupported - 965: Fix
DEFAULT
insert forNULL
or unspecified column default values - 964: Add dolt_schema and dolt_procedure tests
- 963: TestUpdate and TestDelete
- 949: Release v0.14.1
Created by the Release workflow to update DoltgreSQL's version - 945: support
with
somewhat related: #928 - 904: create DoltgresType struct used for all types
This PR replaces currentDoltgresType
interface withDoltgresType
struct. All built-in types will have pre-defined values for this struct. User-defined types will populate the struct fields with appropriate values.
Depends on dolthub/go-mysql-server#2736
Closed Issues
0.14.1
Merged PRs
doltgresql
- 947: Fix parameter context for
statement_timeout
andrecovery_target_name
Thestatement_timeout
parameter had the wrong context configured, which prevented users from being able to change its value. I did a quick skim of Doltgres' parameters and compared them topg_catalog
.pg_settings
and found one other parameter context (recovery_target_name
) that didn't match.
Fixes: #943 - 942: Removed doltgres user and default database
This removes the defaultdoltgres
user, so that we're more in-line with a standard Postgres installation. In addition, this also removes the defaultdoltgres
database, and fully replaces it with apostgres
database. Postgres creates this database by default, so it's best that we mimic it.
In addition, Postgres uses the username as the database name if a database name is not given, and I'm sure many users simply use thepostgres
user without even thinking about what database they're connecting to, so this allows for that workflow to work as expected. - 941: throw unsupported error for
PARTITION OF
statements
CatchPARTITION OF
statements and return error instead of panicking. - 940: Add caching for
pg_catalog
tables
While investigating performance on some skipped tests forpg_catalog
tables, I found a few areas to optimize around how we deal with OIDs. The biggest source of latency I found was thatpg_catalog
tables must iterate through every object in a database (e.g. schemas, tables, indexes, types) to generate OIDs and create the rows for eachpg_catalog
table. When multiplepg_catalog
tables are joined together, this starts to consume a significant amount of time, with some queries triggering this database iteration process hundreds of thousands of times.
This change creates a new cache in the session object that stores the data forpg_catalog
tables so that it can be reused within the same query. The effect is that several queries that timed out before will now complete. Some of these queries are still slow (e.g. multiple seconds to execute) and can be further optimized. The biggest source of latency now seems to be from the join operations, since the data is currently not eligible for point lookups and has to be scanned repeatedly to stitch rows together.
Another area for future optimization is theregclass
/regtype
/regproc
IO_Output
andIO_Input
functions, which also trigger iterations over database objects to turn a relation name into an OID, and to turn an OID into a relation name.
Longer term, instead of relying on iterating database objects and caching OID information, we eventually need to store this information so it can be quickly loaded, and keep it in sync as database objects are created/modified/deleted, including changes made through merges, resets, and other database version control changes. - 939: Unskip many InsertInto engine tests
This adds several new features / bug fixes found during testing:- DROP INDEX support
- Support for ON CONFLICT UPDATE
- Panic during insert of some UNION statements
- Fixed case sensitivity bug in column names for INSERT statements
- 938: parse explain select and explain options
- 936: Release v0.14.0
Created by the Release workflow to update DoltgreSQL's version - 935: implement multiple table inherits
This PR supports most of the functionality around PostgreSQLINHERIT
s.
We just translatecreate table t1 (...) inherits (t2, t3, ...);
tocreate table t1 like (t2, t3, ...);
Note: MySQL does not support multipleLIKE
statements
gms logic: dolthub/go-mysql-server#2738
syntax: dolthub/vitess#375
Closed Issues
- 943: Unable to set
statement_timeout
0.14.0
Merged PRs
doltgresql
- 934: support
VALUES()
Add support forselect ... from (values (...), (...), ...) sqa
statements - 921: more partition no-ops
- 919: support multi-alter statements
We support multi alter statements, so we shouldn't error. - 918: partitions are no-ops
We parse, but ignore,PARTITION BY
clauses inCREATE TABLE
statements in gms, so do the same thing here.
Docs noting this here: dolthub/docs#2392 - 909: have
rootFinalizerIter
implementsql.MutableRowIter
We've moved rules out of analyzer intoFinalizeIters
so theapplyRowUpdateAccumulator
is applied afterwards.
However, this seems to be a specialsql.RowIter
, so we need to expose the child iterators through thesql.CustomRowIter
interface to apply that rule - 908: Tests for system tables with _$tablename
Dolt PR: dolthub/dolt#8527 - 901: More system table updates, add and unskip some tests
- 898: more unskipped engine tests
- 887: Bug fix: Make
db.Ping(ctx)
work correctly with Doltgres
Implementations ofdb.Ping(ctx)
from Go'sdatabase/sql
package typically send some sort of empty query to test the liveness of a database connection. For example, thepq
library sends;
and the pgx library sends-- ping
.
Before this change, Doltgres' parser would return an empty statement, instead of Vitess'ErrEmpty
error, which caused GMS to try and execute a nil analyzed plan for these statements, return an error, and the ping check would fail. This change makes the Doltgres parser return the same VitessErrEmpty
error that the Vitess parser throws, sending the same signal to GMS to handle an empty statement without returning an error to the client. The related PR dolthub/go-mysql-server#2716 updates theParser
interface documentation to explicitly call out the requirement to returnErrEmpty
in order for empty statements to be handled correctly.
For testing, I've added some no-op statements to the smoke tests, but since these tests go through as prepared statements, they don't follow the exact code path asdb.Ping(ctx)
, so I've also added calls todb.Ping(ctx)
in the test framework, which do reproduce this error. I've also added a unit test for Doltgres'Parser
implementation that explicitly tests empty statement parsing.
Fixes: #884
Related to: dolthub/go-mysql-server#2716 - 886: /testing/logictest/harness/doltgres_server_harness.go: skip db.Ping call
- 882: drop domain support
Added:- merge functionality for domain types
- check for domain usage in tables for dropping domain
TODO: - creating domain type creates instance of array type of this domain type
- unique OID generated for each domain created
- add domains to pg_type
ALTER TABLE
(e.g.: modify existing column to domain type column)- use domain type as underlying type to another domain
- 881: Update first batch of dolt system tables to use
dolt
schemadolt_status
->dolt.status
dolt_branches
->dolt.branches
dolt_log
->dolt.log
dolt_tags
->dolt.tags
dolt_docs
->dolt.docs
These changes are mostly backwards compatible, unless you have an existing doc indolt_docs
, which will need to be recreated after updating
- 879: Allow
nextval()
to take a regclass instance
Allows thenextval()
function to take aregclass
parameter. Also changes the output function ofregclass
so that the returned relation name is schema-qualified if the schema is not onsearch_path
.
This change also moves theGetCurrentSchemas()
function into a newsettings
package to break a package import cycle. The newsettings
package is intended for low-level functions that access settings, without dependencies on other packages.
Fixes: #850 - 878: tests for cross-schema foreign keys
Depends on:
dolthub/go-mysql-server#2713
dolthub/dolt#8479 - 877: Function:
set_config()
Adds support for theset_config()
function.
Example Usage:Fixes: #852SELECT set_config('mynamespace.foo', 'bar', false); set_config ------------ bar SELECT current_setting('mynamespace.foo'); current_setting ----------------- bar
- 872: rule changes
- 868: More
ALTER TABLE
Support
Adds support for additionalALTER TABLE
syntax:- Adding a
UNIQUE
constraint - Adding a
CHECK
constraint - Dropping constraints
Adding support for check constraints triggered an issue with string literal value quoting that affects check constraints and column defaults. The fix was to makeexpression.Literal.String()
match the behavior of GMS'expression.Literal.String()
method and quote string literals. This required fixing another spot where we had been adding in quotes for string literals, as well as a small change in GMS (dolthub/go-mysql-server#2710).
Fixes: - #799
- #800
Regresions Report:
The regressions listed below are a little tricky to read, but everything seems to be working correctly as far as I can tell. In the first regression listed (INSERT INTO inhg VALUES ('foo');
), this query now fails, because a previous statement now executes correctly to add a check constraint to a table, but ourCREATE TABLE LIKE
logic incorrectly copies over check constraints.
The rest of the regressions listed seem to actually be working correctly and I'm unable to repro problems with them, and they aren't reporting any errors in the regression report. For example, I've confirmed that the regression reported forALTER TABLE inhx add constraint foo CHECK (xx = 'text');
actually executes correctly without error now, while onmain
it returns the error:ALTER TABLE with unsupported constraint definition type *tree.AlterTableAddConstraint
.
- Adding a
- 867: Release v0.13.0
Created by the Release workflow to update DoltgreSQL's version - 863: Added GRANT, REVOKE, Privilege Checking, Ownership, and persisting changes
This adds the majority of the core functionality that was missing for users, authorization, and privilege checking. This is missing rigorous testing, but that will be added in a separate PR (both engine and bats). All changes that will accompany those tests (such as missing statement support) will also be added in separate PRs. - 845: add create domain and domain usage support
Depends on: dolthub/go-mysql-server#2697
TODO:- add merge functionality for domains
- creating domain type creates instance of array type of this domain type
- unique OID generated for each domain created
- track domain usage in table for dropping domain
- add domains to
pg_type
ALTER TABLE
(e.g.: modify existing column to domain type column)- use domain type as underlying type to another domain
Closed Issues
0.13.0
Merged PRs
doltgresql
- 862: Foreign key tests
Depends on dolthub/dolt#8461 - 858: Fix merge bug, add tests
Fixes #855
Dolt PR: dolthub/dolt#8459 - 856: fix type for coalesce regression test
- 851: Bug fixes for double-quoted relation names
While investigating #843, several statements were failing due to double-quoted identifiers. This PR fixesCOPY
statements and use ofnextval()
andsetval()
to properly parse double-quoted identifiers. - 834: Label contribution PRs
Adds a GitHub Actions workflow to label PRs from outside the team with the "contribution" label. This is the same workflow we use for dolt/go-mysql-server/etc. - 833: Test and fix for detached head error for pg_catalog tables
Dolt PR: dolthub/dolt#8434 - 832: Bug fixes for DESCRIBE and implemented SHOW TABLES
Fixes #830 - 829: Support for using
TEXT
fields in secondary indexes andUNIQUE
constraints
AllowsTEXT
columns in Doltgres to work when used in secondary indexes and in unique constraints. PostgreSQL does not have a concept of prefix lengths and Dolt requires prefix lengths forTEXT
columns. This now works in Doltgres because a new Doltgres analyzer rule implicitly fills in a default prefix length in these cases.
Depends on: - 828: Support for DESCRIBE with AS OF
- 824: Add information_schema tests for checkout and detached head
- 820: Unskip tests for dolt_revert
Stacked on #818 - 818: Support for per-table AS OF clauses
- 816: Unskip
COPY ... DELIMITER
test - 815: Tests for dolt_history table
- 813: Added CREATE USER, ALTER USER, DROP USER
This adds support forCREATE USER
,ALTER USER
, andDROP USER
. This also adds the relatedROLE
statements too, since theUSER
statements are essentially aliases for them. Next step will be to look into persistence and bats testing. - 812: fix: fix slice init length
The intention here should be to initialize a slice with a capacity of length rather than initializing the length of this slice.
The online demo: https://go.dev/play/p/q1BcVCmvidW - 809: Unskip dolt_patch test
Dolt PR: dolthub/dolt#8415 - 804: add column check constraint support for create table
depends on: dolthub/go-mysql-server#2683 - 801: Fix diff functions, return
schema.table
for table_name columns
Dolt PR: dolthub/dolt#8411 - 790: Support for setting custom session settings in user namespaces
e.g.:Postgres allows any configuration parameter to be set this way as long as it's not in the default (empty) namespace.SET mynamespace.var to 'true'; SHOW mynamespace.var; SELECT current_setting('mynamespace.var');
This functionality lets us exercise Dolt engine tests that have user variables in them. - 789: Add support for
ALTER COLUMN TYPE
,DEFAULT
, andNOT NULL
statements
Depends on: - 788: Diff tests for changes in multiple schemas
- 787: add functions
translate
andquote_ident
and addpg_operator
table
Also:- Removed
pg_stat_io
view as it is supported for Postgres versions 16 and later. - Fixed parsing date type input - fixes #773
- Removed
- 786: Add diff tests for single schema
- 785:
ALTER TABLE
support forADD COLUMN
,DROP COLUMN
, andRENAME COLUMN
- 783: Test fixes for merge and related operations
- 782: Release v0.12.0
Created by the Release workflow to update DoltgreSQL's version - 779: enable using postgres unix socket file path
- 778: Feature:
delimiter
support forCOPY FROM STDIN
Allows theDELIMITER
copy option to be specified for CSV and TEXT imports.
Also adds initial support for the legacy copy option syntax described in the Compatibility section ofCOPY
docs (e.g.COPY <table> FROM STDIN CSV, HEADER;
instead ofCOPY <table> FROM STDIN WITH (FORMAT CSV, HEADER true);
). - 775: Added RFC5802 for user client authentication
For the most part, this implements the following portions of RFC 5802:- Section 2.2
- Section 3
- Validation portion of Section 5
This also bases the stored data from: - https://www.postgresql.org/docs/15/catalog-pg-authid.html
This PR finally lets the server do the full authentication routine with the client. For now, I've created a mock database full of mock users, which are actually being tested by all of our engine tests since we do supply a username and password when creating and setting up the server. Thepgx
library is handling the client-side authentication for these tests.
The next step is to handle basicCREATE USER
andDROP USER
statements. With those in, I'll create a full battery of tests (bats tests, unit tests, dedicated engine tests, etc.). Unit tests are not included in this PR since I may make further changes with the next PR, and I'd prefer to do a big testing pass at once since none of this is in production just yet.
After the aforementioned statements and testing, I'll move on to designing the storage portion, since the mock user and mock database are stand-ins for an actual implementation.
- 746: fix value types used for datetime types and add timezone function
- 855:
dolt_merge
stomps working set - 844: Not picking up a commit?
- 830:
DESCRIBE [table]
does not work for tables in other schemas - 822:
information_schema
tables do not work in detached head state - 808: Support
DELIMITER
inCOPY...FROM
- 33: Default socket file is named mysql.sock
- 773: Support PostgreSQL datetime literal formats
- 728: Support socket interface