[MDEV-17326] @@optimizer_switch = 'outer_join_with_cache=off' changes answer of query Created: 2018-09-28  Updated: 2019-01-07  Resolved: 2019-01-07

Status: Closed
Project: MariaDB Server
Component/s: Optimizer
Affects Version/s: 10.3.9
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Aria Stewart Assignee: Alice Sherepa
Resolution: Incomplete Votes: 0
Labels: need_feedback

Attachments: File v_tax_collected.sql    

 Description   

With this optimizer flag off,

select * from v_tax_collected AS rf WHERE rf.`est_activity_date` BETWEEN date'2018-08-01' AND date'2018-08-31' AND rf.`region` LIKE 'California' and order_increment_id = '112967661'  \G
*************************** 1. row ***************************
                   store_id: 1
                 created_at: 2018-08-07 12:17:41
                captured_at: 2018-08-07 12:17:41
          est_activity_date: 2018-08-07
             payment_source: other
           payment_trans_id: ex2542vb
                    cc_type: Visa
             payment_method: gene_braintree_creditcard
         order_increment_id: 112967661
                 invoice_id: 122916015
              creditmemo_id: NULL
                     region: California
                   postcode: 90815
     taxable_product_amount: 55.89
   taxable_product_discount: 0.00
  nontaxable_product_amount: 0.00
nontaxable_product_discount: 0.00
  total_product_amount_star: 55.89
   total_product_tax_amount: 5.73
            shipping_amount: 0.00
   shipping_discount_amount: 0.00
        shipping_tax_amount: 0.00
   total_tax_collected_star: 5.73
               store_credit: 0.00
                  gift_card: 0.00
              reward_points: 0.00
                 adjustment: 0.00
                grand_total: 61.62
           grand_total_paid: 61.62

With it on:

select * from v_tax_collected AS rf WHERE rf.`est_activity_date` BETWEEN date'2018-08-01' AND date'2018-08-31' AND rf.`region` LIKE 'California' and order_increment_id = '112967661'  \G
*************************** 1. row ***************************
                   store_id: 1
                 created_at: 2018-08-07 12:17:41
                captured_at: 2018-08-07 12:17:41
          est_activity_date: 2018-08-07
             payment_source: other
           payment_trans_id: ex2542vb
                    cc_type: Visa
             payment_method: gene_braintree_creditcard
         order_increment_id: 112967661
                 invoice_id: 122916015
              creditmemo_id: NULL
                     region: California
                   postcode: 90815
     taxable_product_amount: 0.00
   taxable_product_discount: 0.00
  nontaxable_product_amount: 0.00
nontaxable_product_discount: 0.00
  total_product_amount_star: 0.00
   total_product_tax_amount: 0.00
            shipping_amount: 0.00
   shipping_discount_amount: 0.00
        shipping_tax_amount: 0.00
   total_tax_collected_star: 5.73
               store_credit: 0.00
                  gift_card: 0.00
              reward_points: 0.00
                 adjustment: 0.00
                grand_total: 61.62
           grand_total_paid: 61.62



 Comments   
Comment by Alice Sherepa [ 2018-10-31 ]

aredridel, Could you please add schema or the testcase to demonstrate the problem?

Generated at Thu Feb 08 08:35:37 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.