7299_testToMaster #2411

Merged
alexm merged 342 commits from 7299_testToMaster into master 2024-05-07 05:30:42 +00:00
5 changed files with 17 additions and 8 deletions
Showing only changes of commit 56dc0ddb68 - Show all commits

View File

@ -147,7 +147,7 @@ proc:BEGIN
(@t := IF(i.stems, i.stems, 1)) * e.pri / IFNULL(i.stemMultiplier, 1) buyingValue, (@t := IF(i.stems, i.stems, 1)) * e.pri / IFNULL(i.stemMultiplier, 1) buyingValue,
IFNULL(vItem, vDefaultEntry) itemFk, IFNULL(vItem, vDefaultEntry) itemFk,
e.qty stickers, e.qty stickers,
@pac := IFNULL(i.stemMultiplier, 1) * e.pac / @t packing, @pac := GREATEST(1, i.stemMultiplier * e.pac / @t) packing,
IFNULL(b.`grouping`, e.pac), IFNULL(b.`grouping`, e.pac),
@pac * e.qty, @pac * e.qty,
vForceToPacking, vForceToPacking,

View File

@ -3,6 +3,6 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` EVENT `hedera`.`order_doRecalc`
ON SCHEDULE EVERY 10 SECOND ON SCHEDULE EVERY 10 SECOND
STARTS '2019-08-29 14:18:04.000' STARTS '2019-08-29 14:18:04.000'
ON COMPLETION PRESERVE ON COMPLETION PRESERVE
ENABLE DISABLE
DO CALL order_doRecalc$$ DO CALL order_doRecalc$$
DELIMITER ; DELIMITER ;

View File

@ -10,6 +10,7 @@ proc: BEGIN
LEAVE proc; LEAVE proc;
END IF; END IF;
INSERT INTO orderRecalc SET orderFk = vSelf; -- #4409 Disable order recalc
-- INSERT INTO orderRecalc SET orderFk = vSelf;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -6,16 +6,24 @@ BEGIN
*/ */
DECLARE vSlowQueryLog INT DEFAULT @@slow_query_log; DECLARE vSlowQueryLog INT DEFAULT @@slow_query_log;
DECLARE vSqlLogBin INT DEFAULT @@SESSION.sql_log_bin; DECLARE vSqlLogBin INT DEFAULT @@SESSION.sql_log_bin;
DECLARE vLogExists BOOL;
SET sql_log_bin = OFF; SET sql_log_bin = OFF;
SET GLOBAL slow_query_log = OFF; SET GLOBAL slow_query_log = OFF;
RENAME TABLE `mysql`.`slow_log` TO `mysql`.`slow_log_temp`; SELECT COUNT(*) > 0 INTO vLogExists
FROM information_schema.TABLES
WHERE TABLE_SCHEMA = 'mysql' AND TABLE_NAME = 'slow_log';
DELETE FROM `mysql`.`slow_log_temp` IF vLogExists THEN
DROP TEMPORARY TABLE IF EXISTS mysql.slow_log_temp;
RENAME TABLE mysql.slow_log TO mysql.slow_log_temp;
END IF;
DELETE FROM mysql.slow_log_temp
WHERE start_time < TIMESTAMPADD(WEEK, -1, util.VN_NOW()); WHERE start_time < TIMESTAMPADD(WEEK, -1, util.VN_NOW());
RENAME TABLE `mysql`.`slow_log_temp` TO `mysql`.`slow_log`; RENAME TABLE mysql.slow_log_temp TO mysql.slow_log;
SET GLOBAL slow_query_log = vSlowQueryLog; SET GLOBAL slow_query_log = vSlowQueryLog;
SET sql_log_bin = vSqlLogBin; SET sql_log_bin = vSqlLogBin;

View File

@ -19,7 +19,7 @@ module.exports = Self => {
if (ticket.ticketFk != claim.ticketFk) if (ticket.ticketFk != claim.ticketFk)
throw new UserError(`Cannot create a new claimBeginning from a different ticket`); throw new UserError(`Cannot create a new claimBeginning from a different ticket`);
} }
// await claimIsEditable(ctx); await claimIsEditable(ctx);
}); });
Self.observe('before delete', async ctx => { Self.observe('before delete', async ctx => {
@ -36,7 +36,7 @@ module.exports = Self => {
if (ctx.options && ctx.options.transaction) if (ctx.options && ctx.options.transaction)
myOptions.transaction = ctx.options.transaction; myOptions.transaction = ctx.options.transaction;
const claimBeginning = await Self.findById(ctx.where.id); const claimBeginning = ctx.instance ?? await Self.findById(ctx.where.id);
const filter = { const filter = {
where: {id: claimBeginning.claimFk}, where: {id: claimBeginning.claimFk},