From:             marrtins at hackers dot lv
Operating system: Linux 2.6.14.4
PHP version:      5.2.8
PHP Bug Type:     InterBase related
Bug description:  ibase.timeformat won't work when any of %H %M %S missing

Description:
------------
Get wrong time values into database when missing %S in ibase.timeformat,
like: ini_set('ibase.timeformat', "%H:%M");

Firebird 2.1.1.17910
EXECUTION_DATE = Date field
EXECUTION_TIME = Time field

ibase_execute($q, "15:00", 670); - FAILD
ibase_execute($q, 15 * 3600, 670); - OK

Reproduce code:
---------------
<?php

ini_set('ibase.timeformat', "%H:%M");
ini_set('ibase.dateformat', "%d.%m.%Y");
ini_set('ibase.timestampformat', "%d.%m.%Y %H:%M");

ibase_connect($_CONF['DB']['LOCAL']['HOST'],
$_CONF['DB']['LOCAL']['USER'], $_CONF['DB']['LOCAL']['PASS'], "UTF8");

$q = ibase_prepare("UPDATE ORDERS SET EXECUTION_TIME = ? WHERE ID = ?");
ibase_execute($q, "15:00", 670);

$q = ibase_query("SELECT EXECUTION_DATE, EXECUTION_TIME FROM ORDERS WHERE
ID = 670");
$r = ibase_fetch_object($q);

print_r($r);


Expected result:
----------------
stdClass Object
(
    [EXECUTION_DATE] => 05.01.2009
    [EXECUTION_TIME] => 15:00
)


Actual result:
--------------
stdClass Object
(
    [EXECUTION_DATE] => 05.01.2009
    [EXECUTION_TIME] => 31:00
)
/*
When adding IBASE_UNIXTIMES flag, like:
$r = ibase_fetch_object($q, IBASE_UNIXTIMES);
then [EXECUTION_TIME] => -1
*/

-- 
Edit bug report at http://bugs.php.net/?id=47006&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47006&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47006&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47006&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47006&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47006&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47006&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47006&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47006&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47006&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47006&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47006&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47006&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47006&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47006&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47006&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47006&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47006&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47006&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47006&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47006&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47006&r=mysqlcfg

Reply via email to