1
0
mirror of https://github.com/MariaDB/server.git synced 2026-01-06 05:22:24 +03:00

Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH

("-") IN DATABASE NAMES IN ALTER DATABASE.

mysqldump did not quote database name in 'ALTER DATABASE'
statements in its output. This can further cause a failure
while loading if database name contains a hyphen '-'.

This happened as, while printing the 'ALTER DATABASE'
statements, the database name was not quoted.

Fixed by quoting the database name.
This commit is contained in:
Nirbhay Choubey
2011-02-21 12:37:24 +05:30
parent cd3a8131c6
commit a8e6f7c67b
3 changed files with 65 additions and 2 deletions

View File

@@ -2173,6 +2173,27 @@ CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE CO
--exec $MYSQL_DUMP --compact --skip-create --xml test
DROP TABLE `comment_table`;
--echo #
--echo # BUG#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH ("-") IN
--echo # DATABASE NAMES IN ALTER DATABASE
--echo #
CREATE DATABASE `test-database`;
USE `test-database`;
CREATE TABLE `test` (`c1` VARCHAR(10)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DELIMITER |;
CREATE TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN
END |
DELIMITER ;|
ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci;
ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
--exec $MYSQL_DUMP --quote-names --compact test-database
DROP DATABASE `test-database`;
--echo #
--echo # End of 5.1 tests
--echo #