XiaoMi / soar

SQL Optimizer And Rewriter
Apache License 2.0
8.67k stars 1.32k forks source link

跨库查询语句导致批量sql中的下一sql语句执行失败 #215

Open bruceauyeung opened 5 years ago

bruceauyeung commented 5 years ago

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? If possible, provide a recipe for reproducing the error. 设有 sql 文件,有两条语句(table1,table2在otherdb上,table3在thisdb上):
    select b.bill_date, 
        s.service_name
        from otherdb.table1 b,otherdb.table2 s
        where
        b.smc_service_id = s.smc_service_id
        and b.bill_date = 'test';
    update table3 t 
             set last_update_date='2019-07-12',status=0,fail_sum=fail_sum+1  
            where id='test';

    线上环境和测试环境链接URL中填写的schema是thisdb 在这种情况下,当soar --query 批量处理该sql文件中,第一条语句能处理成功,但是在处理第二条时,在建测试表阶段,它竟然认为table3 是在otherdb上,从而导致建测试表失败。

最新的soar代码,自己编译的