From 8d20e42c1c0af6526c7faf16cd6f5bfe75407e68 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 27 Feb 2013 10:51:34 -0800 Subject: [PATCH] Fix a MySQL strict issue with auxiliary task storage Summary: This table has date columns but we don't populate them correctly. In strict mode with custom fields, this throws when creating a task. Test Plan: Created a task in strict mode with custom fields. Reviewers: chad, vrana Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D5137 --- src/applications/maniphest/storage/ManiphestTask.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/applications/maniphest/storage/ManiphestTask.php b/src/applications/maniphest/storage/ManiphestTask.php index cd62f2351b..91fd4dfb2b 100644 --- a/src/applications/maniphest/storage/ManiphestTask.php +++ b/src/applications/maniphest/storage/ManiphestTask.php @@ -202,15 +202,18 @@ final class ManiphestTask extends ManiphestDAO foreach ($update as $key => $val) { $sql[] = qsprintf( $conn_w, - '(%s, %s, %s)', + '(%s, %s, %s, %d, %d)', $this->getPHID(), $key, - $val); + $val, + time(), + time()); } queryfx( $conn_w, - 'INSERT INTO %T (taskPHID, name, value) VALUES %Q - ON DUPLICATE KEY UPDATE value = VALUES(value)', + 'INSERT INTO %T (taskPHID, name, value, dateCreated, dateModified) + VALUES %Q ON DUPLICATE KEY + UPDATE value = VALUES(value), dateModified = VALUES(dateModified)', $table->getTableName(), implode(', ', $sql)); }