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

L034 should not fix inside "INSERT" or "CREATE TABLE AS SELECT" #1384

Conversation

barrywhart
Copy link
Member

Fixes #1268

Prevents L034 from making changes inside "INSERT" or "CREATE TABLE AS SELECT" statements, where the order of columns in a "SELECT" should be preserved.

Pull Request checklist

  • Please confirm you have completed any of the necessary steps below.

  • Included test cases to demonstrate any code changes, which may be one or more of the following:

    • .yml rule test cases in test/fixtures/rules/std_rule_cases.
    • .sql/.yml parser test cases in test/fixtures/parser (note YML files can be auto generated with python test/generate_parse_fixture_yml.py or by running tox locally).
    • Full autofix test cases in test/fixtures/linter/autofix.
    • Other.
  • Added appropriate documentation for the change.

  • Created GitHub issues for any relevant followup/future enhancements if appropriate.

@barrywhart barrywhart merged commit 01e9aeb into sqlfluff:main Sep 11, 2021
@tunetheweb tunetheweb changed the title Issue 1268: L034 should not fix inside "INSERT" or "CREATE TABLE AS SELECT" L034 should not fix inside "INSERT" or "CREATE TABLE AS SELECT" Sep 18, 2021
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.

sqlfluff-fix pre-commit hook breaks INSERT statements due to column reordering
2 participants