mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge trift2.:/MySQL/M51/mysql-5.1
into trift2.:/MySQL/M51/push-5.1 configure.in: Auto merged mysql-test/t/disabled.def: Auto merged sql/field.cc: Auto merged sql/log_event.cc: Auto merged sql/log_event.h: Auto merged sql/rpl_record.cc: Auto merged sql/rpl_utility.cc: Auto merged sql/rpl_utility.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_cache.cc: Auto merged
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
-- The system tables of MySQL Server
|
||||
--
|
||||
|
||||
set sql_mode='';
|
||||
set storage_engine=myisam;
|
||||
|
||||
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 NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges';
|
||||
|
@ -821,30 +821,14 @@ sub get_raid_dirs {
|
||||
sub get_list_of_tables {
|
||||
my ( $db ) = @_;
|
||||
|
||||
# "use database" cannot cope with database names containing spaces
|
||||
# so create a new connection
|
||||
my $tables =
|
||||
eval {
|
||||
$dbh->selectall_arrayref('SHOW TABLES FROM ' .
|
||||
$dbh->quote_identifier($db))
|
||||
} || [];
|
||||
warn "Unable to retrieve list of tables in $db: $@" if $@;
|
||||
|
||||
my $dbh = DBI->connect("dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy",
|
||||
$opt{user}, $opt{password},
|
||||
{
|
||||
RaiseError => 1,
|
||||
PrintError => 0,
|
||||
AutoCommit => 1,
|
||||
});
|
||||
|
||||
my @dbh_tables = eval { $dbh->tables() };
|
||||
|
||||
## Remove quotes around table names
|
||||
my $quote = $dbh->get_info(29); # SQL_IDENTIFIER_QUOTE_CHAR
|
||||
if ($quote) {
|
||||
foreach (@dbh_tables) {
|
||||
s/^$quote(.*)$quote$/$1/;
|
||||
s/$quote$quote/$quote/g;
|
||||
}
|
||||
}
|
||||
|
||||
$dbh->disconnect();
|
||||
return @dbh_tables;
|
||||
return (map { $_->[0] } @$tables);
|
||||
}
|
||||
|
||||
sub quote_names {
|
||||
|
Reference in New Issue
Block a user