forked from hepabolu/mytap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MariaDB can now use mytap-user functions (hepabolu#41)
- Loading branch information
Michał Sadowski
committed
Oct 28, 2019
1 parent
00f14b1
commit 662c0d9
Showing
5 changed files
with
71 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* References: | ||
- https://jira.mariadb.org/browse/MDEV-10959 | ||
- https://mariadb.com/kb/en/library/account-locking/ | ||
*/ | ||
|
||
DROP VIEW IF EXISTS tap.mysql__user; | ||
CREATE SQL SECURITY INVOKER VIEW tap.mysql__user AS | ||
SELECT | ||
u.`user` | ||
, u.`host` | ||
/* ... */ | ||
, u.`password_expired` | ||
, CASE JSON_EXTRACT(gp.Priv, '$.account_locked') | ||
WHEN TRUE THEN 'Y' | ||
ELSE 'N' | ||
END AS `account_locked` | ||
, JSON_EXTRACT(gp.Priv, '$.password_lifetime') AS password_lifetime | ||
FROM | ||
`mysql`.`user` AS u | ||
JOIN `mysql`.`global_priv` AS gp USING (`user`) | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
DROP VIEW IF EXISTS tap.mysql__user; | ||
CREATE SQL SECURITY INVOKER VIEW tap.mysql__user AS | ||
SELECT * FROM `mysql`.`user` | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters