View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006240 | mantisbt | sql | public | 2005-09-12 16:58 | 2008-10-18 18:34 |
Reporter | DGtlRift | Assigned To | DGtlRift | ||
Priority | low | Severity | tweak | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Product Version | git trunk | ||||
Summary | 0006240: db_unixtimestamp and ADODB | ||||
Description | really isn't mantis, it seems like it's actually ADODB, but I have a work around shown in the Add-Info. The issue is that a call like db_unixtimestamp( db_timestamp() ) returns false. It seems that the string with the single quotes returned from db_timestamp() is unhandled in the regex processing in the UnixTimeStamp method used within. | ||||
Additional Information |
| ||||
Tags | No tags attached. | ||||
Attached Files | timestamp.patch (964 bytes)
? timestamp.patch Index: core/database_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/database_api.php,v retrieving revision 1.58 diff -u -B -w -r1.58 database_api.php --- core/database_api.php 22 Jul 2007 21:02:45 -0000 1.58 +++ core/database_api.php 23 Jul 2007 13:38:04 -0000 @@ -492,12 +492,7 @@ function db_timestamp( $p_date=null ) { global $g_db; - if ( null !== $p_date ) { - $p_timestamp = $g_db->UnixTimeStamp($p_date); - } else { - $p_timestamp = time(); - } - return $g_db->DBTimeStamp($p_timestamp) ; + return $g_db->DBTimeStamp(db_unixtimestamp( $p_date )) ; } function db_unixtimestamp( $p_date=null ) { @@ -505,6 +500,9 @@ if ( null !== $p_date ) { $p_timestamp = $g_db->UnixTimeStamp($p_date); + if ( !$p_timestamp ) { + $p_timestamp = $g_db->UnixTimeStamp(str_replace("'", "", $p_date )); + } } else { $p_timestamp = time(); } | ||||
I have submitted a patch. This issue can be resolved when someone with CVS write access does a peer review and patch integration to the source trunk. |
|
DGTlrift, When does one see the issue this is trying to fix? Paul |
|
We have proprietary add-ons that use the core API's, and in the script we use the g_some_global = db_timestamp() to generate a key for set scripts (that take a fair bit of time to run) that log info to the db using db_unixtimestamp(g_some_global) throughout. |
|
If this is an adoDB issue, can you also submit this upstream? |
|
It seems like this is a fairly old issue.. That nobody has posted an issue of on ADODB tracker... |
|
Thanks James: much appreciated |
|
Is this still an issue in trunk? db_timestamp() no longer matches the patch, but db_unixtimestamp() does. Is the second part of the patch still relevant? |
|
I'm closing this under the assumption that the fix is no longer needed. |
|