Menu

#103 [PHP]Return value of cubrid_fetch_lengths method is empty when record number is 1

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

Test Build: CUBRID 2008 R4.1 (8.4.1.1018) (64bit release build for linux_gnu)
OS: Linux 64
Description: Return value of cubrid_fetch_lengths method is empty when record number is 1

Repro steps:
1. execute: fetch_lengths_test2.phpt
statements in fetch_lengths_test2.phpt
{noformat}
[php@NC-PL-QA014 _07_fetch]$ cat fetch_lengths_test2.phpt
?php
$conn = cubrid_connect(localhost, 33113, phpdb);
cubrid_execute($conn, 'DROP TABLE IF EXISTS fetch_length_tb');
cubrid_execute($conn,CREATE TABLE fetch_length_tb(c1 int, c2 varchar(20)));
cubrid_execute($conn,insert into fetch_length_tb(c1,c2) values(1,'varchar1'));
//cubrid_execute($conn,insert into fetch_length_tb(c1,c2) values(2,'varchar2'));

$result=cubrid_execute($conn,select * from fetch_length_tb);
$row = cubrid_fetch_row($result);
print_r($row);

$lens = cubrid_fetch_lengths($result);
print_r($lens);

cubrid_disconnect($conn);

print Finished!\n;
?
{noformat}

Actual result:
{noformat}
[php@NC-PL-QA014 _07_fetch]$ php fetch_lengths_test2.phpt
Array
(
[0] = 1
[1] = varchar1
)
Finished!
{noformat}

Expect result:
{noformat}
Array
(
[0] = 1
[1] = varchar1
)
Array
(
[0] = 1
[1] = 8
)
Finished!
{noformat}

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.