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

[MySQL] Generated invalid PLPGSQL preserves SET in some nested blocks #1363

Open
ssherwood opened this issue Mar 14, 2024 · 0 comments
Open
Labels
triage Needs to be triaged

Comments

@ssherwood
Copy link

ssherwood commented Mar 14, 2024

Running Voyager to migrate a set of stored procedures from MySQL (MariaDB 10.5) and identified a syntax issue where some nested blocks case assignments with set not be translated.

Original:

...
   IF Auth <> "" THEN
   	 set Auth=concat(Intro,URL,Header,Username,Slash,Header,
   		 Password, Slash, Header, ContentType, Slash,
   		 Data, char(34),DataRaw, char(34),Slash);    
    END IF;
...

Results:

...
   IF Auth <> '' THEN
   	 set Auth=concat(Intro,URL,Header,Username,Slash,Header,
   		 Password, Slash, Header, ContentType, Slash,
   		 Data, array_to_string(ARRAY(SELECT chr(unnest(34))),''),DataRaw, array_to_string(ARRAY(SELECT chr(unnest(34))),''),Slash);
   END IF;  
...

Something is causing the assignment (:=) from being applied and the set is retained causing a syntax error. I.e. ```

AuthJson := concat(...

Also the translation of char(34) to array_to_string(ARRAY(SELECT chr(unnest(34))),'') seems particularly verbose.

@github-actions github-actions bot added the triage Needs to be triaged label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant