Skip to content

Commit 469b616

Browse files
committed
Bug#27454299 SYSTEM USERS USING MYSQL_NATIVE_PASSWORD WHEN CACHING_SHA2_PASSWORD
IS DEFAULT Description ----------- Starting from 8.0.4, the default authentication plugin has been changed from mysql_native_pasword to caching_sha2_password but this change didn't impact the three system users which are created at the time of initializing the database. These users are created/upgraded through predefined SQL scripts. Fix: ---- 1. Updated the default auth plugin to 'caching_sha2_password' in the SQL commands called at the time of database initialize. 2. Introduced a new sql file 'mysql_system_users' to create the system users. 'mysql_system_tables.sql' is called by 'mysql_upgrade' as well so I consolidated the users creation at one place which is called during database initialization. a. Moved the creation of mysql.session and mysql.infoschema from sql_initialize.cc to the new file. This is consistent and avoids unnecessary pollution in cpp file. 3. Following good old behavior is still intact. a. mysqld --initialize creates three user with default auth plugin(i.e. caching_sha2_password.) b. mysql_upgrade - don't change the default auth plugin of the existing user but any new users are created with the default auth plugin (i.e. caching_sha2_password) For instance - after upgrading from 5.7 to 8.0 user plugin existing/new mysql.sys mysql_native_password existing mysql.session mysql_native_passwoed existing mysql.infoschema caching_sha2_passwors new 4. Removed the trailing spaces Testing : ------- No new test case is written. Existing tests files have been updated. MTR suites passed in the local run. Branch - mysql-8.0-itch PB2 id - 12670561 Timestamp - 2018-03-05 10:56:27
1 parent 86fa9d8 commit 469b616

21 files changed

+126
-88
lines changed

mysql-test/r/initialize-bug20350099.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ SET PASSWORD='';
1919
SELECT user, host, plugin, LENGTH(authentication_string)
2020
FROM mysql.user ORDER BY user;
2121
user host plugin LENGTH(authentication_string)
22-
mysql.infoschema localhost mysql_native_password 41
23-
mysql.session localhost mysql_native_password 41
24-
mysql.sys localhost mysql_native_password 41
22+
mysql.infoschema localhost caching_sha2_password 70
23+
mysql.session localhost caching_sha2_password 70
24+
mysql.sys localhost caching_sha2_password 70
2525
root localhost caching_sha2_password 0
2626
# shut server down
2727
# Server is down

mysql-test/r/initialize-sha256.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ SET PASSWORD='';
1919
SELECT user, host, plugin, LENGTH(authentication_string) > 0
2020
FROM mysql.user ORDER BY user;
2121
user host plugin LENGTH(authentication_string) > 0
22-
mysql.infoschema localhost mysql_native_password 1
23-
mysql.session localhost mysql_native_password 1
24-
mysql.sys localhost mysql_native_password 1
22+
mysql.infoschema localhost caching_sha2_password 1
23+
mysql.session localhost caching_sha2_password 1
24+
mysql.sys localhost caching_sha2_password 1
2525
root localhost sha256_password 0
2626
CREATE DATABASE test;
2727
# shut server down

mysql-test/r/initialize.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ SET PASSWORD='';
1919
SELECT user, host, plugin, LENGTH(authentication_string)
2020
FROM mysql.user ORDER by user;
2121
user host plugin LENGTH(authentication_string)
22-
mysql.infoschema localhost mysql_native_password 41
23-
mysql.session localhost mysql_native_password 41
24-
mysql.sys localhost mysql_native_password 41
22+
mysql.infoschema localhost caching_sha2_password 70
23+
mysql.session localhost caching_sha2_password 70
24+
mysql.sys localhost caching_sha2_password 70
2525
root localhost caching_sha2_password 0
2626
# Check the sys schema exists with the right object counts
2727
#
@@ -69,9 +69,9 @@ SELECT 1;
6969
SELECT user, host, plugin, LENGTH(authentication_string)
7070
FROM mysql.user ORDER BY user;
7171
user host plugin LENGTH(authentication_string)
72-
mysql.infoschema localhost mysql_native_password 41
73-
mysql.session localhost mysql_native_password 41
74-
mysql.sys localhost mysql_native_password 41
72+
mysql.infoschema localhost caching_sha2_password 70
73+
mysql.session localhost caching_sha2_password 70
74+
mysql.sys localhost caching_sha2_password 70
7575
root localhost caching_sha2_password 0
7676
# check the result of running --init-file
7777
SELECT a FROM t1 ORDER BY a;

