dolthub / dolthub/dolt

Line comments somehow getting included in column names for literals

Open
#10,868 0 comments 0 reactions 0 assignees View on GitHub
bug correctness parser
Dominant language
Go
Stars
24.4k
Forks
873
Avg merge
1d 8h
Merged PRs (30d)
120

Description

Not sure if this is a Dolt shell issue or a Vitess parsing issue. This only seems to happen with literals and not with table columns.

MySQL
```
mysql> select null -- comment
-> ;
+------+
| NULL |
+------+
| NULL |
+------+
1 row in set (0.00 sec)

mysql> select 1, -- one
-> 2 -- two
-> ;
+---+---+
| 1 | 2 |
+---+---+
| 1 | 2 |
+---+---+
1 row in set (0.00 sec)

mysql> select "string", -- string
-> "another string" -- another string
-> ;
+--------+----------------+
| string | another string |
+--------+----------------+
| string | another string |
+--------+----------------+
1 row in set (0.00 sec)
```

Dolt
```
tmp/main*> select null -- comment
-> ;
+-----------------+
| null -- comment |
+-----------------+
| NULL |
+-----------------+
1 row in set (0.00 sec)

tmp/main*> select 1, -- one
-> 2 -- two
-> ;
+---+----------------+
| 1 | -- one
2 -- two |
+---+----------------+
| 1 | 2 |
+---+----------------+
1 row in set (0.00 sec)

tmp/main*> select "string", -- string
-> "another string" -- another string
-> ;
+--------+---------------------------------------------+
| string | -- string
"another string" -- another string |
+--------+---------------------------------------------+
| string | another string |
+--------+---------------------------------------------+
1 row in set (0.00 sec)

tmp/main*> select x -- only column x
-> from xy;
+---+
| x |
+---+
| 0 |
| 1 |
| 2 |
| 3 |
+---+
4 rows in set (0.00 sec)

tmp/main*> select x as column_x -- rename column
-> from xy;
+----------+
| column_x |
+----------+
| 0 |
| 1 |
| 2 |
| 3 |
+----------+
4 rows in set (0.00 sec)
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the literal queries in the Dolt shell and compare their column names with MySQL, then trace whether line comments are handled by the shell or the Vitess parser. Done means comments are excluded from literal column names while the shown table-column queries continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, sql
Domain
database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.