From 043c46c59d62abcafef5c37fb97c66995e6b3859 Mon Sep 17 00:00:00 2001
From: Joseph <Joseph.xu@efrei.net>
Date: Thu, 5 Jan 2023 09:22:16 -0500
Subject: modifications applied to batch test...

---
 .../exchange_do_batch4_reserves_in_insert.sql      | 38 ++++++++++++++++++----
 1 file changed, 31 insertions(+), 7 deletions(-)

(limited to 'src/exchangedb/exchange_do_batch4_reserves_in_insert.sql')

diff --git a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
index 1817e695..c2157f7d 100644
--- a/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
+++ b/src/exchangedb/exchange_do_batch4_reserves_in_insert.sql
@@ -148,23 +148,47 @@ BEGIN
     THEN
       IF in_reserve_pub = i.reserve_pub
       THEN
-         out_reserve_found = FALSE;
          ruuid = i.reserve_uuid;
+         IF in_reserve_pub
+         NOT IN (in2_reserve_pub
+                ,in3_reserve_pub
+                ,in4_reserve_pub)
+         THEN
+           out_reserve_found = FALSE;
+         END IF;
       END IF;
       IF in2_reserve_pub = i.reserve_pub
       THEN
-          out_reserve_found2 = FALSE;
-          ruuid2 = i.reserve_uuid;
+         ruuid2 = i.reserve_uuid;
+         IF in2_reserve_pub
+         NOT IN (in_reserve_pub
+                ,in3_reserve_pub
+                ,in4_reserve_pub)
+         THEN
+           out_reserve_found2 = FALSE;
+         END IF;
       END IF;
       IF in3_reserve_pub = i.reserve_pub
       THEN
-          out_reserve_found3 = FALSE;
-          ruuid3 = i.reserve_uuid;
+         ruuid3 = i.reserve_uuid;
+         IF in3_reserve_pub
+         NOT IN (in_reserve_pub
+                ,in2_reserve_pub
+                ,in4_reserve_pub)
+         THEN
+           out_reserve_found3 = FALSE;
+         END IF;
       END IF;
       IF in4_reserve_pub = i.reserve_pub
       THEN
-          out_reserve_found4 = FALSE;
-          ruuid4 = i.reserve_uuid;
+         ruuid4 = i.reserve_uuid;
+         IF in4_reserve_pub
+         NOT IN (in_reserve_pub
+                ,in2_reserve_pub
+                ,in3_reserve_pub)
+         THEN
+           out_reserve_found4 = FALSE;
+         END IF;
       END IF;
     END IF;
   k=k+1;
-- 
cgit v1.2.3

