In MySQL workbench i tried the following :
Qt Code:
  1. SHOW ERRORS;
To copy to clipboard, switch view to plain text mode 
It agave me the errors in the last executed statement, how to execute the same statement from QT application?