Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CBRD-24735] When attempting 'Multiple Key Ranges Optimization (MRO)'…
…, An internal error occurs because the '1=1' predicate (data filer) generated by constant folding is not removed (#4240) http://jira.cubrid.org/browse/CBRD-24735 When the pt_semantic_type function runs after rewriting the query, it runs pt_where_type after the fold constant to see if there are any predicates that can be removed. In the query below, the `1=1` predicate generated after rewriting the query should be removed. ``` pt_semantic_check: select ... from t0 inner join t1 t on t0.c1=t.c1 and t0.c1=1 where t.c1=1 order by 1 limit 1; mq_translate: select ... from t0 inner join t1 t where t.c1=1 and t0.c1=t.c1 and t0.c1=1 order by 1 limit 1; mq_optimize: select ... from t0 inner join t1 t where t.c1=1 and t0.c1=t.c1 and t0.c1=1 and 1=1 order by 1 limit 1; qo_reduce_equality_terms: t.c1=1 and t0.c1=t.c1 and t0.c1=1 (join_term_list: t0.c1=t.c1) qo_reduce_equality_terms: t.c1=1 and 1=1 and t0.c1=1 (join_term_list: t0.c1=t.c1) qo_reduce_equality_terms: t.c1=1 and t0.c1=t.c1 and t0.c1=1 and t0.c1=t.c1 pt_semantic_type: select ... from t0 inner join t1 t on t0.c1=t.c1 and t0.c1=1 and 1=1 where t.c1=1 order by 1 limit 1; ```
- Loading branch information