7199-devToTest_2316 #2287

Merged
alexm merged 169 commits from 7199-devToTest_2316 into test 2024-04-11 06:25:23 +00:00
2 changed files with 18 additions and 5 deletions
Showing only changes of commit 4a31fe29b8 - Show all commits

View File

@ -4,7 +4,7 @@ DELIMITER $$
$$ $$
CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.catalogue_get(vLanded DATE, vPostalCode VARCHAR(15)) CREATE DEFINER=`root`@`localhost` PROCEDURE floranet.catalogue_get(vLanded DATE, vPostalCode VARCHAR(15))
READS SQL DATA READS SQL DATA
BEGIN proc:BEGIN
/** /**
* Returns list, price and all the stuff regarding the floranet items * Returns list, price and all the stuff regarding the floranet items
* *
@ -12,10 +12,22 @@ BEGIN
* @param vPostalCode Delivery address postal code * @param vPostalCode Delivery address postal code
*/ */
DECLARE vLastCatalogueFk INT; DECLARE vLastCatalogueFk INT;
DECLARE vLockName VARCHAR(20);
DECLARE vLockTime INT;
START TRANSACTION; DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
DO RELEASE_LOCK(vLockName);
SELECT * FROM catalogue FOR UPDATE; RESIGNAL;
END;
SET vLockName = 'catalogue_get';
SET vLockTime = 15;
IF NOT GET_LOCK(vLockName, vLockTime) THEN
LEAVE proc;
END IF;
SELECT MAX(id) INTO vLastCatalogueFk SELECT MAX(id) INTO vLastCatalogueFk
FROM catalogue; FROM catalogue;
@ -46,7 +58,7 @@ BEGIN
FROM catalogue FROM catalogue
WHERE id > IFNULL(vLastCatalogueFk,0); WHERE id > IFNULL(vLastCatalogueFk,0);
COMMIT; DO RELEASE_LOCK(vLockName);
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -13,7 +13,8 @@ BEGIN
i.longName i.longName
FROM vn.item i FROM vn.item i
JOIN vn.itemType it ON it.id = i.typeFk JOIN vn.itemType it ON it.id = i.typeFk
WHERE it.code IN ('FNR','FNP'); WHERE it.code IN ('FNR','FNP')
LIMIT 3;
END$$ END$$
DELIMITER ; DELIMITER ;