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
e79902aa
Commit
e79902aa
authored
Aug 30, 2007
by
kaa@polly.(none)
Browse files
Options
Browse Files
Download
Plain Diff
Merge polly.(none):/home/kaa/src/bug30164/my50-bug30164
into polly.(none):/home/kaa/src/bug30164/my51-bug30164
parents
496eb569
2bb84964
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
17 deletions
+44
-17
client/mysql.cc
client/mysql.cc
+37
-17
mysql-test/r/mysql.result
mysql-test/r/mysql.result
+2
-0
mysql-test/t/mysql.test
mysql-test/t/mysql.test
+5
-0
No files found.
client/mysql.cc
View file @
e79902aa
...
@@ -1261,6 +1261,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
...
@@ -1261,6 +1261,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
char
buff
[
80
],
*
pos
,
*
out
;
char
buff
[
80
],
*
pos
,
*
out
;
COMMANDS
*
com
;
COMMANDS
*
com
;
bool
need_space
=
0
;
bool
need_space
=
0
;
bool
ss_comment
=
0
;
DBUG_ENTER
(
"add_line"
);
DBUG_ENTER
(
"add_line"
);
if
(
!
line
[
0
]
&&
buffer
.
is_empty
())
if
(
!
line
[
0
]
&&
buffer
.
is_empty
())
...
@@ -1309,22 +1310,36 @@ static bool add_line(String &buffer,char *line,char *in_string,
...
@@ -1309,22 +1310,36 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
}
if
((
com
=
find_command
(
NullS
,(
char
)
inchar
)))
if
((
com
=
find_command
(
NullS
,(
char
)
inchar
)))
{
{
const
String
tmp
(
line
,(
uint
)
(
out
-
line
),
charset_info
);
const
String
tmp
(
line
,(
uint
)
(
out
-
line
),
charset_info
);
buffer
.
append
(
tmp
);
buffer
.
append
(
tmp
);
if
((
*
com
->
func
)(
&
buffer
,
pos
-
1
)
>
0
)
if
((
*
com
->
func
)(
&
buffer
,
pos
-
1
)
>
0
)
DBUG_RETURN
(
1
);
// Quit
DBUG_RETURN
(
1
);
// Quit
if
(
com
->
takes_params
)
if
(
com
->
takes_params
)
{
{
for
(
pos
++
;
if
(
ss_comment
)
*
pos
&&
(
*
pos
!=
*
delimiter
||
{
!
is_prefix
(
pos
+
1
,
delimiter
+
1
))
;
pos
++
)
/*
;
// Remove parameters
If a client-side macro appears inside a server-side comment,
if
(
!*
pos
)
discard all characters in the comment after the macro (that is,
pos
--
;
until the end of the comment rather than the next delimiter)
else
*/
pos
+=
delimiter_length
-
1
;
// Point at last delim char
for
(
pos
++
;
*
pos
&&
(
*
pos
!=
'*'
||
*
(
pos
+
1
)
!=
'/'
);
pos
++
)
}
;
out
=
line
;
pos
--
;
}
else
{
for
(
pos
++
;
*
pos
&&
(
*
pos
!=
*
delimiter
||
!
is_prefix
(
pos
+
1
,
delimiter
+
1
))
;
pos
++
)
;
// Remove parameters
if
(
!*
pos
)
pos
--
;
else
pos
+=
delimiter_length
-
1
;
// Point at last delim char
}
}
out
=
line
;
}
}
else
else
{
{
...
@@ -1384,7 +1399,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
...
@@ -1384,7 +1399,7 @@ static bool add_line(String &buffer,char *line,char *in_string,
out
=
line
;
out
=
line
;
}
}
}
}
else
if
(
*
ml_comment
&&
inchar
==
'*'
&&
*
(
pos
+
1
)
==
'/'
)
else
if
(
*
ml_comment
&&
!
ss_comment
&&
inchar
==
'*'
&&
*
(
pos
+
1
)
==
'/'
)
{
{
pos
++
;
pos
++
;
*
ml_comment
=
0
;
*
ml_comment
=
0
;
...
@@ -1392,6 +1407,11 @@ static bool add_line(String &buffer,char *line,char *in_string,
...
@@ -1392,6 +1407,11 @@ static bool add_line(String &buffer,char *line,char *in_string,
}
}
else
else
{
// Add found char to buffer
{
// Add found char to buffer
if
(
!*
in_string
&&
inchar
==
'/'
&&
*
(
pos
+
1
)
==
'*'
&&
*
(
pos
+
2
)
==
'!'
)
ss_comment
=
1
;
else
if
(
!*
in_string
&&
ss_comment
&&
inchar
==
'*'
&&
*
(
pos
+
1
)
==
'/'
)
ss_comment
=
0
;
if
(
inchar
==
*
in_string
)
if
(
inchar
==
*
in_string
)
*
in_string
=
0
;
*
in_string
=
0
;
else
if
(
!*
ml_comment
&&
!*
in_string
&&
else
if
(
!*
ml_comment
&&
!*
in_string
&&
...
...
mysql-test/r/mysql.result
View file @
e79902aa
...
@@ -176,5 +176,7 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
...
@@ -176,5 +176,7 @@ ERROR at line 1: DELIMITER cannot contain a backslash character
ERROR at line 1: DELIMITER cannot contain a backslash character
ERROR at line 1: DELIMITER cannot contain a backslash character
1
1
1
1
1
1
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.
mysql-test/t/mysql.test
View file @
e79902aa
...
@@ -274,6 +274,11 @@ EOF
...
@@ -274,6 +274,11 @@ EOF
--
exec
$MYSQL
--
pager
=
"540bytelengthstringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-
e
"select 1"
2
>&
1
--
exec
$MYSQL
--
character
-
sets
-
dir
=
"540bytelengthstringxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
-
e
"select 1"
2
>&
1
#
# bug #30164: Using client side macro inside server side comments generates broken queries
#
--
exec
$MYSQL
test
-
e
'/*! \C latin1 */ select 1;'
--
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