Fix for side-effects seeping into data query#419
Open
teunbrand wants to merge 5 commits intoposit-dev:mainfrom
Open
Fix for side-effects seeping into data query#419teunbrand wants to merge 5 commits intoposit-dev:mainfrom
teunbrand wants to merge 5 commits intoposit-dev:mainfrom
Conversation
transform_global_sql concatenated side-effect SQL (CREATE, INSERT, …) with the VISUALISE FROM injection, then the caller wrapped the whole thing in another CREATE TABLE AS, producing invalid SQL like: CREATE TABLE __ggsql_global__ AS CREATE TEMP TABLE data … Split the return into side-effect statements (executed directly) and the queryable part (wrapped as the global temp table). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…om/teunbrand/ggsql into fix_create_temp_table_global_query
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR aims to fix #415.
The
transform_global_sql()was wrapping the user-provided query like so:Whereas now
CREATE TEMP TABLE data(x, y) AS (VALUE...is executed seperately as a side-effectCREATE TABLE "__ggsql_global_..." AS SELECT * FROM databecomes the global data queryI'm mainly concerned about Chesterton's fence: I don't really know why
CREATEstatements were transformed in the first place. So that'd be a good item to review.