in reply to Re^4: How to Limit MySql Execution Time?
in thread How to Limit MySql Execution Time?
But that document is for running MySql from Shell, a command tool operation. I'm running MySql from script.
Yes. The crux of my suggestion was that instead of using DBI to perform your DB queries, you use the mysql command line tool to perform them.
The posted pseudo code was suggesting that you pass the sql query as a command line argument to the mysql executable as a -e command line parameter, and then read back the results via piped open.
As the DB interaction would be taking place in a separate process, you could then kill that separate process if it takes longer than your required time. As a parent process can always kill a child process, this methods guarantees timeliness. And as the code that would be interrupted is in a separate process that is then thrown away, it avoids any dangers of potential corruption.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How to Limit MySql Execution Time?
by aceofspace (Acolyte) on Dec 22, 2010 at 06:54 UTC | |
by BrowserUk (Patriarch) on Dec 22, 2010 at 07:18 UTC | |
by Anonymous Monk on Dec 22, 2010 at 11:17 UTC | |
by Anonymous Monk on Dec 22, 2010 at 11:45 UTC | |
by Anonymous Monk on Dec 22, 2010 at 13:49 UTC | |
| |
by BrowserUk (Patriarch) on Dec 22, 2010 at 11:21 UTC |