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
56ea8bfd
Commit
56ea8bfd
authored
Dec 09, 2003
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for the bug #1994: mysqldump does not correctly dump UCS2 data.
parent
adc470c2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
1 deletion
+54
-1
client/mysqldump.c
client/mysqldump.c
+6
-1
mysql-test/r/mysqldump.result
mysql-test/r/mysqldump.result
+39
-0
mysql-test/t/mysqldump.test
mysql-test/t/mysqldump.test
+9
-0
No files found.
client/mysqldump.c
View file @
56ea8bfd
...
...
@@ -89,7 +89,11 @@ static char insert_pat[12 * 1024],*opt_password=0,*current_user=0,
*
where
=
0
,
*
opt_compatible_mode_str
=
0
,
*
err_ptr
=
0
;
#ifdef HAVE_CHARSET_utf8
static
char
*
default_charset
=
(
char
*
)
"utf8"
;
#else
static
char
*
default_charset
=
(
char
*
)
MYSQL_DEFAULT_CHARSET_NAME
;
#endif
static
ulong
opt_compatible_mode
=
0
;
static
uint
opt_mysql_port
=
0
,
err_len
=
0
;
static
my_string
opt_mysql_unix_port
=
0
;
...
...
@@ -351,7 +355,7 @@ static void write_header(FILE *sql_file, char *db_name)
fprintf
(
sql_file
,
"-- Server version
\t
%s
\n
"
,
mysql_get_server_info
(
&
mysql_connection
));
if
(
!
opt_set_names
)
fprintf
(
sql_file
,
"
\n
/*!40101 SET
NAMES %s
*/;
\n
"
,
default_charset
);
fprintf
(
sql_file
,
"
\n
/*!40101 SET
@OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=%s
*/;
\n
"
,
default_charset
);
fprintf
(
md_result_file
,
"\
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
\n
\
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
\n
\
...
...
@@ -372,6 +376,7 @@ static void write_footer(FILE *sql_file)
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
\n
\
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
\n
\
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
\n
\
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
\n
\
"
);
}
fputs
(
"
\n
"
,
sql_file
);
...
...
mysql-test/r/mysqldump.result
View file @
56ea8bfd
...
...
@@ -62,3 +62,42 @@ INSERT INTO t1 VALUES ("1\""), ("\"2");
</database>
</mysqldump>
DROP TABLE t1;
CREATE TABLE t1 (a VARCHAR(255)) DEFAULT CHARSET ucs2;
INSERT INTO t1 VALUES (_ucs2 x'05D005D505DC05D9');
-- MySQL dump 10.2
--
-- Host: localhost Database: test
-- ------------------------------------------------------
-- Server version 4.1.2-alpha-debug-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;
--
-- Table structure for table `t1`
--
DROP TABLE IF EXISTS t1;
CREATE TABLE t1 (
a varchar(255) default NULL
) TYPE=MyISAM DEFAULT CHARSET=ucs2;
--
-- Dumping data for table `t1`
--
/*!40000 ALTER TABLE t1 DISABLE KEYS */;
LOCK TABLES t1 WRITE;
INSERT INTO t1 VALUES ('אולי');
UNLOCK TABLES;
/*!40000 ALTER TABLE t1 ENABLE KEYS */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
DROP TABLE t1;
mysql-test/t/mysqldump.test
View file @
56ea8bfd
...
...
@@ -22,3 +22,12 @@ CREATE TABLE t1 (`a"b"` char(2));
INSERT
INTO
t1
VALUES
(
"1
\"
"
),
(
"
\"
2"
);
--
exec
$MYSQL_DUMP
--
skip
-
all
-
X
test
t1
DROP
TABLE
t1
;
#
# Bug #1994
#
CREATE
TABLE
t1
(
a
VARCHAR
(
255
))
DEFAULT
CHARSET
ucs2
;
INSERT
INTO
t1
VALUES
(
_ucs2
x
'05D005D505DC05D9'
);
--
exec
$MYSQL_DUMP
test
t1
DROP
TABLE
t1
;
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