title: Qt, MySQL: QMYSQLResult::data: column 1 out of range that only happens sometimes
body: <p>I have the following MySQL table:</p>
  <pre><code>CREATE TABLE `tb_trigger` (
   `triggerid` int(11) NOT NULL DEFAULT '0',
   `trigelems` varchar(255) NOT NULL DEFAULT '',
   `trig_desc` varchar(255) NOT NULL DEFAULT '',
   PRIMARY KEY (`triggerid`),
   UNIQUE KEY `trigelems` (`trigelems`)
  ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Table of all active trigger setups'
  </code></pre>
  <p>I run the following query on it:</p>
  <pre><code>SELECT triggerid FROM tb_trigger WHERE trigelems='0:0 1:1 2:1 3:1 4:1 5:40000 6:10000 7:50000 8:99999 9:1 10:1 11:0'
  </code></pre>
  <p>This is done using the following QT code:</p>
  <pre><code>QString db::fetchString(QString sqlQuery) {
  
      QSqlQuery res = QSqlQuery(sqlQuery, sqldb);
      if (!res.next()){
          return &quot;None&quot;;
      } else
          return res.value(0).toString();
  }
  </code></pre>
  <p>The problem is, once in a while (maybe 1 times out of 100), I get a <code>QMYSQLResult::data: column 1 out of range</code> error on this query. When I check the database afterwards for the exact same query it failed on, it DOES return a row. This leaves me quite dumbfounded.</p>
  <p>This application is a long-term running daemon. Maybe that could be a factor? Would checking <code>res.record().count()</code> help in this case?</p>