php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #56841 db2_field_type returns 'string' for date, time, and timestamp
Submitted: 2006-02-15 11:06 UTC Modified: 2006-02-16 12:58 UTC
From: devel at digitalaudiorock dot com Assigned: tessus (profile)
Status: Closed Package: ibm_db2 (PECL)
PHP Version: 5.1.2 OS: Linux x86
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: devel at digitalaudiorock dot com
New email:
PHP Version: OS:

 

 [2006-02-15 11:06 UTC] devel at digitalaudiorock dot com
Description:
------------
For any columns of the types date, time, or timestamp, the db2_field_type function returns 'string'.  It appears that this could be addressed by adding something like the following to the case statement in db2_field_type within ibm_db2.c:

		case SQL_TYPE_DATE:
		case SQL_DATE:
			str_val = "date";
			break;
		case SQL_TYPE_TIME:
		case SQL_TIME:
			str_val = "time";
			break;
		case SQL_TYPE_TIMESTAMP:
		case SQL_TIMESTAMP:
			str_val = "timestamp";
			break;

Though I'm not sure if the SQL_DATE, SQL_TIME, and SQL_DATETIME are needed, or if the others would require ODBCVER compiler directives.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-15 11:15 UTC] devel at digitalaudiorock dot com
Two additional notes:  This is actually in php 5.1.2, but there was no option for this in the dropdown list.  Also, I should have posted the above code in diff form...here it is:

*** ibm_db2.c_ORIG      2006-02-15 09:38:24.343776223 -0500
--- ibm_db2.c   2006-02-15 10:55:01.763884479 -0500
***************
*** 2925,2930 ****
--- 2925,2942 ----
                case SQL_BLOB:
                        str_val = "blob";
                        break;
+               case SQL_TYPE_DATE:
+               case SQL_DATE:
+                       str_val = "date";
+                       break;
+               case SQL_TYPE_TIME:
+               case SQL_TIME:
+                       str_val = "time";
+                       break;
+               case SQL_TYPE_TIMESTAMP:
+               case SQL_TIMESTAMP:
+                       str_val = "timestamp";
+                       break;
                default:
                        str_val = "string";
                        break;
 [2006-02-15 13:06 UTC] tessus at evermeet dot cx
You are correct. The date/time/timestamp values are not tested. I will change the code as soon as possible.
 [2006-02-16 12:58 UTC] tessus at evermeet dot cx
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

added the values for date / time / timestamp.
fixed in cvs. (1.43)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 13:01:29 2024 UTC