0

I hope someone can help me with this; i was testing some modules and didnt like them so decided to do a rollback, offcourse a backup was made so i had no worries in the sky......

But my nightmare became true when the rollback gave error

The system was quite barfed up so i used ssh.

first ;

php -d memory_limit=1536M bin/magento setup:rollback -d backup.sql

gave a ;

Segmentation fault

so i did ;

ulimit -s 65536

and again

php -d memory_limit=1536M bin/magento setup:rollback -d backup.sql

which gave

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'delimiter' at line 1, query was: delimiter ;;

I increased the memory to the max of 4096, no effect I tried it on user and root , no effect

then I said to myself ; WHO NEEDS THIS, just use mysql itself so ;

via ssh cli

mysql -umysecretusername -p mydatabasename < backup.sql

gave an error ;

ERROR at line 302: ASCII '\0' appeared in the statement, but this is not allowed unless option --binary-mode is enabled and mysql is run in non-interactive mode. Set --binary-mode to 1 if ASCII '\0' is expected.

so I did ;

Which gave an error ;

ERROR 1064 (42000) at line 303: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '7559','6','Magento_Cms::config_cms',NULL,'deny'),('7560','6','Magento_Newsletter' at line 1

so I am quite lost at the moment, I filtered my sql file and show the delimiter actions in down below

any help or people who had the same problem?

===this is below===

-- Triggers structure for table catalog_category_entity

DROP TRIGGER IF EXISTS trg_catalog_category_entity_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_category_entity_after_insert AFTER INSERT ON catalog_category_entity FOR EACH ROW BEGIN INSERT IGNORE INTO catalog_category_product_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_category_entity_after_update; delimiter ;; CREATE TRIGGER trg_catalog_category_entity_after_update AFTER UPDATE ON catalog_category_entity FOR EACH ROW BEGIN IF (NEW.entity_id != OLD.entity_id OR NEW.attribute_set_id != OLD.attribute_set_id OR NEW.parent_id != OLD.parent_id OR NEW.created_at != OLD.created_at OR NEW.path != OLD.path OR NEW.position != OLD.position OR NEW.level != OLD.level OR NEW.children_count != OLD.children_count) THEN INSERT IGNORE INTO catalog_category_product_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_category_entity_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_category_entity_after_delete AFTER DELETE ON catalog_category_entity FOR EACH ROW BEGIN INSERT IGNORE INTO catalog_category_product_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_category_entity_int

DROP TRIGGER IF EXISTS trg_catalog_category_entity_int_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_category_entity_int_after_insert AFTER INSERT ON catalog_category_entity_int FOR EACH ROW BEGIN INSERT IGNORE INTO catalog_category_product_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_category_entity_int_after_update; delimiter ;; CREATE TRIGGER trg_catalog_category_entity_int_after_update AFTER UPDATE ON catalog_category_entity_int FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_category_product_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_category_entity_int_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_category_entity_int_after_delete AFTER DELETE ON catalog_category_entity_int FOR EACH ROW BEGIN INSERT IGNORE INTO catalog_category_product_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_category_product

DROP TRIGGER IF EXISTS trg_catalog_category_product_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_category_product_after_insert AFTER INSERT ON catalog_category_product FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.product_id); INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (NEW.product_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_category_product_after_update; delimiter ;; CREATE TRIGGER trg_catalog_category_product_after_update AFTER UPDATE ON catalog_category_product FOR EACH ROW BEGIN IF (NEW.entity_id != OLD.entity_id OR NEW.category_id != OLD.category_id OR NEW.product_id != OLD.product_id OR NEW.position != OLD.position) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.product_id); END IF; IF (NEW.entity_id != OLD.entity_id OR NEW.category_id != OLD.category_id OR NEW.product_id != OLD.product_id OR NEW.position != OLD.position) THEN INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (NEW.product_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_category_product_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_category_product_after_delete AFTER DELETE ON catalog_category_product FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.product_id); INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (OLD.product_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity

DROP TRIGGER IF EXISTS trg_catalog_product_entity_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_after_insert AFTER INSERT ON catalog_product_entity FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_after_update AFTER UPDATE ON catalog_product_entity FOR EACH ROW BEGIN IF (NEW.entity_id != OLD.entity_id OR NEW.attribute_set_id != OLD.attribute_set_id OR NEW.type_id != OLD.type_id OR NEW.sku != OLD.sku OR NEW.has_options != OLD.has_options OR NEW.required_options != OLD.required_options OR NEW.created_at != OLD.created_at) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.entity_id != OLD.entity_id OR NEW.attribute_set_id != OLD.attribute_set_id OR NEW.type_id != OLD.type_id OR NEW.sku != OLD.sku OR NEW.has_options != OLD.has_options OR NEW.required_options != OLD.required_options OR NEW.created_at != OLD.created_at) THEN INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_after_delete AFTER DELETE ON catalog_product_entity FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity_datetime

