From bce9e3974c901abc9f0c1d67cf8fc20839a56cc8 Mon Sep 17 00:00:00 2001 From: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> Date: Tue, 6 Jul 2021 09:05:49 +0300 Subject: [PATCH] use last_insert_id Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com> --- localtests/generated-columns57-unique/create.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localtests/generated-columns57-unique/create.sql b/localtests/generated-columns57-unique/create.sql index c62747d..988a928 100644 --- a/localtests/generated-columns57-unique/create.sql +++ b/localtests/generated-columns57-unique/create.sql @@ -27,6 +27,6 @@ begin insert into gh_ost_test (id, jsonobj) values (null, '{"_id":19}'); insert into gh_ost_test (id, jsonobj) values (null, '{"_id":23}'); insert into gh_ost_test (id, jsonobj) values (null, '{"_id":27}'); - - update gh_ost_test set jsonobj=JSON_OBJECT('_id', 27, 'name', 'carrot') where id>0 and idb=27; + set @last_insert_id := last_insert_id(); + update gh_ost_test set jsonobj=JSON_OBJECT('_id', 27, 'name', 'carrot') where id=@last_insert_id and idb=27; end ;;