Development

#1718 (BUG: Creole/Propel : Type casting error on UPDATE)

You must first sign up to be able to contribute.

Ticket #1718 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

BUG: Creole/Propel : Type casting error on UPDATE

Reported by: Emiliano.Gabrielli Assigned to: fabien
Priority: major Milestone: 1.0.3
Component: model Version: 1.0.2
Keywords: criteria update bug "type casting" Cc:
Qualification:

Description

When performig an UPDATE statement using Criteria:CUSTOM Propel forces the field it to be an integer, being integer the Creole DB field type:

   $con = Propel::getConnection();
   $c1 = new Criteria();
   $c1->add(NewsViewedPeer::DE_NEWS_ID, $id);
   // update set
   $c2 = new Criteria();
   $c2->add(NewsViewedPeer::VIEWED, 'viewed+1', Criteria::CUSTOM);
   BasePeer::doUpdate($c1,$c2,$con);

The resulting query is

  UPDATE news_viewed SET VIEWED = 'viewed+1' WHERE .....

This makes impossible to use UPDATE in Criteria on non Text fields... this is a major bug IMHO, as it force to make a direct SQL query to do the job..

Change History

04/28/07 12:16:14 changed by l2k

  • status changed from new to closed.
  • resolution set to invalid.

Please report propel issues to the propel trac.

04/28/07 14:58:05 changed by Emiliano.Gabrielli

Ok, I opened a ticket at creole .. hope it's ok now

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting.
Sensio Labs also supports several large Open-Source projects.