oceanbase / sql-lifecycle-management

SQL-Lifecycle-Management is an intelligent diagnosis and optimization product focusing on the SQL field.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: The third round of SQL parser verification bug

Ifffff opened this issue · comments

commented

The third round of SQL parser verification bug

commented
select 
  sniffer_id, 
  sum(a.num) 
from 
  (
    select 
      sniffer_id, 
      sniffer_result, 
      category, 
      prefix, 
      os_type, 
      os_version, 
      count(*) as num 
    from 
      test_sniffer 
    group by 
      sniffer_id, 
      sniffer_result, 
      prefix, 
      category, 
      os_type, 
      os_version with rollup
  ) a 
where 
  a.os_type = 'ios' 
  and a.os_version >= 6.0 
group by 
  sniffer_id
commented
select 
  table_name, 
  table_schema schema_name, 
  create_time, 
  now() as last_ddl_time, 
  table_comment description, 
  ceil(
    (data_length + index_length)/ 1024 / 1024
  ) store_capacity, 
  data_length data_bytes, 
  index_length index_bytes, 
  substring(
    table_collation, 
    1, 
    if(
      locate('_', table_collation), 
      locate('_', table_collation) -1, 
      length(table_collation)
    )
  ) encoding, 
  table_collation as collation, 
  auto_increment, 
  table_rows num_rows, 
  engine 
from 
  information_schema.tables 
where 
  table_type = 'base table' 
  and table_schema = 'findefencecore' 
order by 
  1
commented
select * from t 
where foo = '1111'/**/And/**/Sleep(1.15)/**/and/**/'1'
commented
select a,time_to_usec(t) from ts
commented
select
             
        id,
        gmt_create,
        gmt_creator,
        gmt_modified,
        gmt_modifier,
        tnt_inst_id,
        policy_table_name,
        hist_version,
        labels,
        description,
        principal,
        participants,
        feature_name_set,
        is_archived,
        backtrack_session,
        backtrack_attempt,
        status,
        dev_task_id,
        lock_version,
        lock_type,
        is_published,
        publish_time,
        feature_group_name,
        request_sample_sql,
        snapshot_table_guid,
        minor_version
     
        from realtime_policy_table
         where is_archived = 0
            
            
            
            
            
                and principal like concat('%', '45876', '%')
            
            
            
            
            
                and (principal like concat('%', 'haifen.wuhaifen', '%') or participants like concat('%', 'haifen.wuhaifen', '%')) 
         
            order by @ntewmdawndktb3jkzxjceuzpzwxkltewndawmzaynq.antscanner.global.alipay.com desc
         
        limit 0, 10
commented
select
            res.tnt_inst_id,
            res.id,
            res.gmt_create,
            res.gmt_creator,
            res.gmt_modified,
            res.gmt_modifier,
            res.parent_res_id,
            res.type,
            res.path,
            res.name,
            res.display_name,
            res.state,
            res.tag
        from
        dev_file_resource res force index(idx_path) left join dev_policy_meta policy on res.name = policy.policy_code
        where res.tnt_inst_id = 'alipw3cn'
        and (policy.id is null or principal = 'wb355191' or participants like concat('%"', 'wb355191', '"%'))
         
            and
             (  
                res.path like concat('policy', '%')
             ) 
         
        and res.state in ('normal','discard')

65C88E8C71B6BED14C8FC2F4E7A4D08F

commented
select
             
        id,
        gmt_create,
        gmt_creator,
        gmt_modified,
        gmt_modifier,
        tnt_inst_id,
        policy_table_name,
        hist_version,
        labels,
        description,
        principal,
        participants,
        feature_name_set,
        is_archived,
        status,
        dev_task_id,
        lock_version,
        lock_type,
        is_published,
        publish_time,
        beta_time,
        feature_group_name,
        request_sample_sql,
        snapshot_table_guid,
        minor_version
     
        from realtime_policy_table
         where is_archived = 0
            
            
                and policy_table_name like concat('%', 'riskaxel_onlineinput_yl_test_0015', '%')
            
            
            
            
            
            
            
            
                and (principal like concat('%', 'zx201490', '%') or participants like concat('%', 'zx201490', '%')) 
         
            order by (select concat(0x71766b6a71,(select (elt(4255=4255,1))),0x716b786271)) desc
         
        limit 0, 10
