Bug #15328 [Opn->Csd]: mdb2 *date* data type is not maped correctly in the alterTable()

From: Date: Sun, 29 Mar 2009 18:14:44 +0000
Subject: Bug #15328 [Opn->Csd]: mdb2 *date* data type is not maped correctly in the alterTable()
References: 1  Groups: php.pear.bugs 
Request: Send a blank email to pear-bugs+get-282@lists.php.net to get a copy of this message
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 ------------------------------------------------------------------------ -- Edit this bug report at http://pear.php.net/bugs/bug.php?id=15328&edit=1

« previous php.pear.bugs (#282) next »