tconbeer / harlequin

The SQL IDE for Your Terminal.
https://harlequin.sh
MIT License
3.64k stars 83 forks source link

Issue Parsing Semi-Colons when embedded in a string #544

Closed dm-duys closed 5 months ago

dm-duys commented 5 months ago

Before Proceeding, please acknowledge:

Describe the bug If you embed a ; as part of a string, Harlequin will see the content before it as a statement and attempt to execute.

To Reproduce Steps to reproduce the behavior.

  1. Load up Azure Extension INSTALL azure; LOAD azure;

  2. Attempt to create a secret.

CREATE PERSISTENT SECRET secret_sas_token(
   TYPE AZURE,
   CONNECTION_STRING 'BlobEndpoint=https://my.url.com;SharedAccessSignature=sv=....'
);

Expected behavior When parsing, it should exclude semi-colons if they are wrapped within a string literal

Actual behavior It seems to be parsing the content left of the content of any semi-colon. From above, it tries to execute:

CREATE PERSISTENT SECRET secret_sas_token(
   TYPE AZURE,
   CONNECTION_STRING 'BlobEndpoint=https://my.url.com

Contributing Are you interested in contributing a fix?

Additional context Please provide as much as you can, but don't waste your time if it's definitely not relevant or you don't know.

What is the output of harlequin --version? 1.20.0

What database adapter are you using with Harlequin? (Default is duckdb) duckdb: 1.20.0

What other options are you using when invoking Harlequin? (If you are using a profile, please add relevant items from your profile here).

Can you tell us more about your system?

[!TIP] For example, for my system, these are:

  • Bash
  • Windows Terminal
  • Ubuntu 22.04 / WSL2
  • Windows 11
  • en_US/UTF-8

How did you install Harlequin?

tconbeer commented 5 months ago

Yes, this is unfortunate. Duplicates https://github.com/tconbeer/harlequin/issues/348