Hello list,

I am having this issue with mysql_use_result: it seems it will iterate
over all unused results if I call 'mysql_free_result'. The following
code illustrates this:

 mysql_query(&mysql,"SELECT * FROM a_very_large_table");
 res = mysql_use_result(&mysql);
 i = 0;
 while (row = mysql_fetch_row(res)) {
   fprintf(stderr,"%d,%d\n", row[0], row[1]);
   if (++i > 5)
     break;
 }
 fprintf(stderr,"freeing...\n");
 mysql_free_result(res);
 /* wait wait wait wait wait wait wait wait ... */

With 'mysql_store_results', the code would run out of memory, because
the table is very large (20m rows). But this version will run up to 2
minutes, taking all CPU cycles with it, just "free"ing the result.

Is this normal behaviour or can I change something for the better?

I am using mysql 4.0.22 client and server on Linux 2.6.


Thanks!

Renald

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to