Re: [PHP-DEV] Question for Zeev, Zak or Georg - mysql_query andpossible integer overflow?

2003-03-25 Thread Wez Furlong
Hi Matt,

Yes, there is a risk of overflow.
>From my understanding, the id is signed, so you will hit overflow at 2G
rather than 4G resources.
This applies to any/all PHP/ZE resources.

I'm not sure what happens when it overflows; it seems like the query
would fail.

You could design your application so that it re-runs itself when the
query fails (pcntl_exec(), or one of the other execution functions).

--Wez.

On Tue, 25 Mar 2003, Matt Flaherty wrote:

> Hi,
>
> I have a question for the authors of the mysql extension. I'm sure you
> gentlemen are very busy, but I'd appreciate your insight if you can
> spare a moment. I'm developing a stand-alone php application running in
> an infinite loop from the command line interface. A mysql database is
> polled continually for new rows to deal with. The same query is executed
> several times in one second. I've noticed that whether or not a query
> resource is freed the next query identifier returned from mysql_query()
> is ++ the last one. I'm sure this is by design and governed by the mysql
> driver. Naturally I'm concerned about integer overflow when the the
> application has been running uninterrupted for a very long time. I don't
> think I can wait around while a test script runs to see what happens
> after 4,294,967,295 is exceeded though! Can anyone tell me with
> certainty or hazard a guess what might happen here? I thank you very
> much for your time.
>
> Matt
>
> ps - I'm doing this through PEAR::DB::mysql
> --
> Matt Flaherty <[EMAIL PROTECTED]>
> Boltblue International Ltd.
>
>
> --
> PHP Development Mailing List 
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

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



Re: [PHP-DEV] Question for Zeev, Zak or Georg - mysql_query andpossible integer overflow?

2003-03-25 Thread Matt Flaherty
Thanks Wez,

If all that happens is the query will fail, I can live with that. It's a
simple SELECT query called over and over again. If the integer wraps
around negative, I'm guessing that would probably have undesirable
effects. If not, then I can let it run forever. What I don't want is
something like a segfault. I'm considering making the application
restart itself periodically to clear out the cobwebs.

-Matt

On Tue, 2003-03-25 at 14:12, Wez Furlong wrote:
> Hi Matt,
> 
> Yes, there is a risk of overflow.
> >From my understanding, the id is signed, so you will hit overflow at 2G
> rather than 4G resources.
> This applies to any/all PHP/ZE resources.
> 
> I'm not sure what happens when it overflows; it seems like the query
> would fail.
> 
> You could design your application so that it re-runs itself when the
> query fails (pcntl_exec(), or one of the other execution functions).
> 
> --Wez.
> 


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



Re: [PHP-DEV] Question for Zeev, Zak or Georg - mysql_query andpossible integer overflow?

2003-03-26 Thread Matt Flaherty
Thanks guys for your feedback. With regard to PEAR, I've had to patch
PEAR::DB::mysql to solve another problem I've had with the
prepared_queries field growing steadily. I'm sure this is also a problem
with the either DB subclasses. I'll post my patch to pear-dev as I don't
have a CVS account yet.

-Matt



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