Willem Bogaerts wrote:
> > I was asked last night if it was possible to stop a SELECT statement
> > whilst it is executing.
> >
> > SELECT *
> > FROM VERY_BIG_TABLE ;
>
> You can use SHOW PROCESSLIST to see what thread number the query has and
> kill that thread:
> http://dev.mysql.com/doc/refman/4.1/en/kill.html
Thank you for that. I'm unsure if I can use it. It relies
on a DBA tracking transactions I think. In my instance, say
# blah blah blah....
$sql = "SELECT * from VERY_LARGE_TABLE" ;
$sth = $dbh->prepare($sql);
$sth->execute($sql)
or die_with_help( $language->maketext("SELECT failed 2: "
.. $sth->errstr ), MAJOR_ERROR ) ;
# chug chug chug.....
Now without a DBA or a SysAdmin looking at this thread,
how can a user terminate this request at will?ie: "taking to long, hit
the big red STOP
button on the web page!
I can wrap an ALARM around it, and call a timeout.
I was wondering if a nicer AUTOMATED way was possible.
I can add start_row and num_rows onto the select statement.
I can't seem to find a way of doing a pretty timeout without
trashing the connection.
But again, thank you for your response.
Mark Addinall.
>
> --
> Willem Bogaerts
>
> Application smith
> Kratz B.V.
> http://www.kratz.nl/