1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00

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
This commit is contained in:
epriestley 2013-02-27 10:51:34 -08:00
parent 5d30b1b4fb
commit 8d20e42c1c

View file

@ -202,15 +202,18 @@ final class ManiphestTask extends ManiphestDAO
foreach ($update as $key => $val) { foreach ($update as $key => $val) {
$sql[] = qsprintf( $sql[] = qsprintf(
$conn_w, $conn_w,
'(%s, %s, %s)', '(%s, %s, %s, %d, %d)',
$this->getPHID(), $this->getPHID(),
$key, $key,
$val); $val,
time(),
time());
} }
queryfx( queryfx(
$conn_w, $conn_w,
'INSERT INTO %T (taskPHID, name, value) VALUES %Q 'INSERT INTO %T (taskPHID, name, value, dateCreated, dateModified)
ON DUPLICATE KEY UPDATE value = VALUES(value)', VALUES %Q ON DUPLICATE KEY
UPDATE value = VALUES(value), dateModified = VALUES(dateModified)',
$table->getTableName(), $table->getTableName(),
implode(', ', $sql)); implode(', ', $sql));
} }