commented
select risk_task.tnt_inst_id as tnt_inst_id, risk_task.map_code as input_source,  related_id as risk_domain, risk_task.task_name as name, task_content as description, task_status  as `status`,
'fgh' as `type`, risk_task.operator as `creator`, risk_task.operator as  `processor`, risk_task.operator as  `last_operator`, risk_task.operator as `current_operator`,
risk_task.task_start_time as `start_time`,  'prod' as `environment`, if(risk_task.status = 'normal', '0', '1') as `is_deleted`,'0' as `is_draft`,
cast(concat(
    if(history_id is null, "{",  concat("{\"historyid\":\"", history_id ,"\","))
    ,"\"sort_num\":\"", sort_num ,"\"}")  as char(2048) ) as extended_property
from `risk_entity_relation`
inner join `risk_task`
on  (
    risk_entity_relation.subject_id  = risk_task.id
    and risk_entity_relation.subject_type = 'action'
    
)
inner join  `quickrun_tree_node_rel`
on rel_type = 'mapping_risk_domain'
and quickrun_tree_node_rel.env = 'prod'
and tree_id = 'fgh_compass_view_category_tree'
and quickrun_tree_node_rel.status = 'normal'
and quickrun_tree_node_rel.tree_node_id = risk_entity_relation.related_id
commented
select              id             ,gmt_create             ,gmt_modified             ,sheet_id             ,data_code             ,cell_name             ,row             ,col             ,coord             ,coord_type             ,template_value_type             ,template_value             ,units             from             lm_template_cell             where sheet_id in             (                 5             ,                 6             ,                 9             ,                 10             ,                 15             ,                 16             ,                 21             ,                 22             ,                 27             ,                 28             ,                 33             ,                 34             ,                 39             ,                 40             ,                 45             ,                 46             ,                 51             ,                 52             ,                 57             ,                 58             ,                 63             ,                 64             ,                 69             ,                 70             ,                 73             ,                 74             ,                 75             ,                 76             )
commented
select * from (
select biz_trade_id,
       substr(begin_date, 1, 6) as '月份',
       sum(case when accrual_int> 0 then accrual_int else 0 end) as 02i,
       sum(case when accrual_int< 0 then accrual_int else 0 end) as i20
  from gft_biz_bill
 where begin_date>= '20191101'  and begin_date <='20200229' and sub_bill_type ='cashpool'
group by biz_trade_id,
         substr(begin_date, 1, 6)
order by biz_trade_id,
         substr(begin_date, 1, 6) asc) a
commented
select  id, gmt_create, gmt_modified, param_key, param_value  , param_desc, last_value from lm_sys_param where id = 11123
commented
select distinct  concat( "\"yeb_t0bank_by_id_",out_sys_id,"_",owner_id,"\"") as key_value,
 concat("\"",user_id,"|", (select distinct(account_no)  from fld_inst_account_info f1 where account_no_type = "fund_trade_no" and f1.owner_id = f2.owner_id and f1.out_sys_id =f2.out_sys_id ),"|",account_no,"|",owner_id,"\"") as account_no
