mirror of
https://github.com/MariaDB/server.git
synced 2025-06-15 00:02:46 +03:00
A patch for Bug#52444 (mysql_upgrade fails b/w 5.1 -> 5.5 (Celosia)).
The problem was that the code that works with stored routines was present in mysql_system_tables.sql. This is wrong because until upgrade is finished, stored routines may be (and were) not available. The fix is to move that code to the end of mysql_system_tables_fix.sql.
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
--
|
||||
-- The system tables of MySQL Server
|
||||
@ -160,26 +160,6 @@ PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
DROP PREPARE stmt;
|
||||
|
||||
--
|
||||
-- Unlike 'performance_schema', the 'mysql' database is reserved already,
|
||||
-- so no user procedure is supposed to be there
|
||||
--
|
||||
drop procedure if exists mysql.die;
|
||||
create procedure mysql.die() signal sqlstate 'HY000' set message_text='Unexpected content found in the performance_schema database.';
|
||||
|
||||
--
|
||||
-- For broken upgrades, SIGNAL the error
|
||||
--
|
||||
|
||||
SET @cmd="call mysql.die()";
|
||||
|
||||
SET @str = IF(@broken_pfs > 0, @cmd, 'SET @dummy = 0');
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
DROP PREPARE stmt;
|
||||
|
||||
drop procedure mysql.die;
|
||||
|
||||
--
|
||||
-- From this point, only create the performance schema tables
|
||||
-- if the server is build with performance schema
|
||||
|
@ -1,3 +1,18 @@
|
||||
-- Copyright (C) 2008, 2010 Oracle and/or its affiliates. All rights reserved.
|
||||
--
|
||||
-- This program is free software; you can redistribute it and/or modify
|
||||
-- it under the terms of the GNU General Public License as published by
|
||||
-- the Free Software Foundation; version 2 of the License.
|
||||
--
|
||||
-- This program is distributed in the hope that it will be useful,
|
||||
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
-- GNU General Public License for more details.
|
||||
--
|
||||
-- You should have received a copy of the GNU General Public License
|
||||
-- along with this program; if not, write to the Free Software
|
||||
-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# This part converts any old privilege tables to privilege tables suitable
|
||||
# for current version of MySQL
|
||||
|
||||
@ -604,6 +619,29 @@ ALTER TABLE user MODIFY Create_tablespace_priv enum('N','Y') COLLATE utf8_genera
|
||||
|
||||
UPDATE user SET Create_tablespace_priv = Super_priv WHERE @hadCreateTablespacePriv = 0;
|
||||
|
||||
--
|
||||
-- Unlike 'performance_schema', the 'mysql' database is reserved already,
|
||||
-- so no user procedure is supposed to be there.
|
||||
--
|
||||
-- NOTE: until upgrade is finished, stored routines are not available,
|
||||
-- because system tables (e.g. mysql.proc) might be not usable.
|
||||
--
|
||||
drop procedure if exists mysql.die;
|
||||
create procedure mysql.die() signal sqlstate 'HY000' set message_text='Unexpected content found in the performance_schema database.';
|
||||
|
||||
--
|
||||
-- For broken upgrades, SIGNAL the error
|
||||
--
|
||||
|
||||
SET @cmd="call mysql.die()";
|
||||
|
||||
SET @str = IF(@broken_pfs > 0, @cmd, 'SET @dummy = 0');
|
||||
PREPARE stmt FROM @str;
|
||||
EXECUTE stmt;
|
||||
DROP PREPARE stmt;
|
||||
|
||||
drop procedure mysql.die;
|
||||
|
||||
# Activate the new, possible modified privilege tables
|
||||
# This should not be needed, but gives us some extra testing that the above
|
||||
# changes was correct
|
||||
|
Reference in New Issue
Block a user