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
4015c585
Commit
4015c585
authored
Sep 13, 2004
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug #4809 (Backticks not handled in mysql)
client/mysql.cc: Code added to handle backticks
parent
c1e84276
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
client/mysql.cc
client/mysql.cc
+35
-3
No files found.
client/mysql.cc
View file @
4015c585
...
@@ -2201,17 +2201,49 @@ static int com_source(String *buffer, char *line)
...
@@ -2201,17 +2201,49 @@ static int com_source(String *buffer, char *line)
static
int
static
int
com_use
(
String
*
buffer
__attribute__
((
unused
)),
char
*
line
)
com_use
(
String
*
buffer
__attribute__
((
unused
)),
char
*
line
)
{
{
char
*
tmp
,
buff
[
FN_REFLEN
+
1
];
char
tmp
[
FN_REFLEN
]
,
buff
[
FN_REFLEN
+
1
];
MYSQL_RES
*
res
;
MYSQL_RES
*
res
;
MYSQL_ROW
row
;
MYSQL_ROW
row
;
char
*
c_buff
,
*
c_tmp
;
while
(
isspace
(
*
line
))
while
(
isspace
(
*
line
))
line
++
;
line
++
;
strnmov
(
buff
,
line
,
sizeof
(
buff
)
-
1
);
// Don't destroy history
strnmov
(
buff
,
line
,
sizeof
(
buff
)
-
1
);
// Don't destroy history
if
(
buff
[
0
]
==
'\\'
)
// Short command
if
(
buff
[
0
]
==
'\\'
)
// Short command
buff
[
1
]
=
' '
;
buff
[
1
]
=
' '
;
tmp
=
(
char
*
)
strtok
(
buff
,
"
\t
;"
);
// Skip connect command
c_buff
=
buff
;
if
(
!
tmp
||
!
(
tmp
=
(
char
*
)
strtok
(
NullS
,
"
\t
;"
)))
while
((
*
c_buff
!=
' '
)
&&
(
*
c_buff
!=
'\t'
))
// Skip connect command
c_buff
++
;
c_buff
++
;
while
((
*
c_buff
==
' '
)
||
(
*
c_buff
==
'\t'
))
c_buff
++
;
c_tmp
=
tmp
;
if
(
*
c_buff
==
'`'
)
// Handling backticks
{
c_buff
++
;
for
(;
*
c_buff
;
c_tmp
++
)
{
if
(
*
c_buff
==
'`'
)
{
if
(
c_buff
[
1
]
==
'`'
)
{
*
c_tmp
=
'`'
;
c_buff
+=
2
;
}
else
break
;
}
else
*
c_tmp
=
*
(
c_buff
++
);
}
}
else
for
(;
!
strchr
(
"
\t
;"
,
*
c_buff
);
c_buff
++
,
c_tmp
++
)
*
c_tmp
=
*
c_buff
;
*
c_tmp
=
'\0'
;
if
(
!*
tmp
)
{
{
put_info
(
"USE must be followed by a database name"
,
INFO_ERROR
);
put_info
(
"USE must be followed by a database name"
,
INFO_ERROR
);
return
0
;
return
0
;
...
...
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