DROP TRIGGER IF EXISTS trg_catalog_product_entity_datetime_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_datetime_after_insert AFTER INSERT ON catalog_product_entity_datetime FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_datetime_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_datetime_after_update AFTER UPDATE ON catalog_product_entity_datetime FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_datetime_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_datetime_after_delete AFTER DELETE ON catalog_product_entity_datetime FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity_decimal

DROP TRIGGER IF EXISTS trg_catalog_product_entity_decimal_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_decimal_after_insert AFTER INSERT ON catalog_product_entity_decimal FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_decimal_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_decimal_after_update AFTER UPDATE ON catalog_product_entity_decimal FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_decimal_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_decimal_after_delete AFTER DELETE ON catalog_product_entity_decimal FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity_gallery

DROP TRIGGER IF EXISTS trg_catalog_product_entity_gallery_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_gallery_after_insert AFTER INSERT ON catalog_product_entity_gallery FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_gallery_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_gallery_after_update AFTER UPDATE ON catalog_product_entity_gallery FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.position != OLD.position OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_gallery_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_gallery_after_delete AFTER DELETE ON catalog_product_entity_gallery FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity_int

DROP TRIGGER IF EXISTS trg_catalog_product_entity_int_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_int_after_insert AFTER INSERT ON catalog_product_entity_int FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_int_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_int_after_update AFTER UPDATE ON catalog_product_entity_int FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_int_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_int_after_delete AFTER DELETE ON catalog_product_entity_int FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity_text

DROP TRIGGER IF EXISTS trg_catalog_product_entity_text_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_text_after_insert AFTER INSERT ON catalog_product_entity_text FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_text_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_text_after_update AFTER UPDATE ON catalog_product_entity_text FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_text_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_text_after_delete AFTER DELETE ON catalog_product_entity_text FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity_tier_price

DROP TRIGGER IF EXISTS trg_catalog_product_entity_tier_price_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_tier_price_after_insert AFTER INSERT ON catalog_product_entity_tier_price FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_tier_price_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_tier_price_after_update AFTER UPDATE ON catalog_product_entity_tier_price FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.entity_id != OLD.entity_id OR NEW.all_groups != OLD.all_groups OR NEW.customer_group_id != OLD.customer_group_id OR NEW.qty != OLD.qty OR NEW.value != OLD.value OR NEW.percentage_value != OLD.percentage_value OR NEW.website_id != OLD.website_id) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.entity_id != OLD.entity_id OR NEW.all_groups != OLD.all_groups OR NEW.customer_group_id != OLD.customer_group_id OR NEW.qty != OLD.qty OR NEW.value != OLD.value OR NEW.percentage_value != OLD.percentage_value OR NEW.website_id != OLD.website_id) THEN INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_tier_price_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_tier_price_after_delete AFTER DELETE ON catalog_product_entity_tier_price FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_price_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_entity_varchar