mysql-test/r/plugin_auth_qa_2.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ GRANT PROXY ON qa_test_1_dest TO qa_test_1_user;
88
GRANT ALL PRIVILEGES ON test_user_db.* TO qa_test_1_user;
99
SELECT user,plugin FROM mysql.user WHERE user != 'root';
1010
user plugin
11-
mysql.infoschema mysql_native_password
12-
mysql.session mysql_native_password
13-
mysql.sys mysql_native_password
11+
mysql.infoschema caching_sha2_password
12+
mysql.session caching_sha2_password
13+
mysql.sys caching_sha2_password
1414
qa_test_1_dest caching_sha2_password
1515
qa_test_1_user qa_auth_interface
1616
SELECT @@proxy_user;

mysql-test/r/plugin_auth_sha256.result

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ ALTER USER 'kristofer' IDENTIFIED BY 'secret';
33
SELECT user, plugin FROM mysql.user ORDER BY user;
44
user plugin
55
kristofer sha256_password
6-
mysql.infoschema mysql_native_password
7-
mysql.session mysql_native_password
8-
mysql.sys mysql_native_password
6+
mysql.infoschema caching_sha2_password
7+
mysql.session caching_sha2_password
8+
mysql.sys caching_sha2_password
99
root caching_sha2_password
1010
SELECT USER(),CURRENT_USER();
1111
USER() CURRENT_USER()
@@ -57,9 +57,9 @@ ALTER USER 'kristofer' IDENTIFIED BY 'secret';
5757
SELECT user, plugin FROM mysql.user ORDER BY user;
5858
user plugin
5959
kristofer sha256_password
60-
mysql.infoschema mysql_native_password
61-
mysql.session mysql_native_password
62-
mysql.sys mysql_native_password
60+
mysql.infoschema caching_sha2_password
61+
mysql.session caching_sha2_password
62+
mysql.sys caching_sha2_password
6363
root caching_sha2_password
6464
SELECT USER(),CURRENT_USER();
6565
USER() CURRENT_USER()

mysql-test/r/plugin_auth_sha256_server_default.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ ALTER USER 'kristofer' IDENTIFIED BY 'secret';
33
SELECT user, plugin FROM mysql.user ORDER BY user;
44
user plugin
55
kristofer sha256_password
6-
mysql.infoschema mysql_native_password
7-
mysql.session mysql_native_password
8-
mysql.sys mysql_native_password
6+
mysql.infoschema caching_sha2_password
7+
mysql.session caching_sha2_password
8+
mysql.sys caching_sha2_password
99
root caching_sha2_password
1010
SELECT USER(),CURRENT_USER();
1111
USER() CURRENT_USER()

mysql-test/r/plugin_auth_sha256_server_default_tls.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ ALTER USER 'kristofer' IDENTIFIED BY 'secret';
55
SELECT user, plugin FROM mysql.user ORDER BY user;
66
user plugin
77
kristofer sha256_password
8-
mysql.infoschema mysql_native_password
9-
mysql.session mysql_native_password
10-
mysql.sys mysql_native_password
8+
mysql.infoschema caching_sha2_password
9+
mysql.session caching_sha2_password
10+
mysql.sys caching_sha2_password
1111
root caching_sha2_password
1212
SELECT USER(),CURRENT_USER();
1313
USER() CURRENT_USER()

