FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=15328&edit=1

ID: 15328
Updated by: l.alberton@quipo.it
Reported By: tonya at one45 dot com
Summary: mdb2 *date* data type is not maped correctly in the
alterTable()
-Status: Open
+Status: Closed
Type: Bug
Package: MDB2_Driver_mssql
Operating System: not relevant
Package Version: 1.2.1
PHP Version: 5.2.1
-Assigned To:
+Assigned To: quipo
Roadmap Versions:
New Comment:

-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: quipo

The goal of MDB2 is to maximise portability. Thus, there are strict
restrictions on the supported data types and their mappings to native
data types. In this case, a date field is mapped to a char(10) field, so
it can contain a date in the ISO-8601 format (YYYY-MM-DD):

http://pear.php.net/manual/en/package.database.mdb2.datatypes.php

"Date data type" paragraph


Previous Comments:
------------------------------------------------------------------------

[2008-12-16 20:03:56] solaris

Description:
------------
Currently all date-time related data types are mapped to the mssql CHAR
type. The mapping looks like happening in the getTypeDeclaration()

I tried to use the custom mapping: $db->setOption('datatype_map',
array('date'=>'smalldatetime'));
But it threw an error of an unknown datatype (Error message: type not
defined: smalldatetime)

Test script:
---------------
db()->alterTable(
$table_name,
array(
'change' => array(
$column_name => array(
'definition' => array(
'type' => 'date',
)
)
)
)
);


Expected result:
----------------
ALTER TABLE TEST_DATE_INSERT ALTER COLUMN START_DATE SMALLDATETIME

Actual result:
--------------
ALTER TABLE TEST_DATE_INSERT ALTER COLUMN START_DATE CHAR (10) DEFAULT
NULL

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedMar 29, '09 at 6:14p
activeMar 29, '09 at 6:14p
posts1
users1
websitepear.php.net

1 user in discussion

L Alberton: 1 post

People

Translate

site design / logo © 2021 Grokbase