[Qt-interest] QProcess and mysqldump

Rainer Wiesenfarth Rainer.Wiesenfarth at inpho.de
Fri Nov 19 08:43:55 CET 2010


From: David Villalobos Cambronero
> Thanks, think I found something, I'll be back soon :)
> 
> 	On Thursday, 18 de November de 2010 19:03:56 David Villalobos
> Cambronero
> 	wrote:
> 
> 	> Thanks for your reply, the exit code of mysqldump is 2.
> 	>
> 	> I change the order of proc->waitForFinished(-1); and correct
> the password,
> 	> and the exit code is still 2
> 	>
> 	>   QStringList arguments;
> 	>   arguments << " --user=root";
> 	>   arguments << " --password=david123";
> 	>   arguments << " --host=localhost";
> 	>   arguments << " --result-file=/home/david/tmpDavid.sql";
> 	>   proc->setReadChannel(QProcess::StandardOutput);
> 	>   proc->start("mysqldump", arguments);
> 	>   proc->waitForFinished(-1);

I would expect mysqldump to ignore the parameters that start with a whitespace. The argument list should be build like this:
  QStringList arguments;
  arguments << "--user=root";
  arguments << "--password=david123";
  arguments << "--host=localhost";
  arguments << "--result-file=/home/david/tmpDavid.sql";
_without_ an additional whitespace left of the "--". Your approach ends up with the command line

  mysqldump " --user=root" " --password=david123" ...

which might get misinterpreted by mysqldump.

Best Regards / Mit freundlichen Grüßen
Rainer Wiesenfarth

-- 
INPHO GmbH * Smaragdweg 1 * 70174 Stuttgart * Germany
phone: +49 711 2288 10 * fax: +49 711 2288 111 * web: www.inpho.de
place of business: Stuttgart * managing director: Johannes Saile
commercial register: Stuttgart, HRB 9586
Leader in Photogrammetry and Digital Surface Modelling 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6426 bytes
Desc: not available
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101119/19a9f7d1/attachment.bin 


More information about the Qt-interest-old mailing list