#5695: FLOAT UNSIGNED recognized as 'text'
------------------------------------+---------------------------------------
    Reporter:  Xr                   |          Type:  Bug   
      Status:  new                  |      Priority:  Medium
   Milestone:  1.2.x.x              |     Component:  MySQL 
     Version:  RC3                  |      Severity:  Normal
    Keywords:  float unsigned text  |   Php_version:  PHP 5 
Cake_version:  1.2.0.7692 RC3       |  
------------------------------------+---------------------------------------
 `DboMysql::column($real)` recognizes fields of type ''FLOAT UNSIGNED'' as
 ''text''. This renders the fix for #5141 inoperative for fields of this
 type.

 Apparently, such a type is perfectly legal. From the
 [http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html MySQL5
 documentation]:

 > Floating-point and fixed-point types also can be UNSIGNED. As with
 integer types, this attribute prevents negative values from being stored
 in the column. However, unlike the integer types, the upper range of
 column values remains the same.

 In other words, it merely offers some database-side restriction in the
 entered values.

 The problem comes from the type detection of `column($real)`, which checks
 for the exact ''float'' string, but won't chop the ''unsigned'' before
 doing so. Note that since ''INTEGER UNSIGNED'' is passed to the function
 as ''int(10) unsigned'', the ''unsigned'' attribute is removed by the
 following line:
 {{{
 list($col, $vals) = explode('(', $col);
 }}}
 and ''UNSIGNED INT'' is thus properly recognized as ''integer''.

 This is still the case in the current revision, cf.
 source:/branches/1.2.x.x/cake/libs/model/datasources/dbo/[EMAIL PROTECTED]

 Note that this also applies to `DboMysqli` for the same reasons.

 Cheers.

-- 
Ticket URL: <https://trac.cakephp.org/ticket/5695>
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
-~----------~----~----~----~------~----~------~--~---

  • [CakePHP : The Rapid Dev... CakePHP : The Rapid Development Framework for PHP

Reply via email to