Hi,

I'm using QT 4.2, to access some tables in a MySQL database.
Everything was working OK until my (autoincrement) ID field for one of my tables reached 1,000,000.

Now, when I use QSqlQuery to read rows in that table... the id fields always come back as "0", instead of something like "1000085"


The offending code goes something like this:
Qt Code:
  1. QSqlQuery q(db);
  2. p.prepare("select id from mytable where col1=? and col2=?");
  3. p.addBindValue(var1);
  4. p.addBindValue(var2);
  5. q.exec();
  6. while (q.next()){
  7. QVariant v = q.value(0);
  8. // this incorrectly reports "0" for records with id numbers over 1 million
  9. qDebug() << v.typeName(); // reports 'uint'
  10. qDebug() << v.toString();
  11. }
To copy to clipboard, switch view to plain text mode 

Anyone know what the heck is going on?

Thanks,
Peter