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
2b42750a
Commit
2b42750a
authored
Oct 04, 2007
by
bar@mysql.com/bar.myoffice.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug#29323 mysql client only accetps ANSI encoded files
Fix: ignore BOM marker in the first line.
parent
d155f65a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
0 deletions
+22
-0
client/mysql.cc
client/mysql.cc
+11
-0
mysql-test/r/mysql.result
mysql-test/r/mysql.result
+2
-0
mysql-test/t/mysql.test
mysql-test/t/mysql.test
+9
-0
No files found.
client/mysql.cc
View file @
2b42750a
...
...
@@ -1042,6 +1042,17 @@ static int read_and_execute(bool interactive)
if
(
!
interactive
)
{
line
=
batch_readline
(
status
.
line_buff
);
/*
Skip UTF8 Byte Order Marker (BOM) 0xEFBBBF.
Editors like "notepad" put this marker in
the very beginning of a text file when
you save the file using "Unicode UTF-8" format.
*/
if
(
!
line_number
&&
(
uchar
)
line
[
0
]
==
0xEF
&&
(
uchar
)
line
[
1
]
==
0xBB
&&
(
uchar
)
line
[
2
]
==
0xBF
)
line
+=
3
;
line_number
++
;
if
(
!
glob_buffer
.
length
())
status
.
query_start_line
=
line_number
;
...
...
mysql-test/r/mysql.result
View file @
2b42750a
...
...
@@ -178,4 +178,6 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
1
1
1
This is a file starting with UTF8 BOM 0xEFBBBF
This is a file starting with UTF8 BOM 0xEFBBBF
End of 5.0 tests
mysql-test/t/mysql.test
View file @
2b42750a
...
...
@@ -281,4 +281,13 @@ remove_file $MYSQLTEST_VARDIR/tmp/bug21412.sql;
#
--
exec
$MYSQL
test
-
e
"/*! \C latin1 */ select 1;"
#
# Bug#29323 mysql client only accetps ANSI encoded files
#
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
bug29323
.
sql
select
"This is a file starting with UTF8 BOM 0xEFBBBF"
;
EOF
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug29323
.
sql
2
>&
1
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
bug29323
.
sql
;
--
echo
End
of
5.0
tests
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