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

dbUp fails when a combination of "\'" & ";" is in the script #1

Open
keren-steinberg opened this issue Aug 28, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@keren-steinberg
Copy link

keren-steinberg commented Aug 28, 2023

The following script is failing when running in mySQL.

DROP TABLE IF EXISTS test;

CREATE TABLE test (
id int DEFAULT NULL,
message varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*!40000 ALTER TABLE test DISABLE KEYS /;
INSERT INTO test VALUES
(1,'CCP\'s valuation') ;
INSERT INTO test VALUES
(2,'UTI = ;') ;
/
!40000 ALTER TABLE test ENABLE KEYS */;

The following script runs successfully. Only change is removing the "\'" and having "CCPs" instead of "CCP\'s".
DROP TABLE IF EXISTS test;

CREATE TABLE test (
id int DEFAULT NULL,
message varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*!40000 ALTER TABLE test DISABLE KEYS /;
INSERT INTO test VALUES
(1,'CCPs valuation') ;
INSERT INTO test VALUES
(2,'UTI = ;') ;
/
!40000 ALTER TABLE test ENABLE KEYS */;

The error of the failing script is:
error.txt

this is some kind of relation between the quoted "\'" and the ";"

Appreciate if you can run this script and see it is failing since it is 3rd time I am opening this bug and getting irrelevant answers

@keren-steinberg keren-steinberg added the bug Something isn't working label Aug 28, 2023
@mjauernig
Copy link
Member

Appreciate if you can run this script and see it is failing since it is 3rd time I am opening this bug and getting irrelevant answers

Sorry for supporting you in our spare time and not satisfying you.
You can comment on closed issues, so you do not need to open new issues. Also it would be good if you answer the questions.

I did a first test today. Can you live with the following workaround?

DROP TABLE IF EXISTS test;

CREATE TABLE test (
id int DEFAULT NULL,
message varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO test VALUES
(1,"CCP's valuation") ;
INSERT INTO test VALUES
(2,"UTI = ;") ;

The use of ' with \' looks like a bug in the parser. But I need to look deeper.

@keren-steinberg
Copy link
Author

Hi, thanks very much for checking it. this solution works and I am happy with it. Thanks again.

@droyad droyad transferred this issue from DbUp/DbUp Jan 30, 2024
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
Status: Bugs
Development

No branches or pull requests

2 participants