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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
b5705138
Commit
b5705138
authored
Oct 02, 2006
by
jpipes@shakedown.(none)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for Bug #21412 (client allows DELIMITER with backslash character)
parent
d3a67330
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
3 deletions
+49
-3
.bzrignore
.bzrignore
+3
-0
client/mysql.cc
client/mysql.cc
+24
-3
mysql-test/r/mysql.result
mysql-test/r/mysql.result
+4
-0
mysql-test/t/mysql.test
mysql-test/t/mysql.test
+18
-0
No files found.
.bzrignore
View file @
b5705138
...
...
@@ -1318,3 +1318,6 @@ win/vs71cache.txt
win/vs8cache.txt
zlib/*.ds?
zlib/*.vcproj
mysql-test/t/tmp.test
mysql-test/r/tmp.result
client/tmp.diff
client/mysql.cc
View file @
b5705138
...
...
@@ -800,10 +800,23 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
default_charset_used
=
1
;
break
;
case
OPT_DELIMITER
:
if
(
argument
==
disabled_my_option
)
if
(
argument
==
disabled_my_option
)
{
strmov
(
delimiter
,
DEFAULT_DELIMITER
);
else
strmake
(
delimiter
,
argument
,
sizeof
(
delimiter
)
-
1
);
}
else
{
/* Check that delimiter does not contain a backslash */
if
(
!
strstr
(
argument
,
"
\\
"
))
{
strmake
(
delimiter
,
argument
,
sizeof
(
delimiter
)
-
1
);
}
else
{
put_info
(
"DELIMITER cannot contain a backslash character"
,
INFO_ERROR
);
return
0
;
}
}
delimiter_length
=
(
uint
)
strlen
(
delimiter
);
delimiter_str
=
delimiter
;
break
;
...
...
@@ -3011,6 +3024,14 @@ com_delimiter(String *buffer __attribute__((unused)), char *line)
INFO_ERROR
);
return
0
;
}
else
{
if
(
strstr
(
tmp
,
"
\\
"
))
{
put_info
(
"DELIMITER cannot contain a backslash character"
,
INFO_ERROR
);
return
0
;
}
}
strmake
(
delimiter
,
tmp
,
sizeof
(
delimiter
)
-
1
);
delimiter_length
=
(
int
)
strlen
(
delimiter
);
delimiter_str
=
delimiter
;
...
...
mysql-test/r/mysql.result
View file @
b5705138
...
...
@@ -139,4 +139,8 @@ ERROR at line 1: USE must be followed by a database name
\\
';
';
1
1
ERROR at line 1: DELIMITER cannot contain a backslash character
ERROR at line 1: DELIMITER cannot contain a backslash character
End of 5.0 tests
mysql-test/t/mysql.test
View file @
b5705138
...
...
@@ -147,4 +147,22 @@ drop table t1;
--
exec
echo
"SELECT '\';';"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug20103
.
sql
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug20103
.
sql
2
>&
1
#
# Bug #21412: mysql cmdline client allows backslash(es)
# as delimiter but can't recognize them
#
# This should work just fine...
--
exec
echo
"DELIMITER /"
>
$MYSQLTEST_VARDIR
/
tmp
/
bug21412
.
sql
--
exec
echo
"SELECT 1/"
>>
$MYSQLTEST_VARDIR
/
tmp
/
bug21412
.
sql
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug21412
.
sql
2
>&
1
# This should give an error...
--
exec
echo
"DELIMITER
\\
"
>
$MYSQLTEST_VARDIR
/
tmp
/
bug21412
.
sql
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug21412
.
sql
2
>&
1
# As should this...
--
exec
echo
"DELIMITER
\\\\
"
>
$MYSQLTEST_VARDIR
/
tmp
/
bug21412
.
sql
--
exec
$MYSQL
<
$MYSQLTEST_VARDIR
/
tmp
/
bug21412
.
sql
2
>&
1
--
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