Bug #81517 Invalid syntax created if mysqldump run with option --where="NEWLINE condition"
Submitted: 20 May 2016 11:35 Modified: 24 May 2016 10:01
Reporter: Sveta Smirnova (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: mysqldump Command-line Client Severity:S3 (Non-critical)
Version:5.5, 5.6.30, 5.7.12 OS:Any
Assigned to: CPU Architecture:Any

[20 May 2016 11:35] Sveta Smirnova
Description:
If I run mysqldump with option WHERE, but put part of it on new line resulting output would be invalid SQL:

./bin/mysqldump -uroot -S /tmp/sveta56.sock --where="\
> user='root'" mysql user

...
--
-- Dumping data for table `user`
--
-- WHERE:  
user=root

How to repeat:
./bin/mysqldump -uroot -S /tmp/sveta56.sock --where="\
> user='root'" mysql user

Suggested fix:
Comment parts of WHERE clause even if they are on the new line
[24 May 2016 10:01] MySQL Verification Team
Hello Sveta,

Thank you for the report.
Verified as described.

Thanks,
Umesh
[24 May 2016 10:02] MySQL Verification Team
-
-- 5.6.30, 5.7.12

bin/mysqldump -uroot -S/tmp/mysql_ushastry.sock --where="\
<NEWLINE>
> user='root'" mysql user

--
-- Dumping data for table `user`
--
-- WHERE:
user='root'

-- Dump completed on 2016-05-24 11:59:42