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 export for set types with embedded single quotes broken #2197

Open
zachmu opened this issue Sep 28, 2021 · 4 comments
Open

SQL export for set types with embedded single quotes broken #2197

zachmu opened this issue Sep 28, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@zachmu
Copy link
Member

zachmu commented Sep 28, 2021

dolt sql <<SQL
create table sets (a varchar(10) primary key, b set('one','two','three\'s'));
insert into sets values ('abc', 'one,two'), ('def', 'two,three\'s');
SQL

dolt table export sets -f export.sql
dolt sql < export.sql

Last line breaks because of unescaped quote character.

JSON columns have the same problem, but for embedded double quotes.

@zachmu zachmu added the bug Something isn't working label Sep 28, 2021
@macneale4 macneale4 self-assigned this Mar 9, 2023
@timsehn
Copy link
Contributor

timsehn commented Mar 9, 2023

This seems very related to the fix here: dolthub/go-mysql-server#1639

The above is still broken but it seems like it is on the same path.

@macneale4
Copy link
Contributor

We've regressed on this. I can't create a set with a single quote using backslash or double quote encoding.

db5> create table sets (a varchar(10) primary key, b set('one','two','three\'s'));
Error parsing SQL
syntax error at position 42 near 's'
CREATE TABLE a(b set('one','two','three's'))
                                          ^
db5> create table sets (a varchar(10) primary key, b set('one','two','three''s'));
Error parsing SQL
syntax error at position 42 near 's'
CREATE TABLE a(b set('one','two','three's'))
                                          ^

@macneale4
Copy link
Contributor

Also, this seems to be limited to the set datatype, which I'd never heard of until today:

https://dev.mysql.com/doc/refman/8.0/en/set.html

I'm going to guess this is a rarely use feature of mysql, and this is pretty low priority.

@macneale4 macneale4 removed their assignment Mar 27, 2023
@macneale4
Copy link
Contributor

This seems very related to the fix here: dolthub/go-mysql-server#1639

The above is still broken but it seems like it is on the same path.

I doubt this is the case. Seems really set specific. Unassigning from myself since I think this is low priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants