Re: Bug #14843 [Opn->Fbk]: alterTable() 'ADD COLUMN' bug in mssql driver
| From: | Tonya Torshin | Date: | Mon, 27 Oct 2008 17:02:16 +0000 |
| Subject: | Re: Bug #14843 [Opn->Fbk]: alterTable() 'ADD COLUMN' bug in mssql driver | ||
| References: | 1 | Groups: | php.pear.qa |
| Request: | Send a blank email to pear-qa+get-4965@lists.php.net to get a copy of this message | ||
Hi, yes it looks like it has been fixed in your latest beta version 1.3.0b1
...
if (!empty($changes['add']) && is_array($changes['add'])) {
$query = '';
foreach ($changes['add'] as $field_name => $field) {
if ($query) {
$query.= ', ';
} else {
$query.= '*ADD *';
}
$query.= $db->getDeclaration($field['type'], $field_name, $field);
}
...
I apologize for not having a look first.
(any ideas when you might release a stable version?)
Thank you for your time and reply.
--
Tonya Torshina
tonya@one45.com
(604) 742-0029
eRezLife Software
erezlife.com
PEAR Bug Database wrote:
> ATTENTION! Do NOT reply to this email!
> To reply, use the web interface found at
> http://pear.php.net/bugs/bug.php?id=14843&edit=2
>
>
> ID: 14843
> Updated by: daniel.oconnor@gmail.com
> Reported By: tonya at one45 dot com
> Summary: alterTable() 'ADD COLUMN' bug in mssql driver
> -Status: Open
> +Status: Feedback
> Type: Bug
> Package: MDB2_Driver_mssql
> Operating System: not relevant
> PHP Version: 5.2.1
> New Comment:
>
> Can you try this from CVS?
>
> It looks fixed.
>
>
> Previous Comments:
> ------------------------------------------------------------------------
>
> [2008-10-21 16:45:03] afz
>
> this is a original syntax:
>
> ALTER TABLE table_name
>
> { [ ALTER COLUMN column_name
>
> {DROP DEFAULT
>
> | SET DEFAULT constant_expression
>
> | IDENTITY [ ( seed , increment ) ]
>
> }
>
> | ADD
>
> { < column_definition > | < table_constraint > } [ ,...n ]
>
> | DROP
>
> { [ CONSTRAINT ] constraint_name
>
> | COLUMN column }
>
> ] }
>
> < column_definition > ::=
>
> { column_name data_type }
>
> [ [ DEFAULT constant_expression ]
>
> | IDENTITY [ ( seed , increment ) ]
>
> ]
>
> [ROWGUIDCOL]
>
> [ < column_constraint > ] [ ...n ] ]
>
> < column_constraint > ::=
>
> [ NULL | NOT NULL ]
>
> [ CONSTRAINT constraint_name ]
>
> {
>
> | { PRIMARY KEY | UNIQUE }
>
> | REFERENCES ref_table [ (ref_column) ]
>
> [ ON DELETE { CASCADE | NO ACTION } ]
>
> [ ON UPDATE { CASCADE | NO ACTION } ]
>
> }
>
> < table_constraint > ::=
>
> [ CONSTRAINT constraint_name ]
>
> { [ { PRIMARY KEY | UNIQUE }
>
> { ( column [ ,...n ] ) }
>
> | FOREIGN KEY
>
> ( column [ ,...n ] )
>
> REFERENCES ref_table [ (ref_column [ ,...n ] ) ]
>
> [ ON DELETE { CASCADE | NO ACTION } ]
>
> [ ON UPDATE { CASCADE | NO ACTION } ]
>
> }
>
>
>
> so, 'ADD COLUMN' is wrong.
>
> ------------------------------------------------------------------------
>
> [2008-10-21 16:23:33] solaris
>
> Description:
> ------------
> Wrong syntax for adding a column for mssql in alterTable() method.
>
> 'ADD COLUMN' instead of just 'ADD'.
>
> This bug could have been introduced when 8783 was fixed.
>
> ------------------------------------------------------------------------
>
>
>
>