Hello all, as this is my first post
Ad meritum:
QMYSQL driver return incorrect driver handle (i think), as following snippet runs into segmentation error with mysql_ping function:
Qt Code:
  1. QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL", "initialConnection");
  2. if(!db.isValid())
  3. {
  4. qCritical() << "Initial connection invalid!";
  5. return QStringList();
  6. }
  7. db.setHostName("192.168.1.2");
  8. db.setPort(3306);
  9. db.setUserName("kOf_GetUsers");
  10. db.setPassword("");
  11. db.setDatabaseName("kOferta");
  12. db.setConnectOptions("CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1;MYSQL_OPT_RECONNECT=1");
  13. QVariant v = db.driver()->handle();
  14. MYSQL *handle = static_cast<MYSQL *>(v.data());
  15.  
  16. qDebug() << "connName:" << db.connectionName();
  17. qDebug() << "driver:" << db.driverName();
  18. qDebug() << "options:" << db.connectOptions();
  19. qDebug() << "host:" << db.hostName();
  20. db.driver()->dumpObjectInfo();
  21. db.driver()->dumpObjectTree();
  22. qDebug() << "database error:" << db.lastError().databaseText();
  23. qDebug() << "driver error:" << db.lastError().driverText();
  24. qDebug() << "v.typename:" << v.typeName();
  25. qDebug() << "handle:" << handle;
  26. qDebug() << "mysql error:" << mysql_error(handle);
  27.  
  28. try
  29. {
  30. qDebug() << "mysql ping:" << mysql_ping(handle);
  31. qDebug() << "mysql error:" << mysql_error(handle);
  32.  
  33. // mysql_ssl_set(handle, ":/client-key", ":/client-cert", ":/ca-cacert", NULL, NULL);
  34. // mysql_ssl_set(handle, "D:/git/build-kOferta/client-key.pem", "D:/git/build-kOferta/client-cert.pem", "D:/git/build-kOferta/ca-cacert.pem", "D:/git/build-kOferta/", "DHE-RSA-AES256-SHA");
  35. }
  36. catch (std::exception& e)
  37. {
  38. qCritical() << "[mysql_ssl_set] Standard exception: " << e.what();
  39. }
  40. catch(...)
  41. {
  42. qCritical() << "[mysql_ssl_set] Unknown exception";
  43. }
To copy to clipboard, switch view to plain text mode 
And my log is as follows:
[27.12.2013 15:30:49]: connName: "initialConnection"
[27.12.2013 15:30:49]: driver: "QMYSQL"
[27.12.2013 15:30:49]: options: "CLIENT_SSL=1;CLIENT_IGNORE_SPACE=1"
[27.12.2013 15:30:49]: host: "192.168.1.2"
[27.12.2013 15:30:49]: OBJECT QMYSQLDriver::unnamed
[27.12.2013 15:30:49]: SIGNALS OUT
[27.12.2013 15:30:49]: <None>
[27.12.2013 15:30:49]: SIGNALS IN
[27.12.2013 15:30:49]: <None>
[27.12.2013 15:30:49]: QMYSQLDriver::
[27.12.2013 15:30:49]: database error: ""
[27.12.2013 15:30:49]: driver error: ""
[27.12.2013 15:30:49]: v.typename: MYSQL*
[27.12.2013 15:30:49]: handle: 0x2f9ae0
[27.12.2013 15:30:49]: mysql error: ���R]
What else can i check? What may be the cause? I use libmysql from MySQL Connector C 6.1 6.1.2 - i dont know if it is relevant...

Best regards, konserw