mysql1_dart icon indicating copy to clipboard operation
mysql1_dart copied to clipboard

Semicolon

Open Lelelo1 opened this issue 2 years ago • 3 comments

Semicolon

I have noticed using semicolon in the sql fails the it. Now it happens again

SELECT v.entity_id INTO @id FROM catalog_product_entity_varchar v JOIN catalog_product_entity p ON v.entity_id = p.entity_id WHERE v.attribute_id = '283' AND v.value = '889501092529' LIMIT 1;

SELECT v.value INTO @ean FROM catalog_product_entity_varchar v WHERE v.entity_id = @id AND v.attribute_id = '283' LIMIT 1;

(SELECT g.value INTO @image_front FROM catalog_product_entity_media_gallery g, catalog_product_entity_media_gallery_value gv WHERE g.entity_id IN (SELECT r.parent_id FROM catalog_product_relation r WHERE r.child_id = @id) AND g.value_id = gv.`value_id` AND (gv.position = '1') ORDER BY gv.position ASC) LIMIT 1;

(SELECT g.value INTO @image_back FROM catalog_product_entity_media_gallery g, catalog_product_entity_media_gallery_value gv WHERE g.entity_id IN (SELECT r.parent_id FROM catalog_product_relation r WHERE r.child_id = @id) AND g.value_id = gv.`value_id` AND (gv.position = '2') ORDER BY gv.position ASC) LIMIT 1;

SELECT @id, @ean, @image_front, @image_back

The following don't work in the plugin. It works to run in phpmyadmin. Also running the SELECT calls separately works with the plugin.

Lelelo1 avatar Jun 23 '22 13:06 Lelelo1

I found some mysql information that says I need to give the statement separator differently in the client https://www.mysqltutorial.org/mysql-stored-procedure/mysql-delimiter/

Lelelo1 avatar Jun 23 '22 13:06 Lelelo1

It did not help. Setting:

DELIMITER //

To make it work in flutter, while it works to run it in phpMyAdmin

Lelelo1 avatar Jun 23 '22 13:06 Lelelo1

The error says: Error 1064 (42000) which should be related to DELIMITER according to this SO thread: https://stackoverflow.com/questions/6998705/error-1064-42000-in-mysql

Lelelo1 avatar Jun 30 '22 12:06 Lelelo1