title: Application crash after using mysql_fetch_row
body: <p>I got a problem regarding simple MySQL function which is <code>mysql_fetch_row</code> when ever I use it, my application will crash with it will go to the point when its executing.
  No matter what query I would run it will crash. The core dump says following:</p>
  <pre><code>(gdb) bt full
  #0  0x2866397f in mysql_store_result () from /usr/home/ld/application
  #1  0x28637905 in main () from /usr/home/ld/application
  #2  0x08441d3a in CRC_GetCodeSize20 ()
  </code></pre>
  <p>The code looks simple:</p>
  <pre><code>int main()
  {
    MYSQL *conn;      // the connection
    MYSQL_RES *res;   // the results
    MYSQL_ROW row;    // the results row (line by line)
   
    struct connection_details mysqlD;
    mysqlD.server = &quot;localhost&quot;;  // where the mysql database is
    mysqlD.user = &quot;mysqlusername&quot;;        // the root user of mysql   
    mysqlD.password = &quot;mysqlpassword&quot;; // the password of the root user in mysql
    mysqlD.database = &quot;mysql&quot;;    // the databse to pick
   
    conn = mysql_connection_setup(mysqlD);
   
    res = mysql_perform_query(conn, &quot;select 1, 2&quot;);
   
    printf(&quot;Result:\n&quot;);
    while ((row = mysql_fetch_row(res)) !=NULL)
        printf(&quot;%s\n&quot;, row[0]);
   
    mysql_free_result(res);
    mysql_close(conn);
   
    return 0;
  }
  </code></pre>
  <p>What is the problem?</p>
  <h1>edit</h1>
  <p>mysql_perform_query:</p>
  <pre><code>MYSQL_RES* mysql_perform_query(MYSQL *connection, char *sql_query)
  {
     if (mysql_query(connection, sql_query))
     {
        printf(&quot;MySQL query error : %s\n&quot;, mysql_error(connection));
        exit(1);
     }
   
     return mysql_use_result(connection);
  }
  </code></pre>