#5748: Mssql describe() returns wrong value for integer defaults
---------------------------+------------------------------------------------
Reporter: Pixilation | Type: Bug
Status: new | Priority: Medium
Milestone: 1.2.x.x | Component: MSSQL
Version: RC3 | Severity: Normal
Keywords: | Php_version: n/a
Cake_version: |
---------------------------+------------------------------------------------
== What I did ==
I was trying to add multiple records like so:
{{{
$model->create();
$model->save($data);
}}}
And it failed! The error message said:
{{{
Conversion failed when converting the varchar value '(0)' to data type
int.
}}}
I worked out this was for a column that I wasn't even entering data for. I
was relying on the default value of 0, but at some point this turned into
'(0)'.
== The cause ==
If your default value is ''TEST'' then MsSql returns ''('TEST')''. If your
default value is ''0'', then MsSql returns ''((0))''. The describe()
function already filters out the outer brackets and apostrophes, but
misses the inner brackets for integer defaults.
--
Ticket URL: <https://trac.cakephp.org/ticket/5748>
CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/>
Cake is a rapid development framework for PHP which uses commonly known design
patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC.
Our primary goal is to provide a structured framework that enables PHP users at
all levels to rapidly develop robust web applications, without any loss to
flexibility.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"tickets cakephp" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/tickets-cakephp?hl=en
-~----------~----~----~----~------~----~------~--~---