,substring(ext_info,position( "tacode" in ext_info)+8,4) as tacode
,account_no
from fld_inst_account_info f2 where owner_id not in ('antbank')  and account_no_type not in ( "fund_trade_no")
and out_sys_id in ('000198','000380','000559','001094','001134','001211','003515','040038','050003','090022','161608','180008','200003')
order by f2.account_no asc
commented
select count(*) as total_count,    count(ora_decode(sign(trans_amount), 1, 1)) as total_in_count,    count(ora_decode(sign(trans_amount), -1, 1)) as total_out_count,    sum(ora_decode(sign(trans_amount), 1, trans_amount)) as total_in_amount,    sum(ora_decode(sign(trans_amount), -1, trans_amount)) as total_out_amount    from mini_account_log_summary_lz_85    where account_no = '88888888888888880156'                   and trans_dt >= str_to_date('20190703000000','%y%m%d%h%i%s')     and trans_dt < str_to_date('20190704000000','%y%m%d%h%i%s')
commented
select id, name, cluster, user, des, appid, yarn, rmurl, state, depart, attemptid, containers, lag, proxyui, historyui,  next_send_time as nextsendtime, last_times as lasttimes, abnormalexecutortimes, abnormalapplicationtimes, jobid, type from spark_jobs where env=2 and yarn=1
commented
select mini_trans_log_id, trans_date, trans_code, sub_trans_code, out_date, trans_dt, trans_amount, balance, trans_currency, account_type, account_no, other_account_type, other_account_no, order_no, out_biz_no, trans_memo, partition_key, voucher_id, gmt_create, recon_inst, category_code    ,nvl(gmt_create, trans_dt) as order_by_gmt_create,biz_pd_code, biz_ev_code, cnl_pd_code, cnl_ev_code, cnl_no, pd_code, ev_code    from mini_account_log_pc a    where account_no in    (      '40130324888881230156'    )              and trans_dt >= str_to_date('20190702000000','%y%m%d%h%i%s')     and trans_dt <= str_to_date('20190717235959','%y%m%d%h%i%s')                                                  order by trans_dt asc,mini_trans_log_id asc                limit 0, 20
commented
select 
cast((rand()*10 + 100) as dec(65,0)) join_uv,
cast((rand()*10 + 30) as dec(65,0)) prize_uv,
cast((rand()*10 + 10) as dec(65,0)) write_off_uv,
cast((rand()*1000 + 5000) as dec(65,0)) prize_amount,
cast((rand()*100 + 1000) as dec(65,0)) write_off_amount,
name, out_biz_id ,
concat (gmt_begin,'.0') gmt_begin , concat (gmt_end,'.0') gmt_end, concat (gmt_modified,'.0') gmt_modified , 
creator , biz_owner  from `promobench_work_order` 
where biz_type = 'antgrowth' and type = 'work' and creator in ('zebgzihao.zzh/梓昊','mpf275015/萧飞','caibangchao.cbc/召争') and out_biz_id is not null
order by id desc
commented
select dm_model_instance.data_7 as ownerid,count(*) as status from dm_model_index left join dm_model_instance on dm_model_index.instance_id = dm_model_instance.instance_id where dm_model_index.tnt_inst_id = 'antgw2cn' and dm_model_index.app_code = '1161810150000225987' and dm_model_index.model_code = 'en270916' and dm_model_index.index_name = 'idx_owner_id_status' and dm_model_index.idx_col_1 in (x'', x'e99d81e7a59e', x'e58d93e983a1', x'e6b798e5b89d', x'e8a880e69dbe', x'e78bbce784b0', x'', x'e99baae69e97', x'e78e8be5ad9fe58d8e', x'e5809ae794bb', x'e5b88ce98791', x'e6989fe6bca0', x'')  and dm_model_instance.data_301 >= '2019-08-02 00:00:00' and dm_model_instance.data_301 <= '2019-08-08 23:59:59' group by dm_model_instance.data_7 limit 0,200
commented
select ast.cluster,ast.tenant,ast.cpu99 as cpu99,ast.cpu95 as cpu95,ast.cpu85 as cpu85,ast.qps,ast.tps,ast.rt_sel,ast.rt_ins,ast.rt_upd,ast.rt_del,ifnull(over.oversold,0) as oversold,ifnull(over.asyms,0) as asyms,ifnull(over.nopris,0) as nopris,ifnull(tars.cnt,0) as sqldiags from
(select cluster,tenant,cpu_max_99 as cpu99,cpu_max_95 as cpu95,cpu_max_85 as cpu85,qps_99 as qps,tps_99 as tps,round(rt_sel_99/1000,2) as rt_sel,round(rt_ins_99/1000,2) as rt_ins,round(rt_upd_99/1000,2) as rt_upd,round(rt_del_99/1000,2) as rt_del from antmonitor_stat_tenant where dt_date = date_add(curdate(),interval -1 day) and time_slot = 'whole' order by cpu_max_99 desc limit 30) ast left join 
(select cluster,tenant,round(cpu_max/cpu_min,1) as oversold,case when unit_cnt > 1 then '不对称' else '' end as asyms, case  when primaryzone_info = 0 then '无主' else '' end as nopris from ob_unit_config) over on (ast.cluster = over.cluster and ast.tenant = over.tenant) left join 
(select cluster,tenant,sum(diag_cnt) as cnt from tars_sql_diags_summary where dt_date = date_add(curdate(),interval -1 day) group by cluster,tenant) tars on (ast.cluster = tars.cluster and ast.tenant = tars.tenant)
commented
select * from dm_model_instance force index (primary) order by instance_id desc  limit 20
commented
        select * from `bk_findata`.`fd_data_source` where `id` = cast(2000006 as binary(7))