Hi everyone!

I have some problems with using QtSql.
So here's the code first:
Qt Code:
  1. QSqlQuery q1(db_connection), q2(db_connection);
  2. q1.exec("SELECT * from users");
  3. while(q1.next())
  4. {
  5. q2.exec("delete from table1");
  6. if (!q2.isValid())
  7. qDebug() << "q2 is not valid";
  8.  
  9. if (q1.isActive() && q1.isValid())
  10. qDebug() << q1.record();
  11. }
To copy to clipboard, switch view to plain text mode 

So there are two queries to one database: q1 is absolutely correct and should return several result rows, but q1 is some wrong query.
The question is why QSqlQuery::record() of q1 returns empty data after executing query q2?

I'm using MySQL 5.5.
I repeated this behaviour on qt 4.7.1 and qt 4.8.1 in Windows and Linux.

P.S.: Sorry for my english.