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

SQL injection not working for CREATE TABLE #532

Open
greg0ire opened this issue Dec 19, 2024 · 0 comments
Open

SQL injection not working for CREATE TABLE #532

greg0ire opened this issue Dec 19, 2024 · 0 comments

Comments

@greg0ire
Copy link
Contributor

I'm not 100% sure of what's going on in https://github.com/ray-x/go.nvim/blob/master/queries/go/injections.scm, but what I do observe is that sql := " CREATE TABLE my_table (some_column INT); " is not identified as SQL, while sql := " SELECT * FROM users; " is… and the spaces matter, for instance `sql := "SELECT * FROM users"; is parsed like this:

        right: (expression_list ; [63, 8] - [63, 30]
          (raw_string_literal ; [63, 8] - [63, 30]
            (raw_string_literal_content ; [63, 9] - [63, 29]
              (program ; [63, 10] - [63, 28]
                (ERROR ; [63, 10] - [63, 28]
                  (keyword_from))))))) ; [63, 18] - [63, 22]

In short, what is the recommended way to make arbitrary strings recognized as SQL?

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

No branches or pull requests

1 participant