#6137: created time was reset during update --------------------------------+------------------------------------------- Reporter: dq...@yahoo.com | Owner: mark_story Type: Test Case | Status: assigned Priority: High | Milestone: 1.2.x.x Component: PostgreSQL | Version: 1.2 Final Severity: Critical | Resolution: Keywords: | Php_version: PHP 5 Cake_version: | --------------------------------+------------------------------------------- Comment (by dq...@yahoo.com):
Thank you. I create the test case. use set will solve the problem in live server. The problem is the test server is correct with all actions. is the pdo version matter? I saw the version is a little bit different. PostgreSQL(libpq) Version 7.4.19 (Test) PostgreSQL(libpq) Version 7.4.17 (live) CREATE TABLE "public"."default_tests" ( "id" SERIAL, "firstname" VARCHAR(255) DEFAULT ''::character varying NOT NULL, "lastname" VARCHAR(255) DEFAULT ''::character varying NOT NULL, "nickname" TEXT, "created" TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL, "height" SMALLINT, "weight" SMALLINT, "modified" TIMESTAMP WITHOUT TIME ZONE DEFAULT now() NOT NULL, "birthday" DATE, "notes" VARCHAR, "title" TEXT, "initial_entry" VARCHAR(100), "gender" CHAR(1), CONSTRAINT "default_tests_pkey" PRIMARY KEY("id") ) WITHOUT OIDS; CREATE UNIQUE INDEX "default_tests_id_key" ON "public"."default_tests" USING btree ("id"); Model: <?php class DefaultTest extends AppModel { } Action: public function test() { if($check = $this->DefaultTest->findById(1)){ var_dump($check); $this->DefaultTest->create(array('id'=>1, 'title'=>'Tt_edit')); $this->DefaultTest->save(null, false); } exit; } **************Test Server************************** SELECT "DefaultTest"."id" AS "DefaultTest__id", "DefaultTest"."firstname" AS "DefaultTest__firstname", "DefaultTest"."lastname" AS "DefaultTest__lastname", "DefaultTest"."nickname" AS "DefaultTest__nickname", "DefaultTest"."created" AS "DefaultTest__created", "DefaultTest"."height" AS "DefaultTest__height", "DefaultTest"."weight" AS "DefaultTest__weight", "DefaultTest"."modified" AS "DefaultTest__modified", "DefaultTest"."birthday" AS "DefaultTest__birthday", "DefaultTest"."notes" AS "DefaultTest__notes", "DefaultTest"."title" AS "DefaultTest__title", "DefaultTest"."gender" AS "DefaultTest__gender", "DefaultTest"."initial_entry" AS "DefaultTest__initial_entry" FROM "default_tests" AS "DefaultTest" WHERE "DefaultTest"."id" = '1' LIMIT 1 Model->find(array, NULL, NULL, NULL) /cake/libs/model/datasources/dbo_source.php, line 252 Model->call__(string, array) /cake/libs/overloadable_php5.php, line 59 Overloadable->__call(string, array) DefaultTest->findById(1) /app/controllers/drills_verify_controller.php, line 305 DrillsVerifyController->test() call_user_func_array(array, array) /cake/dispatcher.php, line 280 Dispatcher->_invoke(DrillsVerifyController, array, boolean) /cake/dispatcher.php, line 252 Dispatcher->dispatch(NULL) /app/webroot/index.php, line 84 0 1 2 150 SELECT COUNT(*) AS "count" FROM "default_tests" AS "DefaultTest" WHERE "DefaultTest"."id" = '1' Model->find(string, array) /cake/libs/model/model.php, line 1885 Model->findCount(array, -1) /cake/libs/model/model.php, line 1631 Model->exists() /cake/libs/model/model.php, line 1127 Model->save(NULL, boolean) /app/controllers/drills_verify_controller.php, line 308 DrillsVerifyController->test() call_user_func_array(array, array) /cake/dispatcher.php, line 280 Dispatcher->_invoke(DrillsVerifyController, array, boolean) /cake/dispatcher.php, line 252 Dispatcher->dispatch(NULL) /app/webroot/index.php, line 84 0 1 1 151 UPDATE "default_tests" SET "id" = '1', "title" = 'Tt_edit', "modified" = '2009-02-27 08:52:21' WHERE "default_tests"."id" IN ('1') ***********************Live Server************************** SELECT "DefaultTest"."id" AS "DefaultTest__id", "DefaultTest"."firstname" AS "DefaultTest__firstname", "DefaultTest"."lastname" AS "DefaultTest__lastname", "DefaultTest"."nickname" AS "DefaultTest__nickname", "DefaultTest"."created" AS "DefaultTest__created", "DefaultTest"."height" AS "DefaultTest__height", "DefaultTest"."weight" AS "DefaultTest__weight", "DefaultTest"."modified" AS "DefaultTest__modified", "DefaultTest"."birthday" AS "DefaultTest__birthday", "DefaultTest"."notes" AS "DefaultTest__notes", "DefaultTest"."title" AS "DefaultTest__title", "DefaultTest"."initial_entry" AS "DefaultTest__initial_entry", "DefaultTest"."gender" AS "DefaultTest__gender" FROM "default_tests" AS "DefaultTest" WHERE "DefaultTest"."id" = '1' LIMIT 1 Model->find(array, NULL, NULL, NULL) /cake/libs/model/datasources/dbo_source.php, line 252 Model->call__(string, array) /cake/libs/overloadable_php5.php, line 59 Overloadable->__call(string, array) DefaultTest->findById(1) /app/controllers/drills_verify_controller.php, line 305 DrillsVerifyController->test() call_user_func_array(array, array) /cake/dispatcher.php, line 280 Dispatcher->_invoke(DrillsVerifyController, array, boolean) /cake/dispatcher.php, line 252 Dispatcher->dispatch(NULL) /app/webroot/index.php, line 84 0 1 2 14 SELECT COUNT(*) AS "count" FROM "default_tests" AS "DefaultTest" WHERE "DefaultTest"."id" = '1' Model->find(string, array) /cake/libs/model/model.php, line 1885 Model->findCount(array, -1) /cake/libs/model/model.php, line 1631 Model->exists() /cake/libs/model/model.php, line 1127 Model->save(NULL, boolean) /app/controllers/drills_verify_controller.php, line 308 DrillsVerifyController->test() call_user_func_array(array, array) /cake/dispatcher.php, line 280 Dispatcher->_invoke(DrillsVerifyController, array, boolean) /cake/dispatcher.php, line 252 Dispatcher->dispatch(NULL) /app/webroot/index.php, line 84 0 1 1 15 UPDATE "default_tests" SET "firstname" = '''''::character varying', "lastname" = '''''::character varying', "created" = 'now()', "modified" = 'now()', "id" = '1', "title" = 'Tt_edit' WHERE "default_tests"."id" IN ('1') ******************Change the Action, Same problem********************* public function test() { $this->DefaultTest->create(array('id'=>1, 'title'=>'Tt_edit')); $this->DefaultTest->save(null, false); exit; } 3 SELECT COUNT(*) AS "count" FROM "default_tests" AS "DefaultTest" WHERE "DefaultTest"."id" = '1' Model->find(string, array) /cake/libs/model/model.php, line 1885 Model->findCount(array, -1) /cake/libs/model/model.php, line 1631 Model->exists() /cake/libs/model/model.php, line 1127 Model->save(NULL, boolean) /app/controllers/drills_verify_controller.php, line 307 DrillsVerifyController->test() call_user_func_array(array, array) /cake/dispatcher.php, line 280 Dispatcher->_invoke(DrillsVerifyController, array, boolean) /cake/dispatcher.php, line 252 Dispatcher->dispatch(NULL) /app/webroot/index.php, line 84 0 1 1 4 UPDATE "default_tests" SET "firstname" = '''''::character varying', "lastname" = '''''::character varying', "created" = 'now()', "modified" = 'now()', "id" = '1', "title" = 'Tt_edit' WHERE "default_tests"."id" IN ('1') ******************Change the Action again using set, This time is OK********************* public function test() { $this->DefaultTest->set(array('id'=>1, 'title'=>'Tt_edit')); $this->DefaultTest->save(null, false); exit; } 3 SELECT COUNT(*) AS "count" FROM "default_tests" AS "DefaultTest" WHERE "DefaultTest"."id" = '1' Model->find(string, array) /cake/libs/model/model.php, line 1885 Model->findCount(array, -1) /cake/libs/model/model.php, line 1631 Model->exists() /cake/libs/model/model.php, line 1127 Model->save(NULL, boolean) /app/controllers/drills_verify_controller.php, line 307 DrillsVerifyController->test() call_user_func_array(array, array) /cake/dispatcher.php, line 280 Dispatcher->_invoke(DrillsVerifyController, array, boolean) /cake/dispatcher.php, line 252 Dispatcher->dispatch(NULL) /app/webroot/index.php, line 84 0 1 1 4 UPDATE "default_tests" SET "id" = '1', "title" = 'Tt_edit', "modified" = '2009-02-27 08:14:04' WHERE "default_tests"."id" IN ('1') -- Ticket URL: <https://trac.cakephp.org/ticket/6137#comment:3> 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 tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---