Re: [PHP-DB] weird MySQL restart

2002-08-20 Thread Florin Andrei

Ok, the restart of the loop happens after 300 seconds no matter what.
Seems to be a timeout, but then why i don't get an error instead of the
loop starting all over again?
And i don't see anything in php.ini that could be related to that.

I upgraded to php-4.1.2 and the problem is still there.

On Mon, 2002-08-19 at 17:46, Florin Andrei wrote:
> I'm using:
> - apache-1.3.22
> - mysql-3.23.49a
> - php-4.0.6
> - Linux Red Hat 7.2
> 
> I have a piece of code that does this:
> 
> for ($i=0; $i < $brute_queries_max; $i++) {
> $q = $brute_queries[$i];
> $q = "SELECT COUNT(*) " . $q;
> $res = mysql_query($q)
> or die("in $host database, cannot run query $q");
> $line = mysql_fetch_row($res);
> $n = $line[0];
> $hits_per_table[$i] = $n;
> }
> 
> Basically, it goes through a list of tables in the same database and
> performs a "SELECT COUNT(*) FROM $table WHERE column LIKE '%string%'"
> 
> On a few databases with smallish tables, it's fine.
> But i hav a database which has a couple of large tables (> 8 mil. rows).
> The loop goes through the tables, i can see it in mysql with "SHOW
> PROCESSLIST", then it reaches the large tables. And then it starts all
> over again, from the first table, and so on. If i let it run, it goes
> like this for hours, until i click on the Stop button in the browser.
> 
> I'm totally puzzled. It should timeout, or send an error or something.
> But to start the for() loop all over
> 
> Weird thing is, if i perform the query manually (from the mysql client)
> it works fine, although slow - it takes like 120 sec to run the query on
> the big table.
> 
> I cranked up all timeout parameters in PHP and MySQL, but that didn't
> improved anything.
> 
> Is this a known problem? Seems like a bug to me.
> 
> -- 
> Florin Andrei
> 
> "In my view, a man's value does not depend on what he learns,
> or his position or fame, or what he does, but on what he is
> and inwardly becomes." - Sri Aurobindo, a note to his biographers
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
-- 
Florin Andrei

"In my view, a man's value does not depend on what he learns,
or his position or fame, or what he does, but on what he is
and inwardly becomes." - Sri Aurobindo, a note to his biographers


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP-DB] weird MySQL restart

2002-08-19 Thread Florin Andrei

I'm using:
- apache-1.3.22
- mysql-3.23.49a
- php-4.0.6
- Linux Red Hat 7.2

I have a piece of code that does this:

for ($i=0; $i < $brute_queries_max; $i++) {
$q = $brute_queries[$i];
$q = "SELECT COUNT(*) " . $q;
$res = mysql_query($q)
or die("in $host database, cannot run query $q");
$line = mysql_fetch_row($res);
$n = $line[0];
$hits_per_table[$i] = $n;
}

Basically, it goes through a list of tables in the same database and
performs a "SELECT COUNT(*) FROM $table WHERE column LIKE '%string%'"

On a few databases with smallish tables, it's fine.
But i hav a database which has a couple of large tables (> 8 mil. rows).
The loop goes through the tables, i can see it in mysql with "SHOW
PROCESSLIST", then it reaches the large tables. And then it starts all
over again, from the first table, and so on. If i let it run, it goes
like this for hours, until i click on the Stop button in the browser.

I'm totally puzzled. It should timeout, or send an error or something.
But to start the for() loop all over

Weird thing is, if i perform the query manually (from the mysql client)
it works fine, although slow - it takes like 120 sec to run the query on
the big table.

I cranked up all timeout parameters in PHP and MySQL, but that didn't
improved anything.

Is this a known problem? Seems like a bug to me.

-- 
Florin Andrei

"In my view, a man's value does not depend on what he learns,
or his position or fame, or what he does, but on what he is
and inwardly becomes." - Sri Aurobindo, a note to his biographers


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php