StarRocks / starrocks

StarRocks, a Linux Foundation project, is a next-generation sub-second MPP OLAP database for full analytics scenarios, including multi-dimensional analytics, real-time analytics, and ad-hoc queries.
https://starrocks.io
Apache License 2.0
8.65k stars 1.75k forks source link

comments block sql execution #22259

Open k4124k opened 1 year ago

k4124k commented 1 year ago

Steps to reproduce the behavior (Required)

  1. create table CREATE TABLE table1 ( id largeint(40) ) ENGINE=OLAP PRIMARY KEY(id) DISTRIBUTED BY HASH(id) BUCKETS 3 PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "DEFAULT", "enable_persistent_index" = "true" );
  2. exec sql select /+ 12323 / count(1) from table1 ;

Expected behavior (Required)

return number of rows

Real behavior (Required)

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 '12323' at line 1

StarRocks version (Required)

dustinlineweber commented 1 year ago

Another example of a comment being executed. This is from within MySQLWorkbench, and my other databases don't appear to have this issue... But I think it is worth mentioning this because executing this same thing from mysql via the terminal against StarRocks does appear to handle the comment properly. Perhaps this is only for certain channels of input?

Steps to reproduce the behavior

select "1",
#"this is commented out and had better not run",
"3";

Expected behavior

image

Real behavior

image
github-actions[bot] commented 8 months ago

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!

dustinlineweber commented 8 months ago

This is apparently fixed for the block comment case, but not for the SQL-style line comments (starting with #). Today on version 3.2.2:

image
github-actions[bot] commented 1 month ago

We have marked this issue as stale because it has been inactive for 6 months. If this issue is still relevant, removing the stale label or adding a comment will keep it active. Otherwise, we'll close it in 10 days to keep the issue queue tidy. Thank you for your contribution to StarRocks!

dustinlineweber commented 1 month ago

Still occurring on current_version

3.2.7-44058fe
+---+----------------------------------------------+---+
|'1'|'this is commented out and had better not run'|'3'|
+---+----------------------------------------------+---+
|1  |this is commented out and had better not run  |3  |
+---+----------------------------------------------+---+