Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default sql mode for common path #2520

Merged
merged 3 commits into from
May 29, 2024
Merged

Default sql mode for common path #2520

merged 3 commits into from
May 29, 2024

Conversation

max-hoffman
Copy link
Contributor

Bit strange & verbose, but has a noticeable effect for small queries.

perf here: dolthub/dolt#7915

@max-hoffman max-hoffman requested a review from fulghum May 29, 2024 19:37
Copy link
Contributor

@fulghum fulghum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

sql/sql_mode.go Outdated
@@ -30,8 +30,24 @@ const (
NoAutoValueOnZero = "NO_AUTO_VALUE_ON_ZERO"
NoEngineSubstitution = "NO_ENGINE_SUBSTITUTION"
StrictTransTables = "STRICT_TRANS_TABLES"
defaultSqlMode = "no_engine_substitution,only_full_group_by,strict_trans_tables"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(minor) You might consider exposing this constant (and uppercasing?) – then you could reference this default from system_variables.go instead of relying on those to match up. That way, if someone does change system_variables.go to change that value in the future, they'd have to come change it here and make sure this code gets updated, too. (you could also just reuse defaultSqlMode on line 47 if you want to avoid that extra strings.Join call.)

Copy link

Additional work is required for integration with Dolt.

@max-hoffman max-hoffman merged commit 6e2cb91 into main May 29, 2024
8 checks passed
@max-hoffman max-hoffman deleted the max/default-sql-mode branch May 29, 2024 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants