Skip to content

Commit 02d67ce

Browse files
committed
MDEV-32043 mariadb-upgrade should remove bundled plugins from mysql.plugin
Also in the startup, lets not "Error" on attempting to install a mysql.plugin that is already there. We use the 'if_not_exists' parameter to true to downgrade this to a "Note". Also corrects: MDEV-32041 "plugin already loaded" should be a Warning, not an Error
1 parent 9be7e03 commit 02d67ce

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

mysql-test/main/mysql_upgrade.result

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,4 +1058,12 @@ test
10581058
Phase 7/7: Running 'FLUSH PRIVILEGES'
10591059
OK
10601060
set global sql_safe_updates=@orig_sql_safe_updates;
1061+
#
1062+
# MDEV-32043 Remove plugins previously external that are now built in (unix_socket)
1063+
#
1064+
INSERT INTO mysql.plugin SELECT 'unix_socket', 'auth_socket.so'
1065+
FROM dual WHERE convert(@@version_compile_os using latin1) not in ('Win32', 'Win64', 'Windows');
1066+
# mariadb-upgrade --force --silent 2>&1
1067+
SELECT * FROM mysql.plugin WHERE name='unix_socket';
1068+
name dl
10611069
# End of 10.4 tests

mysql-test/main/mysql_upgrade.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,4 +495,15 @@ set global sql_safe_updates=ON;
495495
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
496496
set global sql_safe_updates=@orig_sql_safe_updates;
497497

498+
--echo #
499+
--echo # MDEV-32043 Remove plugins previously external that are now built in (unix_socket)
500+
--echo #
501+
502+
INSERT INTO mysql.plugin SELECT 'unix_socket', 'auth_socket.so'
503+
FROM dual WHERE convert(@@version_compile_os using latin1) not in ('Win32', 'Win64', 'Windows');
504+
--echo # mariadb-upgrade --force --silent 2>&1
505+
--exec $MYSQL_UPGRADE --force --silent 2>&1
506+
SELECT * FROM mysql.plugin WHERE name='unix_socket';
507+
--remove_file $MYSQLD_DATADIR/mysql_upgrade_info
508+
498509
--echo # End of 10.4 tests

scripts/mysql_system_tables_fix.sql

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,11 @@ UPDATE user
180180
SET plugin='unix_socket' WHERE plugin='auth_socket';
181181
DELETE FROM plugin
182182
WHERE name='auth_socket';
183+
# Delete plugins that are now inbuilt but might not have been before (MDEV-32043)
184+
DELETE plugin
185+
FROM information_schema.PLUGINS is_p
186+
JOIN plugin ON plugin.name = is_p.PLUGIN_NAME
187+
WHERE is_p.PLUGIN_LIBRARY IS NULL;
183188

184189
ALTER TABLE user
185190
MODIFY Password char(41) character set latin1 collate latin1_bin NOT NULL default '',

sql/sql_plugin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1929,7 +1929,7 @@ static void plugin_load(MEM_ROOT *tmp_root)
19291929
the mutex here to satisfy the assert
19301930
*/
19311931
mysql_mutex_lock(&LOCK_plugin);
1932-
plugin_add(tmp_root, false, &name, &dl, MYF(ME_ERROR_LOG));
1932+
plugin_add(tmp_root, true, &name, &dl, MYF(ME_ERROR_LOG));
19331933
free_root(tmp_root, MYF(MY_MARK_BLOCKS_FREE));
19341934
mysql_mutex_unlock(&LOCK_plugin);
19351935
}

0 commit comments

Comments
 (0)