From 2f2855682050561b62a0522890eb24574876cfb8 Mon Sep 17 00:00:00 2001 From: dimitr Date: Thu, 14 Jan 2010 12:25:13 +0000 Subject: [PATCH] Fixed CORE-1274 (Wrong results when PLAN MERGE is chosen and datatypes of the equality predicate arguments are different) and CORE-1752 (Results of a join with different collations depend on the execution plan). --- src/jrd/opt.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/jrd/opt.cpp b/src/jrd/opt.cpp index 35460f9603..7d80cc3c3f 100644 --- a/src/jrd/opt.cpp +++ b/src/jrd/opt.cpp @@ -3618,6 +3618,15 @@ static bool gen_equi_join(thread_db* tdbb, OptimizerBlk* opt, RiverList& org_riv jrd_nod* node1 = node->nod_arg[0]; jrd_nod* node2 = node->nod_arg[1]; + dsc desc1, desc2; + CMP_get_desc(tdbb, csb, node1, &desc1); + CMP_get_desc(tdbb, csb, node2, &desc2); + + if (!DSC_EQUIV(&desc1, &desc2, true) || desc1.isBlob() || desc2.isBlob()) + { + continue; + } + USHORT number1 = 0; for (River** iter1 = org_rivers.begin(); iter1 < org_rivers.end(); iter1++, number1++) {