1
1
const char* mysql_fix_privilege_tables={
2
"-- Copyright (c) 2007, 2008 MySQL AB, 2009 Sun Microsystems, Inc.\n "
3
"-- Use is subject to license terms.\n "
5
"-- This program is free software; you can redistribute it and/or modify\n "
6
"-- it under the terms of the GNU General Public License as published by\n "
7
"-- the Free Software Foundation; version 2 of the License.\n "
9
"-- This program is distributed in the hope that it will be useful,\n "
10
"-- but WITHOUT ANY WARRANTY; without even the implied warranty of\n "
11
"-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n "
12
"-- GNU General Public License for more details.\n "
14
"-- You should have received a copy of the GNU General Public License\n "
15
"-- along with this program; if not, write to the Free Software\n "
16
"-- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n "
3
19
"-- The system tables of MySQL Server\n "
6
23
"set storage_engine=myisam;\n "
8
25
"CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT"
71
88
"H_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE' ) DEFAULT '' NOT NULL, comment char(64) collate utf8_bin DEFAULT '' NOT NULL, PRIMARY KEY (db,name,type) ) engine=MyISAM character set utf8 comment='Stored Procedures';\n "
74
"CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) binary DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyI"
75
"SAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';\n "
91
"CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(16) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(77) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp(14), PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Gran"
92
"tor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges';\n "
94
"# Copyright (c) 2003, 2007 MySQL AB, 2009 Sun Microsystems, Inc.\n "
95
"# Use is subject to license terms.\n "
97
"# This program is free software; you can redistribute it and/or modify\n "
98
"# it under the terms of the GNU General Public License as published by\n "
99
"# the Free Software Foundation; version 2 of the License.\n "
101
"# This program is distributed in the hope that it will be useful,\n "
102
"# but WITHOUT ANY WARRANTY; without even the implied warranty of\n "
103
"# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n "
104
"# GNU General Public License for more details.\n "
106
"# You should have received a copy of the GNU General Public License\n "
107
"# along with this program; if not, write to the Free Software\n "
108
"# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n "
77
110
"# This part converts any old privilege tables to privilege tables suitable\n "
78
111
"# for current version of MySQL\n "
399
432
" MODIFY Proc_priv set('Execute','Alter Routine','Grant')\n "
400
433
" COLLATE utf8_general_ci DEFAULT '' NOT NULL;\n "
435
"ALTER IGNORE TABLE procs_priv\n "
436
" MODIFY Routine_name char(64)\n "
437
" COLLATE utf8_general_ci DEFAULT '' NOT NULL;\n "
402
439
"ALTER TABLE procs_priv\n "
403
440
" ADD Routine_type enum('FUNCTION','PROCEDURE')\n "
404
441
" COLLATE utf8_general_ci NOT NULL AFTER Routine_name;\n "