This commit is contained in:
parent
4757ce11a3
commit
625b3a5608
|
@ -7,6 +7,8 @@ BEGIN
|
||||||
DECLARE vExpeditionFk INT;
|
DECLARE vExpeditionFk INT;
|
||||||
DECLARE vBufferToFk INT;
|
DECLARE vBufferToFk INT;
|
||||||
DECLARE vBufferFromFk INT;
|
DECLARE vBufferFromFk INT;
|
||||||
|
DECLARE vStateOutFk INT
|
||||||
|
DEFAULT (SELECT id FROM expeditionState WHERE `description` = 'OUT');
|
||||||
DECLARE vDone BOOL DEFAULT FALSE;
|
DECLARE vDone BOOL DEFAULT FALSE;
|
||||||
DECLARE vSorter CURSOR FOR
|
DECLARE vSorter CURSOR FOR
|
||||||
SELECT m.expeditionFk, m.bufferToFk, m.bufferFromFk
|
SELECT m.expeditionFk, m.bufferToFk, m.bufferFromFk
|
||||||
|
@ -52,10 +54,10 @@ BEGIN
|
||||||
OR (bufferFk = vBufferFromFk AND `position` > 0)
|
OR (bufferFk = vBufferFromFk AND `position` > 0)
|
||||||
FOR UPDATE;
|
FOR UPDATE;
|
||||||
|
|
||||||
UPDATE expedition
|
UPDATE expedition
|
||||||
SET bufferFk = NULL,
|
SET bufferFk = NULL,
|
||||||
`position` = NULL,
|
`position` = NULL,
|
||||||
stateFk = (SELECT id FROM expeditionState WHERE `description` = 'OUT')
|
stateFk = vStateOutFk
|
||||||
WHERE id = vExpeditionFk;
|
WHERE id = vExpeditionFk;
|
||||||
|
|
||||||
UPDATE expedition
|
UPDATE expedition
|
||||||
|
@ -64,7 +66,6 @@ BEGIN
|
||||||
AND `position` > 0;
|
AND `position` > 0;
|
||||||
|
|
||||||
COMMIT;
|
COMMIT;
|
||||||
|
|
||||||
END LOOP l;
|
END LOOP l;
|
||||||
CLOSE vSorter;
|
CLOSE vSorter;
|
||||||
END$$
|
END$$
|
||||||
|
|
Loading…
Reference in New Issue