Menu

#463 [PHP Static] filesize is not expected after using cubrid_lob2_import

open
nobody
None
5
2013-03-21
2013-03-21
Jira Trac
No

[PHP Static] filesize is not expected after using cubrid_lob2_import
Test case: http://svn.cubrid.org/cubridapis/php/branches/RB-9.1.0_static_cci/tests/cubrid_lob2_import.phpt

Test Envrionment:
{noformat}
PHP Driver: http://10.34.64.219/2013-03-20/9.1.0/CUBRID-PHP5-5.3-WIN32-VC9-NTS-9.1.0.0001.bin.zip

PHP Version: 5.3.13
{noformat}

Test code:
{code}
$conn = cubrid_connect($host, $port, $db, $user, $passwd);

if (!is_null($tmp = @cubrid_lob2_import())) {
printf('[001] Expecting NULL, got %s/%s\n', gettype($tmp), $tmp);
}

@cubrid_execute($conn, 'DROP TABLE IF EXISTS test_lob2');
cubrid_execute($conn, 'CREATE TABLE test_lob2 (id INT AUTO_INCREMENT, images BLOB)');

$req = cubrid_prepare($conn, INSERT INTO test_lob2(images) VALUES (?));

$lob = cubrid_lob2_new($conn);

if (false !== ($tmp = @cubrid_lob2_import($lob, file_not_exist))) {
printf([002] Expecting boolean/false, got %s/%s\n, gettype($tmp), $tmp);
}

cubrid_lob2_import($lob, 'tests/cubrid_logo.png');

//print filesize(tests/cubrid_logo.png);
//print \n;
//print cubrid_lob2_size($lob);
//print \n;
if (filesize(tests/cubrid_logo.png) != cubrid_lob2_size($lob)) {
printf([003] cubrid_lob2_import error, filesize is inconsistent.\n);
}

cubrid_lob2_bind($req, 1, $lob);

cubrid_execute($req);

cubrid_disconnect($conn);

print 'done!';

{code}

I tried print the filesize :
{noformat}
27478
5
[003] cubrid_lob2_import error, filesize is inconsistent.
done!
{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.