Patch bug fixes to opensource branch.

This commit is contained in:
jz0
2021-08-19 17:53:21 +08:00
committed by wangzelin.wzl
parent 10799a599b
commit a0ff8aaa32
14 changed files with 524 additions and 765 deletions

View File

@ -165,9 +165,9 @@ SQL: select * from t2 left join (select * from t1) as v on t2.c1 = v.c2 where (
=========================================
|ID|OPERATOR |NAME|EST. ROWS|COST|
-----------------------------------------
|0 |NESTED-LOOP JOIN| |0 |121 |
|1 | SUBPLAN SCAN |v |0 |121 |
|2 | TABLE SCAN |t1 |100 |90 |
|0 |NESTED-LOOP JOIN| |0 |140 |
|1 | SUBPLAN SCAN |v |0 |140 |
|2 | TABLE SCAN |t1 |0 |140 |
|3 | TABLE GET |t2 |1 |36 |
=========================================
@ -175,9 +175,9 @@ Outputs & filters:
-------------------------------------
0 - output([t2.c1], [t2.c2], [t2.c3], [v.c1], [v.c2]), filter(nil),
conds(nil), nl_params_([v.c2])
1 - output([v.c2], [v.c1]), filter([(T_OP_IS, v.c2, NULL, 0)], [? > (T_OP_IS_NOT, v.c2, NULL, 0)]),
1 - output([v.c2], [v.c1]), filter(nil),
access([v.c2], [v.c1])
2 - output([t1.c1], [t1.c2]), filter(nil),
2 - output([t1.c1], [t1.c2]), filter([(T_OP_IS, t1.c2, NULL, 0)], [? > (T_OP_IS_NOT, t1.c2, NULL, 0)], [(T_OP_IS_NOT, t1.c1, NULL, 0)]),
access([t1.c1], [t1.c2]), partitions(p0)
3 - output([t2.c1], [t2.c2], [t2.c3]), filter(nil),
access([t2.c1], [t2.c2], [t2.c3]), partitions(p0)

View File

@ -2025,23 +2025,19 @@ Outputs & filters:
*************** Case 84 ***************
SQL: select max(c3) from t9 where c2 is TRUE;
======================================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
------------------------------------------------------
|0 |SCALAR GROUP BY| |1 |37 |
|1 | SUBPLAN SCAN |VIEW1 |1 |37 |
|2 | TABLE SCAN |t9(idx_t9,Reverse)|1 |37 |
======================================================
==============================================
|ID|OPERATOR |NAME |EST. ROWS|COST|
----------------------------------------------
|0 |SCALAR GROUP BY| |1 |97 |
|1 | TABLE SCAN |t9(idx_t9)|99 |78 |
==============================================
Outputs & filters:
-------------------------------------
0 - output([T_FUN_MAX(VIEW1.c3)]), filter(nil),
group(nil), agg_func([T_FUN_MAX(VIEW1.c3)])
1 - output([VIEW1.c3]), filter(nil),
access([VIEW1.c3])
2 - output([t9.c3]), filter([(T_OP_IS, t9.c2, 1, 0)], [(T_OP_IS_NOT, t9.c3, NULL, 0)]),
access([t9.c2], [t9.c3]), partitions(p0),
limit(1), offset(nil)
0 - output([T_FUN_MAX(t9.c3)]), filter(nil),
group(nil), agg_func([T_FUN_MAX(t9.c3)])
1 - output([t9.c3]), filter([(T_OP_IS, t9.c2, 1, 0)]),
access([t9.c2], [t9.c3]), partitions(p0)
*************** Case 85 ***************
SQL: select max(c3) from t9 where c2 = 1 and c1 = 1;

View File

@ -12095,6 +12095,144 @@ SQL: select * from t2 left join (select * from t1) as v on t2.c1 = v.c2 where (
]
}
]
},
{
"item_type":"T_OP_IS_NOT",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":1,
"scale":0
},
"flag":1,
"calc_type": {
"type":"DECIMAL",
"collation":"binary",
"coercibility":"NUMERIC"
}
},
"expr_info": [
"CNT_CONST",
"CNT_COLUMN"
],
"rel_id": [
2
],
"expr_levels": [
0
],
"children": [
{
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":16387,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
2
],
"table_id":-3,
"column_id":16,
"database_name":"",
"table_name":"v",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c1",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
},
{
"item_type":"T_NULL",
"result_type": {
"meta": {
"type":"NULL",
"collation":"binary",
"coercibility":"IGNORABLE"
},
"accuracy": {
"length":0,
"precision":-1,
"scale":-1
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"NULL":"NULL"
}
},
{
"item_type":"T_BOOL",
"result_type": {
"meta": {
"type":"TINYINT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":-1,
"scale":-1
},
"flag":1,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"TINYINT":0
}
}
]
},
{
"item_type":"T_OP_EQ",

View File

@ -75787,14 +75787,14 @@ SQL: select max(c3) from t9 where c2 is TRUE;
"transpose_item":null,
"table": [
{
"table_id":-2,
"table_name":"VIEW1",
"alias_name":"VIEW1",
"table_id":1099511677787,
"table_name":"t9",
"alias_name":"",
"synonym_name":"",
"synonym_db_name":"",
"table_type":2,
"ref_id":-1,
"database_name":"",
"table_type":0,
"ref_id":1099511677787,
"database_name":"opt",
"for_update":false,
"wait":-1,
"mock_id":-1,
@ -75809,15 +75809,15 @@ SQL: select max(c3) from t9 where c2 is TRUE;
],
"column": [
{
"column_id":16,
"table_id":-2,
"column":"c3",
"column_id":17,
"table_id":1099511677787,
"column":"c2",
"auto_filled_timestamp":false,
"default_value": {
"NULL":"NULL"
},
"base_tid":-1,
"base_cid":-1,
"base_tid":1099511677787,
"base_cid":17,
"expression": {
"item_type":"T_REF_COLUMN",
"result_type": {
@ -75845,10 +75845,66 @@ SQL: select max(c3) from t9 where c2 is TRUE;
"rel_id": [
1
],
"table_id":-2,
"column_id":16,
"database_name":"",
"table_name":"VIEW1",
"table_id":1099511677787,
"column_id":17,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c2",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
}
},
{
"column_id":18,
"table_id":1099511677787,
"column":"c3",
"auto_filled_timestamp":false,
"default_value": {
"NULL":"NULL"
},
"base_tid":1099511677787,
"base_cid":18,
"expression": {
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":18,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c3",
@ -75927,10 +75983,10 @@ SQL: select max(c3) from t9 where c2 is TRUE;
"rel_id": [
1
],
"table_id":-2,
"column_id":16,
"database_name":"",
"table_name":"VIEW1",
"table_id":1099511677787,
"column_id":18,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c3",
@ -75982,7 +76038,7 @@ SQL: select max(c3) from t9 where c2 is TRUE;
"nocycle":false,
"from": [
{
"table_id":-2,
"table_id":1099511677787,
"is_join":false
}
],
@ -75991,6 +76047,146 @@ SQL: select max(c3) from t9 where c2 is TRUE;
"connect_by": [
],
"where": [
{
"item_type":"T_OP_IS",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":1,
"scale":0
},
"flag":1,
"calc_type": {
"type":"DECIMAL",
"collation":"binary",
"coercibility":"NUMERIC"
}
},
"expr_info": [
"IS_IS_EXPR",
"CNT_CONST",
"CNT_COLUMN",
"CNT_IS_EXPR"
],
"rel_id": [
1
],
"expr_levels": [
0
],
"children": [
{
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":17,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c2",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
},
{
"item_type":"T_BOOL",
"result_type": {
"meta": {
"type":"TINYINT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":1,
"precision":1,
"scale":0
},
"flag":1,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"TINYINT":1
}
},
{
"item_type":"T_BOOL",
"result_type": {
"meta": {
"type":"TINYINT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":-1,
"scale":-1
},
"flag":1,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"TINYINT":0
}
}
]
}
],
"group_by": [
],
@ -76059,10 +76255,10 @@ SQL: select max(c3) from t9 where c2 is TRUE;
"rel_id": [
1
],
"table_id":-2,
"column_id":16,
"database_name":"",
"table_name":"VIEW1",
"table_id":1099511677787,
"column_id":18,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c3",
@ -76162,661 +76358,6 @@ SQL: select max(c3) from t9 where c2 is TRUE;
"pseudo_column_like_exprs": [
],
"child_stmts": [
{
"stmt_type":1,
"transpose_item":null,
"table": [
{
"table_id":1099511677787,
"table_name":"t9",
"alias_name":"",
"synonym_name":"",
"synonym_db_name":"",
"table_type":0,
"ref_id":1099511677787,
"database_name":"opt",
"for_update":false,
"wait":-1,
"mock_id":-1,
"view_base_item":-1
}
],
"joined_table": [
],
"semi_info": [
],
"partition_express": [
],
"column": [
{
"column_id":17,
"table_id":1099511677787,
"column":"c2",
"auto_filled_timestamp":false,
"default_value": {
"NULL":"NULL"
},
"base_tid":1099511677787,
"base_cid":17,
"expression": {
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":17,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c2",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
}
},
{
"column_id":18,
"table_id":1099511677787,
"column":"c3",
"auto_filled_timestamp":false,
"default_value": {
"NULL":"NULL"
},
"base_tid":1099511677787,
"base_cid":18,
"expression": {
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":18,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c3",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
}
}
],
"select": [
{
"expression": {
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":18,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c3",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
},
"is_alias":false,
"alias_name":"c3",
"expr_name":"max(c3)",
"default": {
"NULL":"NULL"
},
"paramed_alias_name":"",
"questions_pos": [
],
"params_idx": [
],
"esc_str_flag":false,
"need_check_dup_name":false,
"implicit_filled":false,
"is_unpivot_mocked_column":false,
"is_hidden_rowid":false
}
],
"distinct":false,
"rollup":false,
"nocycle":false,
"from": [
{
"table_id":1099511677787,
"is_join":false
}
],
"start_with": [
],
"connect_by": [
],
"where": [
{
"item_type":"T_OP_IS",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":1,
"scale":0
},
"flag":1,
"calc_type": {
"type":"DECIMAL",
"collation":"binary",
"coercibility":"NUMERIC"
}
},
"expr_info": [
"IS_IS_EXPR",
"CNT_CONST",
"CNT_COLUMN",
"CNT_IS_EXPR"
],
"rel_id": [
1
],
"expr_levels": [
0
],
"children": [
{
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":17,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c2",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
},
{
"item_type":"T_BOOL",
"result_type": {
"meta": {
"type":"TINYINT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":1,
"precision":1,
"scale":0
},
"flag":1,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"TINYINT":1
}
},
{
"item_type":"T_BOOL",
"result_type": {
"meta": {
"type":"TINYINT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":-1,
"scale":-1
},
"flag":1,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"TINYINT":0
}
}
]
},
{
"item_type":"T_OP_IS_NOT",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":1,
"scale":0
},
"flag":1,
"calc_type": {
"type":"DECIMAL",
"collation":"binary",
"coercibility":"NUMERIC"
}
},
"expr_info": [
"CNT_CONST",
"CNT_COLUMN"
],
"rel_id": [
1
],
"expr_levels": [
0
],
"children": [
{
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":18,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c3",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
},
{
"item_type":"T_NULL",
"result_type": {
"meta": {
"type":"NULL",
"collation":"binary",
"coercibility":"IGNORABLE"
},
"accuracy": {
"length":-1,
"precision":-1,
"scale":-1
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"NULL":"NULL"
}
},
{
"item_type":"T_BOOL",
"result_type": {
"meta": {
"type":"TINYINT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":-1,
"scale":-1
},
"flag":1,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"TINYINT":0
}
}
]
}
],
"group_by": [
],
"rollup": [
],
"having": [
],
"aggr_func": [
],
"order_by": [
{
"expression": {
"item_type":"T_REF_COLUMN",
"result_type": {
"meta": {
"type":"INT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":-1,
"precision":11,
"scale":0
},
"flag":0,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_COLUMN",
"CNT_COLUMN"
],
"rel_id": [
1
],
"table_id":1099511677787,
"column_id":18,
"database_name":"opt",
"table_name":"t9",
"synonym_name":"",
"synonym_db_name":"",
"column_name":"c3",
"expr_level":0,
"expr_levels": [
0
],
"column_flags":0,
"enum_set_values": [
],
"is_lob_column":false,
"is_unpivot_mocked_column":false,
"is_hidden":false
},
"ascending":"NULLs_last_desc"
}
],
"limit": {
"item_type":"T_INT",
"result_type": {
"meta": {
"type":"BIGINT",
"collation":"binary",
"coercibility":"NUMERIC"
},
"accuracy": {
"length":1,
"precision":1,
"scale":0
},
"flag":1,
"calc_type": {
"type":"NULL",
"collation":"invalid_type",
"coercibility":"INVALID"
}
},
"expr_info": [
"IS_CONST",
"CNT_CONST"
],
"rel_id": [
],
"value": {
"BIGINT":1
}
},
"win_func": [
],
"offset":null,
"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,
"show_seed":false
},
"hint": {
"read_static":false,
"no_rewrite":false,
"frozen_version":-1,
"topk_precision":-1,
"sharding_minimum_row_count":0,
"query_timeout":-1,
"hotspot":false,
"index": [
],
"read_consistency":-1,
"join_ordered":false,
"join_order": [
],
"merge_hint_ids": [
],
"hash_hint_ids": [
],
"no_hash_hint_ids": [
],
"nl_hint_ids": [
],
"part_hints": [
],
"use_late_materialization":-1,
"log_level":"",
"max_concurrent":-1,
"only_concurrent_hint":false,
"has_hint_exclude_concurrent":false,
"parallel":-1,
"use_px":2,
"use_expand":0,
"use_view_merge":0,
"use_unnest":0,
"use_place_groupby":0,
"use join filter": [
],
"org_pq_distributes": [
],
"pq_distributes": [
],
"pdml_option":-1
},
"user_variables": [
],
"query_context": {
"param_num":0,
"fetch_cur_time":true,
"calculable_items": [
]
},
"current_level":0,
"pseudo_column_like_exprs": [
],
"child_stmts": [
],
"is_hierarchical_query":false
}
],
"is_hierarchical_query":false
}