MDEV-39675 mariadb_upgrade utility failed when path=nonexist#5106
MDEV-39675 mariadb_upgrade utility failed when path=nonexist#5106grooverdan wants to merge 1 commit into
Conversation
The upgrade SQL assumes the functions will resolve. With a non-default path this isn't true and results in: ERROR 1305 (42000) at line 3211: FUNCTION extract_schema_from_file_name does not exist Resolve by setting PATH = 'CURRENT_SCHEMA' for the upgrade. Idea thanks to Sergei Golubchik
There was a problem hiding this comment.
Code Review
This pull request addresses MDEV-39675 by ensuring the mariadb_upgrade utility handles non-existent paths correctly. It introduces a regression test and updates the system tables fix script. Reviewer feedback suggests using the assignment operator for consistency in SQL statements and fixing a typo in the test case.
| set alter_algorithm='DEFAULT'; | ||
| set use_stat_tables='NEVER'; | ||
|
|
||
| set path 'CURRENT_SCHEMA'; |
There was a problem hiding this comment.
For consistency with the preceding lines in this script (lines 30-32), it is recommended to use the assignment operator = when setting the path variable. While SET PATH '...' is a valid statement syntax in MariaDB, using set path='...'; aligns better with the existing style of the file where system variables are assigned using the = operator.
set path='CURRENT_SCHEMA';References
- Use the assignment operator = for system variables to maintain consistency with the existing style of the file. (link)
| --echo # | ||
|
|
||
| set @old_path=@@global.path; | ||
| set global path='non-existant'; |
There was a problem hiding this comment.
| # MDEV-39675 mariadb_upgrade utility failed when path=nonexist | ||
| # | ||
| set @old_path=@@global.path; | ||
| set global path='non-existant'; |
|
I have one concern for adding Is there any use case when users use In this case, PATH variable won't exist in the server. This line will fail. To be more safe, is it better to just add |
|
@gengtianuiowa , I think either will work. When one downgrades from 12.3 to 11.8 and runs |
The upgrade SQL assumes the functions will resolve.
With a non-default path this isn't true and results in:
ERROR 1305 (42000) at line 3211: FUNCTION extract_schema_from_file_name does not exist
Resolve by setting PATH = 'CURRENT_SCHEMA' for the upgrade.
Idea thanks to Sergei Golubchik