[MDEV-30295] mysqldump produces syntactically incorrect statement Created: 2022-12-24 Updated: 2023-11-28 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Scripts & Clients, Triggers |
| Affects Version/s: | 10.3, 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11 |
| Fix Version/s: | 10.4, 10.5, 10.6 |
| Type: | Bug | Priority: | Major |
| Reporter: | Elena Stepanova | Assignee: | Oleksandr Byelkin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | beginner-friendly | ||
| Description |
|
If a trigger contains a comment in its description, it can interleave with executable comments which mysqldump adds, resulting in syntactically incorrect statement and unloadable dump.
The line 47 which it complains about it
Note the comment /* here */ nested inside the executable comment. |
| Comments |
| Comment by Elena Stepanova [ 2022-12-24 ] | |||||||||||||||
|
Probably the most obvious solution in this case would be to stop adding 5.0-executable limitations, we don't really expect that the dumps would be (otherwise) loadable into 4.x MySQL installations. | |||||||||||||||
| Comment by Ray Sleepy [ 2022-12-24 ] | |||||||||||||||
|
Seems OK in 10.11. /* here */ is not in dump file. I am probably missing something here.. | |||||||||||||||
| Comment by Ray Sleepy [ 2022-12-24 ] | |||||||||||||||
|
Maybe it's an issue with the mariadb client as opposed to the dump client. The client is supposed to rip out comments, no? I don't understand where the /* here */ comment is stored in the db.
| |||||||||||||||
| Comment by Elena Stepanova [ 2022-12-24 ] | |||||||||||||||
|
It has nothing to do with the client. | |||||||||||||||
| Comment by Ray Sleepy [ 2022-12-24 ] | |||||||||||||||
|
Pardon my ignorance. Still learning my way around mariadb. Is there an option in client to enable keeping comments? | |||||||||||||||
| Comment by Sergei Golubchik [ 2022-12-26 ] | |||||||||||||||
|
It looks like it is:
| |||||||||||||||
| Comment by Ray Sleepy [ 2022-12-28 ] | |||||||||||||||
|
Thanks Sergei! With -c option, I was able to replicate the same issue on version 11.
Elena, I think now I understand what you were saying – to get rid of the part about /*!50003 so that there won't be any nested comments in the dump file. | |||||||||||||||
| Comment by Oleksandr Byelkin [ 2023-09-26 ] | |||||||||||||||
|
Is it only triggers who can have a comment inside and included in version excluded comment? (I am not sure 100% about SP and functions). if so I am for Elena proposal to stop doing it for 5.0 version. |