summaryrefslogtreecommitdiff
path: root/scripts/mysql_system_tables.sql
diff options
context:
space:
mode:
authorRobert Bindar <robert@mariadb.org>2021-02-02 14:57:16 +0200
committerRobert Bindar <robert@mariadb.org>2021-03-08 12:07:06 +0200
commit363ba107842127c8b23869b314a285e914f4a74f (patch)
tree47cf2e27cf19187408644f0d4da73a7ed33b9fb3 /scripts/mysql_system_tables.sql
parenta26e7a37266d8296094dabca52f0f6646fd73926 (diff)
downloadmariadb-git-363ba107842127c8b23869b314a285e914f4a74f.tar.gz
MDEV-24363 mysql.user password_expired column is incorrect
The mysql.user view password_expired column should display the right result, in sync with whether an account has its password expired or not For mariadb 10.4+ upgrades before this commit, the mysql.user view needs to be dropped and recreated to actually make the view display the correct value for the password_expired column.
Diffstat (limited to 'scripts/mysql_system_tables.sql')
-rw-r--r--scripts/mysql_system_tables.sql2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index d4d16c74c11..020385992ea 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -93,7 +93,7 @@ CREATE DEFINER='mariadb.sys'@'localhost' SQL SECURITY DEFINER VIEW IF NOT EXISTS
CAST(IFNULL(JSON_VALUE(Priv, '$.max_user_connections'), 0) AS SIGNED) AS max_user_connections,
IFNULL(JSON_VALUE(Priv, '$.plugin'), '') AS plugin,
IFNULL(JSON_VALUE(Priv, '$.authentication_string'), '') AS authentication_string,
- 'N' AS password_expired,
+ IF(IFNULL(JSON_VALUE(Priv, '$.password_last_changed'), 1) = 0, 'Y', 'N') AS password_expired,
ELT(IFNULL(JSON_VALUE(Priv, '$.is_role'), 0) + 1, 'N', 'Y') AS is_role,
IFNULL(JSON_VALUE(Priv, '$.default_role'), '') AS default_role,
CAST(IFNULL(JSON_VALUE(Priv, '$.max_statement_time'), 0.0) AS DECIMAL(12,6)) AS max_statement_time