From a883654b7040b4390f1c630508fe21ae16218a97 Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Thu, 28 May 2009 23:36:30 +0000 Subject: [PATCH] Should fail transaction when trying to update where already assigned --- functions/functions.operator.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/functions/functions.operator.php b/functions/functions.operator.php index 9981543a..719e6efe 100644 --- a/functions/functions.operator.php +++ b/functions/functions.operator.php @@ -456,9 +456,10 @@ function get_case_id($operator_id, $create = false) $sql = "UPDATE `case` SET current_operator_id = '$operator_id' - WHERE case_id = '$case_id'"; - + WHERE current_operator_id IS NULL + AND case_id = '$case_id'"; + //should fail transaction if already assigned to another case $db->Execute($sql);