Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
a5f20712
Commit
a5f20712
authored
Feb 21, 2011
by
Nirbhay Choubey
Browse files
Options
Browse Files
Download
Plain Diff
Merge of fix for bug#11766310 from mysql-5.1 -> mysql-5.5.
parents
b7d30e27
876502d7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
2 deletions
+65
-2
client/mysqldump.c
client/mysqldump.c
+8
-2
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+36
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+21
-0
No files found.
client/mysqldump.c
View file @
a5f20712
...
@@ -1153,6 +1153,9 @@ static int switch_db_collation(FILE *sql_file,
...
@@ -1153,6 +1153,9 @@ static int switch_db_collation(FILE *sql_file,
{
{
if
(
strcmp
(
current_db_cl_name
,
required_db_cl_name
)
!=
0
)
if
(
strcmp
(
current_db_cl_name
,
required_db_cl_name
)
!=
0
)
{
{
char
quoted_db_buf
[
NAME_LEN
*
2
+
3
];
char
*
quoted_db_name
=
quote_name
(
db_name
,
quoted_db_buf
,
FALSE
);
CHARSET_INFO
*
db_cl
=
get_charset_by_name
(
required_db_cl_name
,
MYF
(
0
));
CHARSET_INFO
*
db_cl
=
get_charset_by_name
(
required_db_cl_name
,
MYF
(
0
));
if
(
!
db_cl
)
if
(
!
db_cl
)
...
@@ -1160,7 +1163,7 @@ static int switch_db_collation(FILE *sql_file,
...
@@ -1160,7 +1163,7 @@ static int switch_db_collation(FILE *sql_file,
fprintf
(
sql_file
,
fprintf
(
sql_file
,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s
\n
"
,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s
\n
"
,
(
const
char
*
)
db_name
,
(
const
char
*
)
quoted_
db_name
,
(
const
char
*
)
db_cl
->
csname
,
(
const
char
*
)
db_cl
->
csname
,
(
const
char
*
)
db_cl
->
name
,
(
const
char
*
)
db_cl
->
name
,
(
const
char
*
)
delimiter
);
(
const
char
*
)
delimiter
);
...
@@ -1181,6 +1184,9 @@ static int restore_db_collation(FILE *sql_file,
...
@@ -1181,6 +1184,9 @@ static int restore_db_collation(FILE *sql_file,
const
char
*
delimiter
,
const
char
*
delimiter
,
const
char
*
db_cl_name
)
const
char
*
db_cl_name
)
{
{
char
quoted_db_buf
[
NAME_LEN
*
2
+
3
];
char
*
quoted_db_name
=
quote_name
(
db_name
,
quoted_db_buf
,
FALSE
);
CHARSET_INFO
*
db_cl
=
get_charset_by_name
(
db_cl_name
,
MYF
(
0
));
CHARSET_INFO
*
db_cl
=
get_charset_by_name
(
db_cl_name
,
MYF
(
0
));
if
(
!
db_cl
)
if
(
!
db_cl
)
...
@@ -1188,7 +1194,7 @@ static int restore_db_collation(FILE *sql_file,
...
@@ -1188,7 +1194,7 @@ static int restore_db_collation(FILE *sql_file,
fprintf
(
sql_file
,
fprintf
(
sql_file
,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s
\n
"
,
"ALTER DATABASE %s CHARACTER SET %s COLLATE %s %s
\n
"
,
(
const
char
*
)
db_name
,
(
const
char
*
)
quoted_
db_name
,
(
const
char
*
)
db_cl
->
csname
,
(
const
char
*
)
db_cl
->
csname
,
(
const
char
*
)
db_cl
->
name
,
(
const
char
*
)
db_cl
->
name
,
(
const
char
*
)
delimiter
);
(
const
char
*
)
delimiter
);
...
...
mysql-test/r/mysqldump.result
View file @
a5f20712
...
@@ -4591,5 +4591,41 @@ CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE CO
...
@@ -4591,5 +4591,41 @@ CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE CO
</mysqldump>
</mysqldump>
DROP TABLE `comment_table`;
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
# End of 5.1 tests
#
#
mysql-test/t/mysqldump.test
View file @
a5f20712
...
@@ -2178,6 +2178,27 @@ CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE CO
...
@@ -2178,6 +2178,27 @@ CREATE TABLE `comment_table` (i INT COMMENT 'FIELD COMMENT') COMMENT = 'TABLE CO
--
exec
$MYSQL_DUMP
--
compact
--
skip
-
create
--
xml
test
--
exec
$MYSQL_DUMP
--
compact
--
skip
-
create
--
xml
test
DROP
TABLE
`comment_table`
;
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
#
--
echo
# End of 5.1 tests
--
echo
# End of 5.1 tests
--
echo
#
--
echo
#
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment