Re: Question for Zeev, Zak or Georg - mysql_query and possible integer overflow?

From: Date: Wed, 26 Mar 2003 01:55:42 +0000
Subject: Re: Question for Zeev, Zak or Georg - mysql_query and possible integer overflow?
References: 1 2  Groups: php.dev 
Request: Send a blank email to php-dev+get-95218@lists.php.net to get a copy of this message
I believe he meant the query id's that the engine uses, and not the auto increment id's.  Wez's response was accurate, we'll overflow at some point.  This is basically because PHP was designed with short requests in mind.  We could probably fix it relatively easily for ZE2.

Zeev

At 13:15 25/03/2003, Zak Greant wrote:
On Tue, Mar 25, 2003 at 01:50:17PM +0000, 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. The query that generates an auto_increment value larger than the largest value allowed for the column will fail with error 1062 (Duplicate entry 'xxx' for key 1) Matt ps - I'm doing this through PEAR::DB::mysql I am not exactly sure how PEAR::DB will propagate this error through its error handling interface. An easy way to test this is to create a temporary table that has a TINYINT as its auto_incrementing primary key, fill the table up and then watch to see what breaks. Cheers! --zak -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, visit: http://www.php.net/unsub.php


Thread (7 messages)

« previous php.dev (#95218) next »