1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00
scripts/mysql_fix_privilege_tables.sql:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
configure.in:
  merge
This commit is contained in:
unknown
2005-04-25 22:21:25 +02:00
151 changed files with 2547 additions and 1546 deletions

View File

@ -9,7 +9,7 @@
-- this sql script.
-- On windows you should do 'mysql --force mysql < mysql_fix_privilege_tables.sql'
set table_type=MyISAM;
set storage_engine=MyISAM;
CREATE TABLE IF NOT EXISTS func (
name char(64) binary DEFAULT '' NOT NULL,
@ -64,7 +64,7 @@ CREATE TABLE IF NOT EXISTS tables_priv (
ALTER TABLE tables_priv
modify Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter') COLLATE utf8_general_ci DEFAULT '' NOT NULL,
modify Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
ALTER TABLE procs_priv type=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE procs_priv ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE procs_priv
modify Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL;
@ -320,19 +320,19 @@ KEY Grantor (Grantor)
CREATE TABLE IF NOT EXISTS help_topic (
help_topic_id int unsigned not null,
name char(64) not null,
name varchar(64) not null,
help_category_id smallint unsigned not null,
description text not null,
example text not null,
url char(128) not null,
url varchar(128) not null,
primary key (help_topic_id), unique index (name)
) CHARACTER SET utf8 comment='help topics';
CREATE TABLE IF NOT EXISTS help_category (
help_category_id smallint unsigned not null,
name char(64) not null,
name varchar(64) not null,
parent_category_id smallint unsigned null,
url char(128) not null,
url varchar(128) not null,
primary key (help_category_id),
unique index (name)
) CHARACTER SET utf8 comment='help categories';
@ -345,7 +345,7 @@ primary key (help_keyword_id, help_topic_id)
CREATE TABLE IF NOT EXISTS help_keyword (
help_keyword_id int unsigned not null,
name char(64) not null,
name varchar(64) not null,
primary key (help_keyword_id),
unique index (name)
) CHARACTER SET utf8 comment='help keywords';
@ -492,35 +492,3 @@ ALTER TABLE proc MODIFY name char(64) DEFAULT '' NOT NULL,
'NO_AUTO_CREATE_USER',
'HIGH_NOT_PRECEDENCE'
) DEFAULT 0 NOT NULL;
#
# Change all varchar fields in privilege tables to CHAR, to ensure that
# we can use the privilege tables in MySQL 4.1
# Note that for this hack to work, we must change all CHAR() columns at
# the same time
#
ALTER TABLE mysql.user
modify Host char(60) binary DEFAULT '' NOT NULL,
modify User char(16) binary DEFAULT '' NOT NULL,
modify Password char(41) binary DEFAULT '' NOT NULL;
ALTER TABLE mysql.db
modify Host char(60) binary DEFAULT '' NOT NULL,
modify Db char(64) binary DEFAULT '' NOT NULL,
modify User char(16) binary DEFAULT '' NOT NULL;
ALTER TABLE mysql.host
modify Host char(60) binary DEFAULT '' NOT NULL,
modify Db char(64) binary DEFAULT '' NOT NULL;
ALTER TABLE help_topic
modify name char(64) not null,
modify url char(128) not null;
ALTER TABLE help_category
modify name char(64) not null,
modify url char(128) not null;
ALTER TABLE help_keyword
modify name char(64) not null;

View File

@ -6,6 +6,14 @@ use DBI;
=head1 NAME
WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA
pseudo-database which contains always up-to-date metadata information
about all tables. So instead of using this script one can now
simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES,
INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables.
Please see the MySQL manual for more information about INFORMATION_SCHEMA.
This script will be removed from the MySQL distribution in version 5.1.
mysql_tableinfo - creates and populates information tables with
the output of SHOW DATABASES, SHOW TABLES (or SHOW TABLE STATUS),
SHOW COLUMNS and SHOW INDEX.
@ -62,6 +70,19 @@ GetOptions( \%opt,
"quiet|q",
) or usage("Invalid option");
if (!$opt{'quiet'})
{
print <<EOF
WARNING: MySQL versions 5.0 and above feature the INFORMATION_SCHEMA
pseudo-database which contains always up-to-date metadata information
about all tables. So instead of using this script one can now
simply query the INFORMATION_SCHEMA.SCHEMATA, INFORMATION_SCHEMA.TABLES,
INFORMATION_SCHEMA.COLUMNS, INFORMATION_SCHEMA.STATISTICS pseudo-tables.
Please see the MySQL manual for more information about INFORMATION_SCHEMA.
This script will be removed from the MySQL distribution in version 5.1.
EOF
}
if ($opt{'help'}) {usage();}
my ($db_to_write,$db_like_wild,$tbl_like_wild);
@ -104,7 +125,7 @@ $tbl_like_wild=$dbh->quote($tbl_like_wild);
if (!$opt{'quiet'})
{
print "\n!! This program is doing to do:\n\n";
print "\n!! This program is going to do:\n\n";
print "**DROP** TABLE ...\n" if ($opt{'clear'} or $opt{'clear-only'});
print "**DELETE** FROM ... WHERE `Database` LIKE $db_like_wild AND `Table` LIKE $tbl_like_wild
**INSERT** INTO ...
@ -456,17 +477,14 @@ UNIX domain socket to use when connecting to server
=head1 WARRANTY
This software is free and comes without warranty of any kind. You
should never trust backup software without studying the code yourself.
Study the code inside this script and only rely on it if I<you> believe
that it does the right thing for you.
This software is free and comes without warranty of any kind.
Patches adding bug fixes, documentation and new features are welcome.
=head1 TO DO
Use extended inserts to be faster (for servers with many databases
or tables). But to do that, must care about net-buffer-length.
Nothing: starting from MySQL 5.0, this program is replaced by the
INFORMATION_SCHEMA pseudo-database.
=head1 AUTHOR