Projects ⇒ Bugs ⇒ #1009: install does not set UNSIGNED ⇒ CPG Dragonfly™ CMS
Bug #1009 install does not set UNSIGNED
Project: Dragonfly 9.0.3 -> 9.3 Category: SQL
Submitted: Tuesday, January 08, 2008 (20:53:26) Modified: Thursday, April 24, 2008 (12:04:06)
Status: Closed Assigned to:
PHP Version: 5.2 HTTPD Server: Apache 2.0

View/Vote Add Comment

by: BrokenCrust
Description:
------------
The $installer->add_query does not set the UNSIGNED field attribute when used to add a field.

$installer->add_query('ADD', 'table_name', "column_name SMALLINT(3) UNSIGNED DEFAULT 0 NOT NULL");



Reproduce code:
---------------
$installer->add_query('ADD', 'table_name', "column_name SMALLINT(3) UNSIGNED DEFAULT 0 NOT NULL");

The UNSIGNED attribute will be lost.

Expected result:
----------------
The field will be marked as UNSIGNED

Actual result:
--------------
Field is created by UNSIGNED is not set.
by: NanoCaiordo
This bug has been fixed in the CVS.

Snapshots of the sources are packaged every 6 hours; this change
will be in the next snapshot. You can grab the snapshot at the
Downloads section.

Thank you for the report, and for helping us to make Dragonfly 9.0.3 -> 9.2 better.

Index: includes/classes/installer.php =================================================================== RCS file: /cvs/html/includes/classes/installer.php,v retrieving revision 9.14 diff -u -r9.14 installer.php --- includes/classes/installer.php 24 Apr 2008 11:17:32 -0000 9.14 +++ includes/classes/installer.php 24 Apr 2008 11:41:01 -0000 @@ -9,9 +9,9 @@ of the GNU GPL version 2 or any later version $Source: /cvs/html/includes/classes/installer.php,v $ - $Revision: 9.14 $ + $Revision: 9.13 $ $Author: nanocaiordo $ - $Date: 2008/04/24 11:17:32 $ + $Date: 2008/04/19 12:18:46 $ **********************************************/ define('_INST_NO_DB_CLASS', 'There\'s no database class defined !'); @@ -90,7 +90,7 @@ preg_match('/([a-z0-9\_]+)[\s\'"`]+([a-z0-9\(\)]+)(.*[\s]+DEFAULT[\s]+([0-9]+|NULL|[\'"](.*)[\'"]))?/is', $query[2], $match); $query[2] = array( $match[1], - $match[2], + (false !== stripos($match[2],'int') && false !== stripos($query[2], 'unsigned')) ? trim($match[2]).' UNSIGNED' : $match[2] , false === stripos($query[2], 'NOT NULL'), !empty($match[3]) ? (isset($match[5]) ? $match[5] : $match[4]) : false ); );

Postgresql note: create_pattern() will properly remove UNISIGNED.
User Info

Welcome Anonymous



(Register)
Community

Support for DragonflyCMS in a other languages:

Deutsch
Español