8179-testToMaster #3176

Merged
alexm merged 407 commits from 8179-testToMaster into master 2024-11-12 06:41:52 +00:00
1 changed files with 23 additions and 18 deletions
Showing only changes of commit 25680994dd - Show all commits

View File

@ -28,6 +28,8 @@ BEGIN
CREATE OR REPLACE TEMPORARY TABLE tPriceDelta CREATE OR REPLACE TEMPORARY TABLE tPriceDelta
(INDEX (itemFk)) (INDEX (itemFk))
ENGINE = MEMORY ENGINE = MEMORY
SELECT * FROM
(
SELECT i.id itemFk, SELECT i.id itemFk,
SUM(IFNULL(pd.absIncreasing,0)) absIncreasing, SUM(IFNULL(pd.absIncreasing,0)) absIncreasing,
SUM(IFNULL(pd.ratIncreasing,0)) ratIncreasing, SUM(IFNULL(pd.ratIncreasing,0)) ratIncreasing,
@ -42,10 +44,13 @@ BEGIN
AND (pd.producerFk IS NULL OR pd.producerFk = i.producerFk) AND (pd.producerFk IS NULL OR pd.producerFk = i.producerFk)
AND (pd.warehouseFk IS NULL OR pd.warehouseFk = vWarehouseFk) AND (pd.warehouseFk IS NULL OR pd.warehouseFk = vWarehouseFk)
LEFT JOIN zoneGeo zg ON zg.id = pd.zoneGeoFk LEFT JOIN zoneGeo zg ON zg.id = pd.zoneGeoFk
LEFT JOIN zoneGeo zg2 ON zg2.id = address_getGeo(vAddressFk)
WHERE (pd.fromDated IS NULL OR pd.fromDated <= vShipped) WHERE (pd.fromDated IS NULL OR pd.fromDated <= vShipped)
AND (pd.toDated IS NULL OR pd.toDated >= vShipped) AND (pd.toDated IS NULL OR pd.toDated >= vShipped)
AND (pd.zoneGeoFk IS NULL OR address_getGeo(vAddressFk) BETWEEN zg.lft AND zg.rgt) AND (pd.zoneGeoFk IS NULL OR zg2.lft BETWEEN zg.lft AND zg.rgt)
GROUP BY i.id; ORDER BY zg.`depth` DESC
LIMIT 10000000000000000000
) sub GROUP BY itemFk;
CREATE OR REPLACE TEMPORARY TABLE tSpecialPrice CREATE OR REPLACE TEMPORARY TABLE tSpecialPrice
(INDEX (itemFk)) (INDEX (itemFk))