Req #55152 [NEW]: Mysql relative seek
| From: | lenzai2004-dev at yahoo dot fr | Date: | Wed, 06 Jul 2011 19:01:55 +0000 |
| Subject: | Req #55152 [NEW]: Mysql relative seek | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-161667@lists.php.net to get a copy of this message | ||
From:
Operating system: all
PHP version: trunk-SVN-2011-07-06 (SVN)
Package: MySQL related
Bug Type: Feature/Change Request
Bug description:Mysql relative seek
Description:
------------
There is currently a function to do absolute seek in Mysql API.
When you need to to relative seek , you have to implement integer counter
to keep track of the current cursor position. Then call seek
here is a sample code:
//iterating over rows
for/while....{
mysql_fetch_xxxx(....);
$current_row++;
[...]
// call relative seek
$current_row+= $seek_offset;
mysql_data_seek($id, $current_row);
This quite simple but when the code gets complicated, it s easy to miss on
$current_row update. The only only solution is to encapsulate php mysql
function in additional abstraction layer to handle counter updates safely.
I suppose the internal counter is already available in mysql module.
What I am suggesting, is to expose this internal counter by adding a new
function to mysql API.
--
Edit bug report at https://bugs.php.net/bug.php?id=55152&edit=1
--
Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55152&r=trysnapshot52
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55152&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55152&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=55152&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55152&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=55152&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=55152&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=55152&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=55152&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=55152&r=support
Expected behavior: https://bugs.php.net/fix.php?id=55152&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=55152&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=55152&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=55152&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55152&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=55152&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=55152&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=55152&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=55152&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=55152&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=55152&r=mysqlcfg
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55152&r=trysnapshot54