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
a633e0b9
Commit
a633e0b9
authored
Dec 11, 2008
by
Chad MILLER
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for Bug 33812 from 5.0-bugteam.
parents
32c1790b
d84690c9
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
32 deletions
+42
-32
client/mysql.cc
client/mysql.cc
+17
-32
mysql-test/r/mysql.result
mysql-test/r/mysql.result
+6
-0
mysql-test/t/mysql.test
mysql-test/t/mysql.test
+19
-0
No files found.
client/mysql.cc
View file @
a633e0b9
...
@@ -2020,7 +2020,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
...
@@ -2020,7 +2020,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
{
{
if
(
!
preserve_comments
)
if
(
!
preserve_comments
)
{
{
// Skip spaces at the beg
gi
ning of a statement
// Skip spaces at the beg
in
ning of a statement
if
(
my_isspace
(
charset_info
,
inchar
)
&&
(
out
==
line
)
&&
if
(
my_isspace
(
charset_info
,
inchar
)
&&
(
out
==
line
)
&&
buffer
.
is_empty
())
buffer
.
is_empty
())
continue
;
continue
;
...
@@ -2103,37 +2103,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
...
@@ -2103,37 +2103,6 @@ static bool add_line(String &buffer,char *line,char *in_string,
continue
;
continue
;
}
}
}
}
else
if
(
!*
ml_comment
&&
!*
in_string
&&
(
end_of_line
-
pos
)
>=
10
&&
!
my_strnncoll
(
charset_info
,
(
uchar
*
)
pos
,
10
,
(
const
uchar
*
)
"delimiter "
,
10
))
{
// Flush previously accepted characters
if
(
out
!=
line
)
{
buffer
.
append
(
line
,
(
uint32
)
(
out
-
line
));
out
=
line
;
}
// Flush possible comments in the buffer
if
(
!
buffer
.
is_empty
())
{
if
(
com_go
(
&
buffer
,
0
)
>
0
)
// < 0 is not fatal
DBUG_RETURN
(
1
);
buffer
.
length
(
0
);
}
/*
Delimiter wants the get rest of the given line as argument to
allow one to change ';' to ';;' and back
*/
buffer
.
append
(
pos
);
if
(
com_delimiter
(
&
buffer
,
pos
)
>
0
)
DBUG_RETURN
(
1
);
buffer
.
length
(
0
);
break
;
}
else
if
(
!*
ml_comment
&&
!*
in_string
&&
is_prefix
(
pos
,
delimiter
))
else
if
(
!*
ml_comment
&&
!*
in_string
&&
is_prefix
(
pos
,
delimiter
))
{
{
// Found a statement. Continue parsing after the delimiter
// Found a statement. Continue parsing after the delimiter
...
@@ -2196,8 +2165,24 @@ static bool add_line(String &buffer,char *line,char *in_string,
...
@@ -2196,8 +2165,24 @@ static bool add_line(String &buffer,char *line,char *in_string,
// comment to end of line
// comment to end of line
if
(
preserve_comments
)
if
(
preserve_comments
)
{
bool
started_with_nothing
=
!
buffer
.
length
();
buffer
.
append
(
pos
);
buffer
.
append
(
pos
);
/*
A single-line comment by itself gets sent immediately so that
client commands (delimiter, status, etc) will be interpreted on
the next line.
*/
if
(
started_with_nothing
)
{
if
(
com_go
(
&
buffer
,
0
)
>
0
)
// < 0 is not fatal
DBUG_RETURN
(
1
);
buffer
.
length
(
0
);
}
}
break
;
break
;
}
}
else
if
(
!*
in_string
&&
inchar
==
'/'
&&
*
(
pos
+
1
)
==
'*'
&&
else
if
(
!*
in_string
&&
inchar
==
'/'
&&
*
(
pos
+
1
)
==
'*'
&&
...
...
mysql-test/r/mysql.result
View file @
a633e0b9
...
@@ -180,6 +180,12 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
...
@@ -180,6 +180,12 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
1
1
This is a file starting with UTF8 BOM 0xEFBBBF
This is a file starting with UTF8 BOM 0xEFBBBF
This is a file starting with UTF8 BOM 0xEFBBBF
This is a file starting with UTF8 BOM 0xEFBBBF
delimiter
1
2
2
2
2
End of 5.0 tests
End of 5.0 tests
WARNING: --server-arg option not supported in this configuration.
WARNING: --server-arg option not supported in this configuration.
Warning (Code 1286): Unknown table engine 'nonexistent'
Warning (Code 1286): Unknown table engine 'nonexistent'
...
...
mysql-test/t/mysql.test
View file @
a633e0b9
...
@@ -291,6 +291,25 @@ EOF
...
@@ -291,6 +291,25 @@ EOF
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug29323
.
sql
2
>&
1
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug29323
.
sql
2
>&
1
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
bug29323
.
sql
;
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
bug29323
.
sql
;
#
# Bug #33812: mysql client incorrectly parsing DELIMITER
#
# The space and ; after delimiter are important
--
exec
$MYSQL
-
e
"select 1 delimiter ;"
#
# Bug #38158: mysql client regression, can't read dump files
#
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
bug38158
.
sql
--
Testing
--
delimiter
||
select
2
||
EOF
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug38158
.
sql
2
>&
1
--
exec
$MYSQL
-
c
<
$MYSQLTEST_VARDIR
/
tmp
/
bug38158
.
sql
2
>&
1
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
bug38158
.
sql
;
--
echo
End
of
5.0
tests
--
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