Bug #15327 [Opn->Csd]: *defalut* constraint in the alterTable()
| From: | l dot alberton at quipo dot it | Date: | Sun, 29 Mar 2009 18:02:46 +0000 |
| Subject: | Bug #15327 [Opn->Csd]: *defalut* constraint in the alterTable() | ||
| References: | 1 | Groups: | php.pear.bugs |
| Request: | Send a blank email to pear-bugs+get-281@lists.php.net to get a copy of this message | ||
Edit report at http://pear.php.net/bugs/bug.php?id=15327&edit=1
ID: 15327
Updated by: l.alberton@quipo.it
Reported By: tonya at one45 dot com
Summary: *defalut* constraint 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
Have you tried MDB2 2.5.0b2 and MDB2_Driver_mssql 1.3.0b2?
I believe this bug is fixed already there.
Previous Comments:
------------------------------------------------------------------------
[2008-12-16 18:00:09] solaris
Description:
------------
alterTable() is using incorrect syntax to alter a field's default.
Here is syntax:
ALTER TABLE table
{
ADD
{
column_name data_type [ ( size ) ]
[ DEFAULT value ]
{ [ NULL | NOT NULL ] | [ { PRIMARY KEY | UNIQUE } ] }
{ [ CONSTRAINT constraint_name ] }
}
|
ALTER COLUMN column_name
{
data_type [ ( size ) ] [ ( precision [ , scale ] ) ]
[ NULL | NOT NULL ]
}
|
DROP { COLUMN column_name | [ CONSTRAINT ] constraint_name }
}
Test script:
---------------
db()->alterTable(
$table_name,
array(
'change' => array(
$column_name => array(
'definition' => array(
'notnull' => false,
'type' => 'date',
)
)
)
)
);
Expected result:
----------------
ALTER TABLE TEST_DATE_INSERT ALTER COLUMN START_DATE SMALLDATETIME NULL
Actual result:
--------------
ALTER TABLE TEST_DATE_INSERT ALTER COLUMN START_DATE CHAR (10) DEFAULT
NULL
Native code: 156
Native message: Incorrect syntax near the keyword 'DEFAULT'
------------------------------------------------------------------------
--
Edit this bug report at http://pear.php.net/bugs/bug.php?id=15327&edit=1