Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created by
brew bumpCreated with
brew bump-formula-pr.release notes
Pulling in the
pg_query_golibrary 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.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.
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 on
CREATE FUNCTION.This implements parsing of
CREATE FUNCTIONinto the same expected set of operations as the handcoded examples. This means that we are able to writeCREATE FUNCTIONstatements 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 new
pg_analyzepackage 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.ALIASstatementAdds support for the execution logic for the
ALIASstatement in user defined functions.This adds the base of an interpreter, upon which
CREATE FUNCTIONandCREATE PROCEDUREwill 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's
CREATE FUNCTIONandCREATE PROCEDUREsupport (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:
Fixes a parser bug that disallowed calling a function with no arguments.
Implements a missing form of the substring() function.
Diff includes Env var to ignore all unsupported DDL operations / commands dolthub/doltgresql#1154
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.
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.
Bug fix for new tests in Bug fixes for serializing certain types in column default expressions dolthub/go-mysql-server#2825
servercfg.DoltgresConfigImplements the new
IsUserSpecified()andSkipRootUserInitialization()methods fromservercfg.DoltgresConfig, added in Initialize persistedrootsuperuser on SQL server startup dolthub/dolt#8690Currently, an
InternalID requires one to know the exact format for constructing an ID of a specific type. For example,Internaltable IDs have the following format:SchemaName()orTableName(). In addition, they don't need to know the format, callingNewInternalTablegives 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 (in
ReplaceNode), 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.Used for OWNER ddl statements for now, and will extend to VACUUM next.
Account for interface change in Dolt: dolt bootstrap refactor dolthub/dolt#8708
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