Menu

#113 [PHP]Cubrid_current_oid method will always get the first record's oid value

open
nobody
None
5
2012-03-09
2012-03-09
Jira Trac
No

Test Build: CUBRID 2008 R4.1 (8.4.1.1018) (64bit release build for linux_gnu)
OS: Linux 64
Description:
Moving the cursor to the third record using cubrid_move_cursor() method, the return value is about first record using cubrid_get() method.
Moving the cursor to the fourth record, the return value is also about first record.

Repro steps:
1. execute: php move_test2.phpt
statements in move_test2.phpt
{noformat}
$conn = cubrid_connect(localhost, 33113, demodb);
cubrid_execute($conn, DROP TABLE foo);
cubrid_execute($conn, CREATE TABLE foo(a int, b varchar(10) ));
cubrid_execute($conn, INSERT INTO foo values(1,'varchar1'),(2,'varchar2'),(3,'varchar3'),(4,'varchar4'));
$req = cubrid_execute($conn, SELECT * FROM foo order by a , CUBRID_INCLUDE_OID);

//move cursor to the third record
cubrid_move_cursor($req, 3, CUBRID_CURSOR_FIRST);
$oid = cubrid_current_oid($req);
printf(The third record's oid: %s\n,$oid);
$attr = cubrid_get($conn, $oid, b);
var_dump($attr);

cubrid_move_cursor($req,4, CUBRID_CURSOR_FIRST);
$oid2 = cubrid_current_oid($req);
printf(\n\nThe fourth record's oid: %s\n,$oid2);
$attr2 = cubrid_get($conn, $oid2, b);
var_dump($attr2);

cubrid_close_request($req);
cubrid_disconnect($conn);
{noformat}

Actual result:
{noformat}
The third record's oid: @880|33|0
string(8) varchar1

The fourth record's oid: @880|33|0
string(8) varchar1
{noformat}

Expect result:
When cursor move to third record, the return value is about third record using cubrid_get() method and the oid value is about third record.

when cursor move to four record, the return value is about four record using and the oid value is about four record.

Discussion

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.