summaryrefslogtreecommitdiff
path: root/mysql-test/r/mysqldump.result
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay.choubey@sun.com>2011-02-21 12:37:24 +0530
committerNirbhay Choubey <nirbhay.choubey@sun.com>2011-02-21 12:37:24 +0530
commit876502d7439f3cf34d8554d22f28f06bf8b54388 (patch)
tree11f3ed8bb9928c0db061b1c08166002fd284f2b7 /mysql-test/r/mysqldump.result
parente2e6eb8f6d3dabbf335870efa29fcb77248ab156 (diff)
downloadmariadb-git-876502d7439f3cf34d8554d22f28f06bf8b54388.tar.gz
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. client/mysqldump.c: Bug#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH ("-") IN DATABASE NAMES IN ALTER DATABASE. Modified the print statement in order to print the quoted database name for 'ALTER DATABASE' statements. mysql-test/r/mysqldump.result: Added a test case for bug#11766310. mysql-test/t/mysqldump.test: Added a test case for bug#11766310.
Diffstat (limited to 'mysql-test/r/mysqldump.result')
-rw-r--r--mysql-test/r/mysqldump.result36
1 files changed, 36 insertions, 0 deletions
diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result
index 289e7f66406..fb70e0f1731 100644
--- a/mysql-test/r/mysqldump.result
+++ b/mysql-test/r/mysqldump.result
@@ -4591,5 +4591,41 @@ CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE CO
</mysqldump>
DROP TABLE `comment_table`;
#
+# BUG#11766310 : 59398: MYSQLDUMP 5.1 CAN'T HANDLE A DASH ("-") IN
+# DATABASE NAMES IN ALTER DATABASE
+#
+CREATE DATABASE `test-database`;
+USE `test-database`;
+CREATE TABLE `test` (`c1` VARCHAR(10)) ENGINE=MYISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+CREATE TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN
+END |
+ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+/*!40101 SET @saved_cs_client = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `test` (
+ `c1` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+ALTER DATABASE `test-database` CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
+/*!50003 SET @saved_cs_client = @@character_set_client */ ;
+/*!50003 SET @saved_cs_results = @@character_set_results */ ;
+/*!50003 SET @saved_col_connection = @@collation_connection */ ;
+/*!50003 SET character_set_client = latin1 */ ;
+/*!50003 SET character_set_results = latin1 */ ;
+/*!50003 SET collation_connection = latin1_swedish_ci */ ;
+/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
+/*!50003 SET sql_mode = '' */ ;
+DELIMITER ;;
+/*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER `trig` BEFORE INSERT ON `test` FOR EACH ROW BEGIN
+END */;;
+DELIMITER ;
+/*!50003 SET sql_mode = @saved_sql_mode */ ;
+/*!50003 SET character_set_client = @saved_cs_client */ ;
+/*!50003 SET character_set_results = @saved_cs_results */ ;
+/*!50003 SET collation_connection = @saved_col_connection */ ;
+ALTER DATABASE `test-database` CHARACTER SET utf8 COLLATE utf8_unicode_ci ;
+DROP DATABASE `test-database`;
+#
# End of 5.1 tests
#