DROP TRIGGER IF EXISTS trg_catalog_product_entity_varchar_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_varchar_after_insert AFTER INSERT ON catalog_product_entity_varchar FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (NEW.entity_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_varchar_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_varchar_after_update AFTER UPDATE ON catalog_product_entity_varchar FOR EACH ROW BEGIN IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (NEW.entity_id); END IF; IF (NEW.value_id != OLD.value_id OR NEW.attribute_id != OLD.attribute_id OR NEW.store_id != OLD.store_id OR NEW.entity_id != OLD.entity_id OR NEW.value != OLD.value) THEN INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (NEW.entity_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_entity_varchar_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_entity_varchar_after_delete AFTER DELETE ON catalog_product_entity_varchar FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_product_cl (entity_id) VALUES (OLD.entity_id); INSERT IGNORE INTO catalog_product_attribute_cl (entity_id) VALUES (OLD.entity_id); END ;; delimiter ;

--

-- Triggers structure for table catalog_product_website

DROP TRIGGER IF EXISTS trg_catalog_product_website_after_insert; delimiter ;; CREATE TRIGGER trg_catalog_product_website_after_insert AFTER INSERT ON catalog_product_website FOR EACH ROW BEGIN INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (NEW.product_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_website_after_update; delimiter ;; CREATE TRIGGER trg_catalog_product_website_after_update AFTER UPDATE ON catalog_product_website FOR EACH ROW BEGIN IF (NEW.product_id != OLD.product_id OR NEW.website_id != OLD.website_id) THEN INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (NEW.product_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalog_product_website_after_delete; delimiter ;; CREATE TRIGGER trg_catalog_product_website_after_delete AFTER DELETE ON catalog_product_website FOR EACH ROW BEGIN INSERT IGNORE INTO catalog_product_category_cl (entity_id) VALUES (OLD.product_id); END ;; delimiter ;

--

-- Triggers structure for table cataloginventory_stock_item

DROP TRIGGER IF EXISTS trg_cataloginventory_stock_item_after_insert; delimiter ;; CREATE TRIGGER trg_cataloginventory_stock_item_after_insert AFTER INSERT ON cataloginventory_stock_item FOR EACH ROW BEGIN INSERT IGNORE INTO cataloginventory_stock_cl (entity_id) VALUES (NEW.product_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_cataloginventory_stock_item_after_update; delimiter ;; CREATE TRIGGER trg_cataloginventory_stock_item_after_update AFTER UPDATE ON cataloginventory_stock_item FOR EACH ROW BEGIN IF (NEW.item_id != OLD.item_id OR NEW.product_id != OLD.product_id OR NEW.stock_id != OLD.stock_id OR NEW.qty != OLD.qty OR NEW.min_qty != OLD.min_qty OR NEW.use_config_min_qty != OLD.use_config_min_qty OR NEW.is_qty_decimal != OLD.is_qty_decimal OR NEW.backorders != OLD.backorders OR NEW.use_config_backorders != OLD.use_config_backorders OR NEW.min_sale_qty != OLD.min_sale_qty OR NEW.use_config_min_sale_qty != OLD.use_config_min_sale_qty OR NEW.max_sale_qty != OLD.max_sale_qty OR NEW.use_config_max_sale_qty != OLD.use_config_max_sale_qty OR NEW.is_in_stock != OLD.is_in_stock OR NEW.low_stock_date != OLD.low_stock_date OR NEW.notify_stock_qty != OLD.notify_stock_qty OR NEW.use_config_notify_stock_qty != OLD.use_config_notify_stock_qty OR NEW.manage_stock != OLD.manage_stock OR NEW.use_config_manage_stock != OLD.use_config_manage_stock OR NEW.stock_status_changed_auto != OLD.stock_status_changed_auto OR NEW.use_config_qty_increments != OLD.use_config_qty_increments OR NEW.qty_increments != OLD.qty_increments OR NEW.use_config_enable_qty_inc != OLD.use_config_enable_qty_inc OR NEW.enable_qty_increments != OLD.enable_qty_increments OR NEW.is_decimal_divided != OLD.is_decimal_divided OR NEW.website_id != OLD.website_id) THEN INSERT IGNORE INTO cataloginventory_stock_cl (entity_id) VALUES (NEW.product_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_cataloginventory_stock_item_after_delete; delimiter ;; CREATE TRIGGER trg_cataloginventory_stock_item_after_delete AFTER DELETE ON cataloginventory_stock_item FOR EACH ROW BEGIN INSERT IGNORE INTO cataloginventory_stock_cl (entity_id) VALUES (OLD.product_id); END ;; delimiter ;

--

-- Triggers structure for table catalogrule

DROP TRIGGER IF EXISTS trg_catalogrule_after_insert; delimiter ;; CREATE TRIGGER trg_catalogrule_after_insert AFTER INSERT ON catalogrule FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_rule_cl (entity_id) VALUES (NEW.rule_id); END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalogrule_after_update; delimiter ;; CREATE TRIGGER trg_catalogrule_after_update AFTER UPDATE ON catalogrule FOR EACH ROW BEGIN IF (NEW.rule_id != OLD.rule_id OR NEW.name != OLD.name OR NEW.description != OLD.description OR NEW.from_date != OLD.from_date OR NEW.to_date != OLD.to_date OR NEW.is_active != OLD.is_active OR NEW.conditions_serialized != OLD.conditions_serialized OR NEW.actions_serialized != OLD.actions_serialized OR NEW.stop_rules_processing != OLD.stop_rules_processing OR NEW.sort_order != OLD.sort_order OR NEW.simple_action != OLD.simple_action OR NEW.discount_amount != OLD.discount_amount) THEN INSERT IGNORE INTO catalogrule_rule_cl (entity_id) VALUES (NEW.rule_id); END IF; END ;; delimiter ; DROP TRIGGER IF EXISTS trg_catalogrule_after_delete; delimiter ;; CREATE TRIGGER trg_catalogrule_after_delete AFTER DELETE ON catalogrule FOR EACH ROW BEGIN INSERT IGNORE INTO catalogrule_rule_cl (entity_id) VALUES (OLD.rule_id); END ;; delimiter ;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE /; /!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS /; /!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS /; /!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT /; /!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS /; /!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION /; /!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2018-07-18 14:47:34 GMT

  • I am trying to find out what happened, so installed mysqlworkbench, connected it with the server and tried to put the triggers in with a query, that seems to work, so i decided to enter the whole sql, first as a file, but the workbench gave errors, so i tried to copie the sql into workbench (16Mb), and it gave me some clarification about the errors. – user5770958 Jul 19 '18 at 21:50
  • I have somehow a disturbance in the force let me show; 4,'simple','7999',0,0,'2018-06-07 20:59:13','2018-07-08 19:26:46'),('412',4,'simple','900005',0,0,'2018-06-07 20:59:13','hhÄèePçehh h@ hhh h@ h,4,'simple','7998',0,0,'2018-06-07 20:59:13','2018-07-08 19:27:00'),('415',4,'simple','7858',etc etc you can see the "hhÄèePçehh h@ h" there, it flies around in the sql, and all the errors i find are in a line with this tekst line..... any ideas what it is? – user5770958 Jul 19 '18 at 21:52
  • And workbench gives it also as an error, if i put a ') behind it, the line goes green and workbench happy.... – user5770958 Jul 19 '18 at 21:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.