mysql-test/r/transactional_acl_tables.result

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1631,7 +1631,7 @@ max_questions int(11) unsigned DEFAULT 0 NOT NULL,
16311631
max_updates int(11) unsigned DEFAULT 0 NOT NULL,
16321632
max_connections int(11) unsigned DEFAULT 0 NOT NULL,
16331633
max_user_connections int(11) unsigned DEFAULT 0 NOT NULL,
1634-
plugin char(64) DEFAULT 'mysql_native_password', authentication_string TEXT,
1634+
plugin char(64) DEFAULT 'caching_sha2_password', authentication_string TEXT,
16351635
password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
16361636
PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin
16371637
comment='Users and global privileges';
@@ -1866,7 +1866,7 @@ RENAME TABLE mysql.tables_priv_bak TO mysql.tables_priv;
18661866
INSERT IGNORE INTO mysql.user VALUES ('localhost','mysql.session',
18671867
'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N',
18681868
'N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,
1869-
'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE',
1869+
'caching_sha2_password','$A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED',
18701870
'N',CURRENT_TIMESTAMP,NULL,'Y', 'N', 'N', NULL, NULL);
18711871
INSERT IGNORE INTO mysql.tables_priv VALUES ('localhost', 'mysql',
18721872
'mysql.session', 'user', 'root\@localhost',

mysql-test/suite/auth_sec/r/atomic_alter_user.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ user authentication_string
99
userX
1010
userY
1111
userZ
12-
mysql.infoschema *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE
13-
mysql.session *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE
14-
mysql.sys *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE
12+
mysql.infoschema $A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
13+
mysql.session $A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
14+
mysql.sys $A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED
1515
root
1616
# Case 1 : Modify multiple users
1717
ALTER USER userX IDENTIFIED BY 'abcd',

mysql-test/suite/auth_sec/r/skip_grant_protocols.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ current_user
1212
root@localhost
1313
SELECT user, plugin FROM mysql.user;
1414
user plugin
15-
mysql.infoschema mysql_native_password
16-
mysql.session mysql_native_password
17-
mysql.sys mysql_native_password
15+
mysql.infoschema caching_sha2_password
16+
mysql.session caching_sha2_password
17+
mysql.sys caching_sha2_password
1818
root caching_sha2_password
1919

2020
# Set the password for the root user

mysql-test/suite/auth_sec/r/skip_grant_protocols_windows.result

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ current_user
1212
root@localhost
1313
SELECT user, plugin FROM mysql.user;
1414
user plugin
15-
mysql.infoschema mysql_native_password
16-
mysql.session mysql_native_password
17-
mysql.sys mysql_native_password
15+
mysql.infoschema caching_sha2_password
16+
mysql.session caching_sha2_password
17+
mysql.sys caching_sha2_password
1818
root caching_sha2_password
1919

2020
# Set the password for the root user

mysql-test/t/transactional_acl_tables.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2125,7 +2125,7 @@ CREATE TABLE IF NOT EXISTS mysql.user ( Host char(60) binary DEFAULT '' NOT NU
21252125
max_updates int(11) unsigned DEFAULT 0 NOT NULL,
21262126
max_connections int(11) unsigned DEFAULT 0 NOT NULL,
21272127
max_user_connections int(11) unsigned DEFAULT 0 NOT NULL,
2128-
plugin char(64) DEFAULT 'mysql_native_password', authentication_string TEXT,
2128+
plugin char(64) DEFAULT 'caching_sha2_password', authentication_string TEXT,
21292129
password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
21302130
PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin
21312131
comment='Users and global privileges';
@@ -2322,7 +2322,7 @@ RENAME TABLE mysql.tables_priv_bak TO mysql.tables_priv;
23222322
INSERT IGNORE INTO mysql.user VALUES ('localhost','mysql.session',
23232323
'N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N',
23242324
'N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,
2325-
'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE',
2325+
'caching_sha2_password','$A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED',
23262326
'N',CURRENT_TIMESTAMP,NULL,'Y', 'N', 'N', NULL, NULL);
23272327
INSERT IGNORE INTO mysql.tables_priv VALUES ('localhost', 'mysql',
23282328
'mysql.session', 'user', 'root\@localhost',

packaging/rpm-docker/mysql.spec.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ rm -r $(readlink var) var
376376
%attr(644, root, root) %{_datadir}/mysql-*/fill_help_tables.sql
377377
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables.sql
378378
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables_data.sql
379+
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_users.sql
379380
%attr(644, root, root) %{_datadir}/mysql-*/mysql_sys_schema.sql
380381
%attr(644, root, root) %{_datadir}/mysql-*/mysql_test_data_timezone.sql
381382
%attr(644, root, root) %{_datadir}/mysql-*/dictionary.txt

packaging/rpm-fedora/mysql.spec.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ datadir=$(/usr/bin/my_print_defaults server mysqld | grep '^--datadir=' | sed -n
720720
%attr(644, root, root) %{_datadir}/mysql-*/mysql_sys_schema.sql
721721
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables.sql
722722
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables_data.sql
723+
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_users.sql
723724
%attr(644, root, root) %{_datadir}/mysql-*/mysql_test_data_timezone.sql
724725
%attr(644, root, root) %{_datadir}/mysql-*/mysql-log-rotate
725726
%attr(644, root, root) %{_datadir}/mysql-*/dictionary.txt

packaging/rpm-oel/mysql.spec.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,6 +1036,7 @@ fi
10361036
%attr(644, root, root) %{_datadir}/mysql-*/mysql_sys_schema.sql
10371037
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables.sql
10381038
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables_data.sql
1039+
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_users.sql
10391040
%attr(644, root, root) %{_datadir}/mysql-*/mysql_test_data_timezone.sql
10401041
%attr(644, root, root) %{_datadir}/mysql-*/mysql-log-rotate
10411042
%attr(644, root, root) %{_datadir}/mysql-*/dictionary.txt

packaging/rpm-sles/mysql.spec.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,7 @@ fi
886886
%attr(644, root, root) %{_datadir}/mysql-*/mysql_sys_schema.sql
887887
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables.sql
888888
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_tables_data.sql
889+
%attr(644, root, root) %{_datadir}/mysql-*/mysql_system_users.sql
889890
%attr(644, root, root) %{_datadir}/mysql-*/mysql_test_data_timezone.sql
890891
%attr(644, root, root) %{_datadir}/mysql-*/mysql-log-rotate
891892
%attr(644, root, root) %{_datadir}/mysql-*/dictionary.txt

scripts/CMakeLists.txt

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved.
2-
#
1+
# Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved.
2+
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0,
55
# as published by the Free Software Foundation.
@@ -64,7 +64,7 @@ IF(NOT WIN32 OR CMAKE_CROSSCOMPILING)
6464
ENDIF()
6565

6666
IF(CAT_EXECUTABLE)
67-
SET(CAT_COMMAND COMMAND
67+
SET(CAT_COMMAND COMMAND
6868
${CMAKE_COMMAND} -E chdir ${CMAKE_CURRENT_SOURCE_DIR}
6969
${CAT_EXECUTABLE} mysql_system_tables.sql mysql_system_tables_fix.sql >
7070
${CMAKE_CURRENT_BINARY_DIR}/mysql_fix_privilege_tables.sql
@@ -170,6 +170,17 @@ ADD_CUSTOM_COMMAND(
170170
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
171171
)
172172

173+
ADD_CUSTOM_COMMAND(
174+
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sql_commands_system_users.h
175+
COMMAND comp_sql
176+
mysql_system_users
177+
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_users.sql
178+
sql_commands_system_users.h
179+
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
180+
DEPENDS comp_sql
181+
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_users.sql
182+
)
183+
173184
ADD_CUSTOM_COMMAND(
174185
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sql_commands_help_data.h
175186
COMMAND comp_sql
@@ -187,13 +198,14 @@ IF(NOT WITHOUT_SERVER)
187198
ALL
188199
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/sql_commands_system_data.h
189200
${CMAKE_CURRENT_BINARY_DIR}/sql_commands_system_tables.h
201+
${CMAKE_CURRENT_BINARY_DIR}/sql_commands_system_users.h
190202
${CMAKE_CURRENT_BINARY_DIR}/sql_commands_help_data.h
191203
${CMAKE_CURRENT_BINARY_DIR}/sql_commands_system_tables_data_fix.h
192204
)
193205
ENDIF()
194206

195207
IF(UNIX)
196-
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
208+
FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
197209
"cd ${CMAKE_BINARY_DIR} && '${CMAKE_CPACK_COMMAND}' -G TGZ --config CPackConfig.cmake\n" )
198210
EXECUTE_PROCESS(
199211
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/make_binary_distribution
@@ -203,6 +215,7 @@ ENDIF()
203215
IF(NOT WITHOUT_SERVER)
204216
INSTALL(FILES
205217
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables.sql
218+
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_users.sql
206219
${CMAKE_CURRENT_SOURCE_DIR}/mysql_system_tables_data.sql
207220
${CMAKE_CURRENT_SOURCE_DIR}/fill_help_tables.sql
208221
${CMAKE_CURRENT_SOURCE_DIR}/mysql_sys_schema.sql
@@ -276,18 +289,18 @@ ELSE()
276289
ENDIF()
277290

278291
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
279-
SET (FIND_PROC
292+
SET (FIND_PROC
280293
"ps wwwp $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
281294
ENDIF()
282295
IF(NOT FIND_PROC AND CMAKE_SYSTEM_NAME MATCHES "SunOS")
283-
SET (FIND_PROC
296+
SET (FIND_PROC
284297
"ps -p $PID | grep -v mysqld_safe | grep -- $MYSQLD > /dev/null")
285298
ENDIF()
286299

287300
IF(NOT FIND_PROC)
288301
# BSD styl
289302
EXECUTE_PROCESS(COMMAND ps -uaxww OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
290-
IF(result MATCHES 0)
303+
IF(result MATCHES 0)
291304
SET( FIND_PROC
292305
"ps -uaxww | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
293306
ENDIF()
@@ -300,7 +313,7 @@ IF(NOT FIND_PROC)
300313
SET( FIND_PROC "ps -ef | grep -v mysqld_safe | grep -- $MYSQLD | grep $PID > /dev/null")
301314
ENDIF()
302315
ENDIF()
303-
316+
304317
EXECUTE_PROCESS(COMMAND sh -c "kill -0 $$" OUTPUT_QUIET ERROR_QUIET RESULT_VARIABLE result)
305318
IF(result MATCHES 0)
306319
SET(CHECK_PID "kill -0 $PID > /dev/null 2> /dev/null")
@@ -351,7 +364,7 @@ ELSE()
351364
SET(TARGET_LINUX "false")
352365
ENDIF()
353366

354-
# Use cmake variables to inspect dependencies for
367+
# Use cmake variables to inspect dependencies for
355368
# mysqlclient library (add -l stuff)
356369
SET(CLIENT_LIBS "")
357370
SET(LIBS "")
@@ -366,14 +379,14 @@ MACRO(EXTRACT_LINK_LIBRARIES target var)
366379
# Filter out "general", it is not a library, just CMake hint
367380
IF(NOT lib STREQUAL "general" AND NOT ${var} MATCHES "-l${lib} ")
368381
IF (lib MATCHES "^\\-l")
369-
SET(${var} "${${var}} ${lib} ")
382+
SET(${var} "${${var}} ${lib} ")
370383
ELSEIF(lib MATCHES "^/")
371384
# Full path, convert to just filename, strip "lib" prefix and extension
372385
GET_FILENAME_COMPONENT(lib "${lib}" NAME_WE)
373386
STRING(REGEX REPLACE "^lib" "" lib "${lib}")
374-
SET(${var} "${${var}}-l${lib} " )
387+
SET(${var} "${${var}}-l${lib} " )
375388
ELSE()
376-
SET(${var} "${${var}}-l${lib} " )
389+
SET(${var} "${${var}}-l${lib} " )
377390
ENDIF()
378391
ENDIF()
379392
ENDFOREACH()
@@ -424,7 +437,7 @@ MESSAGE(STATUS "CONFIG_LIBS_PRIVATE ${CONFIG_LIBS_PRIVATE}")
424437
SET(mysql_config_COMPONENT COMPONENT Development)
425438

426439
IF(WIN32)
427-
# On Windows, some .sh and some .pl.in files are configured
440+
# On Windows, some .sh and some .pl.in files are configured
428441
# The resulting files will have .pl extension (those are perl scripts)
429442

430443
# Input files with pl.in extension
@@ -508,7 +521,7 @@ ELSE()
508521
SET(${file}_COMPONENT Server)
509522
ENDIF()
510523
INSTALL_SCRIPT(
511-
${CMAKE_CURRENT_BINARY_DIR}/${file}
524+
${CMAKE_CURRENT_BINARY_DIR}/${file}
512525
DESTINATION ${INSTALL_BINDIR}
513526
COMPONENT ${${file}_COMPONENT}
514527
)

scripts/mysql_sys_schema.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
-- PLEASE SUBMIT A PULL REQUEST TO https://github.com/mysql/mysql-sys
2626
--
2727

28-
REPLACE INTO mysql.user VALUES ('localhost','mysql.sys','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE','N',CURRENT_TIMESTAMP,NULL,'Y','N','N',NULL,NULL);
28+
REPLACE INTO mysql.user VALUES ('localhost','mysql.sys','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,'caching_sha2_password','$A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED','N',CURRENT_TIMESTAMP,NULL,'Y','N','N',NULL,NULL);
2929

3030
REPLACE INTO mysql.db VALUES ('localhost','sys','mysql.sys','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y');
3131

scripts/mysql_system_tables_fix.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ SET @old_sql_mode = @@session.sql_mode, @@session.sql_mode = '';
4747

4848
INSERT IGNORE INTO mysql.user
4949
(host, user, select_priv, plugin, authentication_string, ssl_cipher, x509_issuer, x509_subject)
50-
VALUES ('localhost','mysql.infoschema','Y','mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE','','','');
50+
VALUES ('localhost','mysql.infoschema','Y','caching_sha2_password','$A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED','','','');
5151

5252
FLUSH PRIVILEGES;
5353

@@ -628,7 +628,7 @@ SET GLOBAL automatic_sp_privileges = @global_automatic_sp_privileges;
628628
--
629629

630630
ALTER TABLE user ADD password_last_changed timestamp NULL;
631-
UPDATE user SET password_last_changed = CURRENT_TIMESTAMP WHERE plugin in ('mysql_native_password','sha256_password') and password_last_changed is NULL;
631+
UPDATE user SET password_last_changed = CURRENT_TIMESTAMP WHERE plugin in ('caching_sha2_password','mysql_native_password','sha256_password') and password_last_changed is NULL;
632632

633633
ALTER TABLE user ADD password_lifetime smallint unsigned NULL;
634634

@@ -993,7 +993,7 @@ DROP PREPARE stmt;
993993
# tables the mysql.user table.
994994
#
995995

996-
INSERT IGNORE INTO mysql.user VALUES ('localhost','mysql.session','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,'mysql_native_password','*THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE','N',CURRENT_TIMESTAMP,NULL,'Y', 'N', 'N', NULL, NULL);
996+
INSERT IGNORE INTO mysql.user VALUES ('localhost','mysql.session','N','N','N','N','N','N','N','N','N','N','N','N','N','N','N','Y','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','',0,0,0,0,'caching_sha2_password','$A$001$THISISACOMBINATIONOFINVALIDSALTANDPASSWORDTHATMUSTNEVERBRBEUSED','N',CURRENT_TIMESTAMP,NULL,'Y', 'N', 'N', NULL, NULL);
997997

998998
UPDATE user SET Create_role_priv= 'N', Drop_role_priv= 'N' WHERE User= 'mysql.session';
999999

0 commit comments

Comments
 (0)