At 18:06 +0200 1/8/03, Vladimir Zheleznyak wrote:
From: [EMAIL PROTECTED]
To:   [EMAIL PROTECTED]
Subject: delay on executing mysql_free_result with underfetched query
Description:
If to execute mysql_use_result on the query that returns large amount of
records and then
execute mysql_free_result - execution the last function take time equal to
fetch all data to client.
Is it possible to avoid this delay?
No. The reason this happens is due to the way that mysql_free_result()
is implemented, to avoid "commands out of sync" errors.  In the old
days, if you used mysql_use_result() and then didn't fetch all the
rows, calling mysql_free_result() released the result set on the client,
but the server still had rows left to send.  The next query would fail
with an out-of-sync error.

Now, mysql_free_result() automatically fetches and discards any yet-unfetched
rows, which avoids that problem.

It'd be nice were it possible to tell the server itself to discard the
rows, but it doesn't work that way.  Maybe you can use LIMIT to generate just
the initial part of the result, if you suspect that you're not going to
need it all.

Synopsis: Delays on breaking fetch
Originator: Vladimir Zheleznyak
Organization:   Core Lab
MySQL support:  none

Severity: non-critical
Priority: low
Category: mysql client, C
Class:  sw-bug
Release: mysql-3.23.51

Exectutable:   mysqld-nt
Environment:   Celeron 800, RAM 256 MB, localhost
System:        Win2000
Compiler:      VC++ 6.0
Architecture:  i

Best regards,
Vladimir Zheleznyak

---------------------------------------------------------------------
Before posting, please check:
  http://www.mysql.com/manual.php   (the manual)
  http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to