Hotfix changes whit conficts merged incorrectly #2829
|
@ -11,24 +11,29 @@ BEGIN
|
|||
*/
|
||||
DECLARE vSaleFk INT;
|
||||
DECLARE vHasProblem INT;
|
||||
DECLARE vIsProblemCalcNeeded BOOL;
|
||||
DECLARE vDone BOOL;
|
||||
DECLARE vSaleList CURSOR FOR SELECT saleFk, hasProblem FROM tmp.sale;
|
||||
DECLARE vSaleList CURSOR FOR
|
||||
SELECT saleFk, hasProblem, isProblemCalcNeeded
|
||||
FROM tmp.sale;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
OPEN vSaleList;
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH vSaleList INTO vSaleFk, vHasProblem;
|
||||
FETCH vSaleList INTO vSaleFk, vHasProblem, vIsProblemCalcNeeded;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
UPDATE sale
|
||||
SET problem = CONCAT(
|
||||
IF(vHasProblem,
|
||||
CONCAT(problem, ',', vProblemCode),
|
||||
REPLACE(problem, vProblemCode , '')))
|
||||
SET problem = IF (vIsProblemCalcNeeded,
|
||||
CONCAT(
|
||||
IF(vHasProblem,
|
||||
CONCAT(problem, ',', vProblemCode),
|
||||
REPLACE(problem, vProblemCode , ''))),
|
||||
NULL)
|
||||
WHERE id = vSaleFk;
|
||||
END LOOP;
|
||||
CLOSE vSaleList;
|
||||
|
|
|
@ -12,24 +12,28 @@ BEGIN
|
|||
*/
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE vHasProblem INT;
|
||||
DECLARE vIsProblemCalcNeeded BOOL;
|
||||
DECLARE vDone BOOL;
|
||||
DECLARE vTicketList CURSOR FOR SELECT ticketFk, hasProblem FROM tmp.ticket;
|
||||
DECLARE vTicketList CURSOR FOR
|
||||
SELECT ticketFk, hasProblem, isProblemCalcNeeded
|
||||
FROM tmp.ticket;
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
|
||||
|
||||
OPEN vTicketList;
|
||||
l: LOOP
|
||||
SET vDone = FALSE;
|
||||
FETCH vTicketList INTO vTicketFk, vHasProblem;
|
||||
FETCH vTicketList INTO vTicketFk, vHasProblem, vIsProblemCalcNeeded;
|
||||
|
||||
IF vDone THEN
|
||||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
UPDATE ticket
|
||||
SET problem = CONCAT(
|
||||
IF(vHasProblem,
|
||||
SET problem = IF(vIsProblemCalcNeeded,
|
||||
CONCAT(IF(vHasProblem,
|
||||
CONCAT(problem, ',', vProblemCode),
|
||||
REPLACE(problem, vProblemCode , '')))
|
||||
REPLACE(problem, vProblemCode , ''))),
|
||||
NULL)
|
||||
WHERE id = vTicketFk;
|
||||
END LOOP;
|
||||
CLOSE vTicketList;
|
||||
|
|
Loading…
Reference in New Issue