summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorunknown <joerg@trift2.>2007-09-04 19:49:42 +0200
committerunknown <joerg@trift2.>2007-09-04 19:49:42 +0200
commit9d109fdef24febbba2c3e3204a2808d6ad8fbce7 (patch)
treedd7bc5f2c7fc8f878670f8dc34a982f1d1bc2606 /scripts
parent03d93ca6fcfb27088855104e973273b5f9324a22 (diff)
parent943ed8fe354734fa52417bf36920462ab23756d3 (diff)
downloadmariadb-git-9d109fdef24febbba2c3e3204a2808d6ad8fbce7.tar.gz
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
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_system_tables.sql1
-rw-r--r--scripts/mysqlhotcopy.sh32
2 files changed, 9 insertions, 24 deletions
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index cd0882e3af4..f7b23e4e7ae 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -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';
diff --git a/scripts/mysqlhotcopy.sh b/scripts/mysqlhotcopy.sh
index 61cd59457d1..6ad5c77b954 100644
--- a/scripts/mysqlhotcopy.sh
+++ b/scripts/mysqlhotcopy.sh
@@ -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 $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;
+ my $tables =
+ eval {
+ $dbh->selectall_arrayref('SHOW TABLES FROM ' .
+ $dbh->quote_identifier($db))
+ } || [];
+ warn "Unable to retrieve list of tables in $db: $@" if $@;
+
+ return (map { $_->[0] } @$tables);
}
sub quote_names {