Skip to content

If the virtual (SQL) dataset contains a comment, not possible to synchronize the columns #25527

@bu3tt1

Description

@bu3tt1

If the virtual (SQL) dataset contains the comment --SELECT in the clause select is not possible to synchronize the columns.

How to reproduce the bug

  1. Go to 'Edit Dataset'
  2. Modify the query SQL on the virtual (SQL)

SELECT
issues.id
--SELECT
FROM issues

  1. Save
  2. Return on 'Edit Dataset' > 'Columns'
  3. Click 'Sync columns from source
  4. See error:

(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SELECT\nFROM issues\nLIMIT 1' at line 3")

Expected results

Columns must synchronize without error

what actually happens.

Screenshot 2023-10-05 alle 11 10 54 Screenshot 2023-10-05 alle 11 11 03

Environment

  • superset version: 2.1.1
  • official Docker image: apache/superset:2.1.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions