Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mysql-test/main/mysql_upgrade.result
Original file line number Diff line number Diff line change
Expand Up @@ -2470,3 +2470,11 @@ SELECT CHARACTER_SET_CLIENT, COLLATION_CONNECTION FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA='mysql' AND TABLE_NAME='user';
CHARACTER_SET_CLIENT COLLATION_CONNECTION
latin1 latin1_swedish_ci
# End of 11.4 tests
#
# MDEV-39675 mariadb_upgrade utility failed when path=nonexist
#
set @old_path=@@global.path;
set global path='non-existant';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Correcting the typo 'non-existant' to 'non-existent' to maintain consistency with the suggested change in the .test file.

set global path='non-existent';

set global path=@old_path;
# End of 12.3 tests
16 changes: 16 additions & 0 deletions mysql-test/main/mysql_upgrade.test
Original file line number Diff line number Diff line change
Expand Up @@ -599,3 +599,19 @@ FLUSH TABLES mysql.user;
FLUSH PRIVILEGES;
SELECT CHARACTER_SET_CLIENT, COLLATION_CONNECTION FROM INFORMATION_SCHEMA.VIEWS
WHERE TABLE_SCHEMA='mysql' AND TABLE_NAME='user';

--echo # End of 11.4 tests

--echo #
--echo # MDEV-39675 mariadb_upgrade utility failed when path=nonexist
--echo #

set @old_path=@@global.path;
set global path='non-existant';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There is a minor typo in the string 'non-existant'. It should be 'non-existent'. Although this is a test value, correcting it improves the overall quality of the test suite. Note that the corresponding .result file should also be updated to avoid a test failure.

set global path='non-existent';


--exec $MYSQL_UPGRADE --force --silent 2>&1
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure, mariadb-upgrade was run and in particular has run that problematic code that failed before? There is nothing in the .result file to prove it

I'd suggest to make some innocuous change in the sys schema that mariadb-upgrade would correct and verify that it was corrected

--remove_file $MYSQLD_DATADIR/mariadb_upgrade_info

set global path=@old_path;

--echo # End of 12.3 tests
2 changes: 1 addition & 1 deletion scripts/mariadb_system_tables_fix.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ set default_storage_engine=Aria;
set enforce_storage_engine=NULL;
set alter_algorithm='DEFAULT';
set use_stat_tables='NEVER';

set path 'CURRENT_SCHEMA';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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
  1. Use the assignment operator = for system variables to maintain consistency with the existing style of the file. (link)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. SQL Standard syntax is SET PATH 'string'


--
-- Upgrade mysql.column_stats table early because its quite noisy otherwise
Expand Down
Loading