PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #6571

Thinks a decimal(10,2) is unknown(11) not_null unsigned

Details

Submitted2006-01-24 19:52 UTC
Frompear_bug at tmesolutions dot co dot uk
StatusDuplicate
PackageDB
PHP Version5.1.2
OSwindows xp sp2
Roadmaps(Not assigned)

Comments

[2006-01-24 19:52 UTC] pear_bug at tmesolutions dot co dot uk

Description:
------------
Its not saving any data to one of my database fields. It excludes it because it believes it is a timestamp..

* @version CVS: $Id: DataObject.php,v 1.361 2005/07/06 06:13:09 alan_k Exp $(line 1161 - 1165 DataObject.php)
// dont insert data into mysql timestamps
// use query() if you really want to do this!!!!
if ($v & DB_DATAOBJECT_MYSQLTIMESTAMP) {
continue;
}

but its not a timestamp, its a decimal(10,2)

Test script:
---------------
table SQL

CREATE TABLE `cms_content_product` (
`id` int(10) unsigned NOT NULL auto_increment,
`site_id` int(10) unsigned NOT NULL default '0',
`name` varchar(100) NOT NULL default '',
`description` text NOT NULL,
`product_section_id` int(10) unsigned NOT NULL default '0',
`price` decimal(10,2) unsigned NOT NULL default '0.00',
`image` varchar(150) default NULL,
PRIMARY KEY (`id`),
KEY `site_id` (`site_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

compiled db class:
<?php
/**
* Table Definition for cms_content_product
*/
require_once 'DB/DataObject.php';

class DataObjects_Cms_content_product extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */

public $__table = 'cms_content_product'; // table name
public $id; // int(10) not_null primary_key unsigned auto_increment
public $site_id; // int(10) not_null multiple_key unsigned
public $name; // string(100) not_null
public $description; // blob(65535) not_null blob
public $product_section_id; // int(10) not_null unsigned
public $price; // unknown(11) not_null unsigned
public $image; // string(150)

/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Cms_content_product',$k,$v); }

/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}

Expected result:
----------------
to save a value to field price

Actual result:
--------------
skips changes to price (all other fields updated). It thinks price is a timestamp ?