Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
186a9fc7
Commit
186a9fc7
authored
Oct 31, 2013
by
Venkata Sidagam
Browse files
Options
Browse Files
Download
Plain Diff
Bug #12917164 DROP USER CAN'T DROP USERS WITH LEGACY
UPPER CASE HOST NAME ANYMORE Merging from mysql-5.1 to mysql-5.5
parents
6e059fd1
19990c92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
scripts/mysql_system_tables_data.sql
scripts/mysql_system_tables_data.sql
+3
-4
scripts/mysql_system_tables_fix.sql
scripts/mysql_system_tables_fix.sql
+2
-0
No files found.
scripts/mysql_system_tables_data.sql
View file @
186a9fc7
...
...
@@ -24,8 +24,7 @@
-- Get the hostname, if the hostname has any wildcard character like "_" or "%"
-- add escape character in front of wildcard character to convert "_" or "%" to
-- a plain character
SET
@
get_hostname
=
@@
hostname
;
SELECT
REPLACE
((
SELECT
REPLACE
(
@
get_hostname
,
'_'
,
'
\_
'
)),
'%'
,
'
\%
'
)
INTO
@
current_hostname
;
SELECT
LOWER
(
REPLACE
((
SELECT
REPLACE
(
@@
hostname
,
'_'
,
'
\_
'
)),
'%'
,
'
\%
'
)
)
INTO
@
current_hostname
;
-- Fill "db" table with default grants for anyone to
...
...
@@ -41,11 +40,11 @@ DROP TABLE tmp_db;
-- from local machine if "user" table didn't exist before
CREATE
TEMPORARY
TABLE
tmp_user
LIKE
user
;
INSERT
INTO
t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Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
''
,
''
,
''
,
''
,
0
,
0
,
0
,
0
,
''
,
''
);
REPLACE
INTO
tmp_user
VALUES
(
'::1'
,
'root'
,
''
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
'Y'
,
''
,
''
,
''
,
''
,
0
,
0
,
0
,
0
,
''
,
''
);
INSERT
INTO
tmp_user
(
host
,
user
)
VALUES
(
'localhost'
,
''
);
INSERT
INTO
tmp_user
(
host
,
user
)
SELECT
@
current_hostname
,
''
FROM
dual
WHERE
LOWER
(
@
current_hostname
)
!=
'localhost'
;
INSERT
INTO
tmp_user
(
host
,
user
)
SELECT
@
current_hostname
,
''
FROM
dual
WHERE
@
current_hostname
!=
'localhost'
;
INSERT
INTO
user
SELECT
*
FROM
tmp_user
WHERE
@
had_user_table
=
0
;
DROP
TABLE
tmp_user
;
...
...
scripts/mysql_system_tables_fix.sql
View file @
186a9fc7
...
...
@@ -652,6 +652,8 @@ INSERT INTO tmp_proxies_priv VALUES ('localhost', 'root', '', '', TRUE, '', now(
INSERT
INTO
proxies_priv
SELECT
*
FROM
tmp_proxies_priv
WHERE
@
had_proxies_priv_table
=
0
;
DROP
TABLE
tmp_proxies_priv
;
#
Convering
the
host
name
to
lower
case
for
existing
users
UPDATE
user
SET
host
=
LOWER
(
host
)
WHERE
LOWER
(
host
)
<>
host
;
#
Activate
the
new
,
possible
modified
privilege
tables
#
This
should
not
be
needed
,
but
gives
us
some
extra
testing
that
the
above
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment