*************** Case 1 *************** create database join_on { "create_database_arg":"database_schema", "database_id":-1, "schema_version":1, "database_name":"join_on", "replica_num":0, "zone_list": [ ], "primary_zone":"", "charset_type":2, "collation_type":"utf8mb4_general_ci", "name_case_mode":-1, "comment":"" } *************** Case 2 *************** use join_on; { "stmt_type":79, "table_items": [ ], "column_items": [ ] } *************** Case 3 *************** create table t1 (a int , b int); { "stmt_type":17, "create_table_arg": { "if_not_exist":false, "schema": { "tenant_id":1, "database_id":1099511628804, "tablegroup_id":1099511627777, "table_id":-1, "table_name":"t1", "max_used_column_id":17, "rowkey_column_num":1, "index_column_num":0, "rowkey_split_pos":0, "block_size":16384, "is_use_bloomfilter":false, "progressive_merge_num":1, "replica_num":0, "load_type":0, "table_type":0, "index_type":0, "def_type":1, "charset_type":2, "collation_type":45, "data_table_id":0, "create_mem_version":0, "index_status":1, "name_casemode":-1, "code_version":1, "schema_version":0, "last_modified_frozen_version":0, "part_level":1, "part_expr": { "part_func_type":0, "part_func_expr":"", "part_num":1 }, "comment":"", "tablegroup_name":"", "compress_func_name":"none", "primary_zone":"", "expire_info":"", "view_schema": { "view_definition":"", "check_option":"none", "is_updatable":"false", "alias_name":"" }, "autoinc_column_id":0, "auto_increment":0, "index_tid_array": [ ], "column_array": [ { "tenant_id":-1, "table_id":-1, "column_id":16, "schema_version":0, "rowkey_position":0, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 }, "is_nullable":true, "is_autoincrement":false, "is_hidden":false, "charset_type":2, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"a", "comment":"" }, { "tenant_id":-1, "table_id":-1, "column_id":17, "schema_version":0, "rowkey_position":0, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 }, "is_nullable":true, "is_autoincrement":false, "is_hidden":false, "charset_type":2, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"b", "comment":"" }, { "tenant_id":-1, "table_id":-1, "column_id":1, "schema_version":0, "rowkey_position":1, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"BIGINT UNSIGNED", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "is_nullable":false, "is_autoincrement":true, "is_hidden":true, "charset_type":1, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"__pk", "comment":"" } ] }, "index_arg_list": [ ] }, "db_name":"join_on" } *************** Case 4 *************** create table t2 (c int , d int); { "stmt_type":17, "create_table_arg": { "if_not_exist":false, "schema": { "tenant_id":1, "database_id":1099511628804, "tablegroup_id":1099511627777, "table_id":-1, "table_name":"t2", "max_used_column_id":17, "rowkey_column_num":1, "index_column_num":0, "rowkey_split_pos":0, "block_size":16384, "is_use_bloomfilter":false, "progressive_merge_num":1, "replica_num":0, "load_type":0, "table_type":0, "index_type":0, "def_type":1, "charset_type":2, "collation_type":45, "data_table_id":0, "create_mem_version":0, "index_status":1, "name_casemode":-1, "code_version":1, "schema_version":0, "last_modified_frozen_version":0, "part_level":1, "part_expr": { "part_func_type":0, "part_func_expr":"", "part_num":1 }, "comment":"", "tablegroup_name":"", "compress_func_name":"none", "primary_zone":"", "expire_info":"", "view_schema": { "view_definition":"", "check_option":"none", "is_updatable":"false", "alias_name":"" }, "autoinc_column_id":0, "auto_increment":0, "index_tid_array": [ ], "column_array": [ { "tenant_id":-1, "table_id":-1, "column_id":16, "schema_version":0, "rowkey_position":0, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 }, "is_nullable":true, "is_autoincrement":false, "is_hidden":false, "charset_type":2, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"c", "comment":"" }, { "tenant_id":-1, "table_id":-1, "column_id":17, "schema_version":0, "rowkey_position":0, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 }, "is_nullable":true, "is_autoincrement":false, "is_hidden":false, "charset_type":2, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"d", "comment":"" }, { "tenant_id":-1, "table_id":-1, "column_id":1, "schema_version":0, "rowkey_position":1, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"BIGINT UNSIGNED", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "is_nullable":false, "is_autoincrement":true, "is_hidden":true, "charset_type":1, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"__pk", "comment":"" } ] }, "index_arg_list": [ ] }, "db_name":"join_on" } *************** Case 5 *************** create table t3 (e int , b int); { "stmt_type":17, "create_table_arg": { "if_not_exist":false, "schema": { "tenant_id":1, "database_id":1099511628804, "tablegroup_id":1099511627777, "table_id":-1, "table_name":"t3", "max_used_column_id":17, "rowkey_column_num":1, "index_column_num":0, "rowkey_split_pos":0, "block_size":16384, "is_use_bloomfilter":false, "progressive_merge_num":1, "replica_num":0, "load_type":0, "table_type":0, "index_type":0, "def_type":1, "charset_type":2, "collation_type":45, "data_table_id":0, "create_mem_version":0, "index_status":1, "name_casemode":-1, "code_version":1, "schema_version":0, "last_modified_frozen_version":0, "part_level":1, "part_expr": { "part_func_type":0, "part_func_expr":"", "part_num":1 }, "comment":"", "tablegroup_name":"", "compress_func_name":"none", "primary_zone":"", "expire_info":"", "view_schema": { "view_definition":"", "check_option":"none", "is_updatable":"false", "alias_name":"" }, "autoinc_column_id":0, "auto_increment":0, "index_tid_array": [ ], "column_array": [ { "tenant_id":-1, "table_id":-1, "column_id":16, "schema_version":0, "rowkey_position":0, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 }, "is_nullable":true, "is_autoincrement":false, "is_hidden":false, "charset_type":2, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"e", "comment":"" }, { "tenant_id":-1, "table_id":-1, "column_id":17, "schema_version":0, "rowkey_position":0, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 }, "is_nullable":true, "is_autoincrement":false, "is_hidden":false, "charset_type":2, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"b", "comment":"" }, { "tenant_id":-1, "table_id":-1, "column_id":1, "schema_version":0, "rowkey_position":1, "index_position":0, "order_in_rowkey":0, "meta_type": { "type":"BIGINT UNSIGNED", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":-1, "precision":-1, "scale":-1 }, "is_nullable":false, "is_autoincrement":true, "is_hidden":true, "charset_type":1, "on_update_current_timestamp":false, "orig_default_value": { "NULL":"NULL" }, "cur_default_value": { "NULL":"NULL" }, "column_name":"__pk", "comment":"" } ] }, "index_arg_list": [ ] }, "db_name":"join_on" } *************** Case 6 *************** select * from t1 left join (t2 left join t3 on c+1=e) on t1.b=t3.b; { "stmt_type":1, "table": [ { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } ], "joined_table": [ { "table_id":-2, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, "right_table": { "table_id":-3, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, "right_table": { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } } } ], "partition_express": [ ], "column": [ { "column_id":16, "column_name":"c", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 } }, { "column_id":16, "column_name":"e", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 } }, { "column_id":16, "column_name":"a", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 } }, { "column_id":17, "column_name":"d", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 } } ], "select": [ { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65519, "is_alias":false, "alias_name":"a", "expr_name":"a", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65518, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65517, "is_alias":false, "alias_name":"c", "expr_name":"c", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65516, "is_alias":false, "alias_name":"d", "expr_name":"d", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65515, "is_alias":false, "alias_name":"e", "expr_name":"e", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65514, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 } ], "distinct":false, "from": [ { "table_id":-2, "is_join":true } ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "for_update":false, "wait":-1, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "when": [ ], "hint": { "read_static":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":0, "join_order": [ ], "merge_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "hash_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "nl_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "part_hints": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":false, "calculable_items": [ ] }, "current_level":0, "equal_sets": [ ], "child_stmts": [ ] } *************** Case 7 *************** select * from t1 left join (t2 left join t3 on d+1=e) on t1.b=t3.b; { "stmt_type":1, "table": [ { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } ], "joined_table": [ { "table_id":-2, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, "right_table": { "table_id":-3, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, "right_table": { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } } } ], "partition_express": [ ], "column": [ { "column_id":17, "column_name":"d", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 } }, { "column_id":16, "column_name":"e", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 } }, { "column_id":16, "column_name":"a", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 } }, { "column_id":16, "column_name":"c", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 } } ], "select": [ { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65519, "is_alias":false, "alias_name":"a", "expr_name":"a", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65518, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65517, "is_alias":false, "alias_name":"c", "expr_name":"c", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65516, "is_alias":false, "alias_name":"d", "expr_name":"d", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65515, "is_alias":false, "alias_name":"e", "expr_name":"e", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65514, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 } ], "distinct":false, "from": [ { "table_id":-2, "is_join":true } ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "for_update":false, "wait":-1, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "when": [ ], "hint": { "read_static":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":0, "join_order": [ ], "merge_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "hash_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "nl_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "part_hints": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":false, "calculable_items": [ ] }, "current_level":0, "equal_sets": [ ], "child_stmts": [ ] } *************** Case 8 *************** select * from t1 left join (t2 left join t3 on d+1=b) on t1.b=t3.b; { "stmt_type":1, "table": [ { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } ], "joined_table": [ { "table_id":-2, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, "right_table": { "table_id":-3, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, "right_table": { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } } } ], "partition_express": [ ], "column": [ { "column_id":17, "column_name":"d", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 } }, { "column_id":16, "column_name":"a", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 } }, { "column_id":16, "column_name":"c", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 } }, { "column_id":16, "column_name":"e", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 } } ], "select": [ { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65519, "is_alias":false, "alias_name":"a", "expr_name":"a", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65518, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65517, "is_alias":false, "alias_name":"c", "expr_name":"c", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65516, "is_alias":false, "alias_name":"d", "expr_name":"d", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65515, "is_alias":false, "alias_name":"e", "expr_name":"e", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65514, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 } ], "distinct":false, "from": [ { "table_id":-2, "is_join":true } ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "for_update":false, "wait":-1, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "when": [ ], "hint": { "read_static":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":0, "join_order": [ ], "merge_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "hash_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "nl_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "part_hints": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":false, "calculable_items": [ ] }, "current_level":0, "equal_sets": [ ], "child_stmts": [ ] } *************** Case 9 *************** select * from t1 left join (t2 left join t3 on c+1=b) on t1.b=t3.b; { "stmt_type":1, "table": [ { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } ], "joined_table": [ { "table_id":-2, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631158, "table_name":"t1", "alias_name":"", "table_type":0, "ref_id":1099511631158, "database_name":"join_on" }, "right_table": { "table_id":-3, "table_type":3, "join_type":"LEFT OUTER JOIN", "left_table": { "table_id":1099511631159, "table_name":"t2", "alias_name":"", "table_type":0, "ref_id":1099511631159, "database_name":"join_on" }, "right_table": { "table_id":1099511631160, "table_name":"t3", "alias_name":"", "table_type":0, "ref_id":1099511631160, "database_name":"join_on" } } } ], "partition_express": [ ], "column": [ { "column_id":16, "column_name":"c", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 } }, { "column_id":17, "column_name":"b", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 } }, { "column_id":16, "column_name":"a", "table_id":1099511631158, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 } }, { "column_id":17, "column_name":"d", "table_id":1099511631159, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 } }, { "column_id":16, "column_name":"e", "table_id":1099511631160, "obj_type":"INT", "length":11, "precision":11, "scale":0, "is_autoincrement":false, "cs_type":"binary", "cs_level":5, "is_nullable":true, "auto_filled_timestamp":false, "default_value": { "NULL":"NULL" }, "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 } } ], "select": [ { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65519, "is_alias":false, "alias_name":"a", "expr_name":"a", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 1 ], "table_id":1099511631158, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65518, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65517, "is_alias":false, "alias_name":"c", "expr_name":"c", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 2 ], "table_id":1099511631159, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65516, "is_alias":false, "alias_name":"d", "expr_name":"d", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":16, "expr_level":0 }, "table_id":-1, "column_id":65515, "is_alias":false, "alias_name":"e", "expr_name":"e", "obj_type":"INT", "length":11, "precision":11, "scale":0 }, { "expression": { "item_type":"T_REF_COLUMN", "result_type": { "meta": { "type":"INT", "collation":"binary", "coercibility":"NUMERIC" }, "accuracy": { "length":11, "precision":11, "scale":0 } }, "expr_info": [ "IS_COLUMN", "CNT_COLUMN" ], "rel_id": [ 3 ], "table_id":1099511631160, "column_id":17, "expr_level":0 }, "table_id":-1, "column_id":65514, "is_alias":false, "alias_name":"b", "expr_name":"b", "obj_type":"INT", "length":11, "precision":11, "scale":0 } ], "distinct":false, "from": [ { "table_id":-2, "is_join":true } ], "where": [ ], "group_by": [ ], "having": [ ], "aggr_func": [ ], "order_by": [ ], "limit":null, "offset":null, "for_update":false, "wait":-1, "show_stmt_ctx": { "is_from_show_stmt":false, "global_scope":false, "tenant_id":-1, "show_database_id":-1, "show_table_id":-1, "grants_user_id":-1 }, "when": [ ], "hint": { "read_static":false, "frozen_version":-1, "topk_precision":-1, "sharding_minimum_row_count":0, "query_timeout":-1, "hotspot":false, "index": [ ], "read_consistency":0, "join_order": [ ], "merge_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "hash_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "nl_hint_idxs":"0, 0, 0, 0, 0, 0, 0, 0", "part_hints": [ ] }, "query_context": { "param_num":1, "fetch_cur_time":false, "calculable_items": [ ] }, "current_level":0, "equal_sets": [ ], "child_stmts": [ ] } *************** Case 10 *************** drop database join_on { "drop_database_arg":"tenant_id", "database_name":"join_on", "if_exist":false }