fix canonicalizer bug
This commit is contained in:
@ -6510,20 +6510,6 @@ int ObRawExprUtils::check_need_bool_expr(const ObRawExpr *expr, bool &need_bool_
|
|||||||
case T_OP_NOT_IN:
|
case T_OP_NOT_IN:
|
||||||
case T_OP_EXISTS:
|
case T_OP_EXISTS:
|
||||||
case T_OP_NOT_EXISTS:
|
case T_OP_NOT_EXISTS:
|
||||||
|
|
||||||
// all int is 8 byte in datum, so safe for expr to use get_int() for tinyint type
|
|
||||||
case T_TINYINT:
|
|
||||||
case T_SMALLINT:
|
|
||||||
case T_MEDIUMINT:
|
|
||||||
case T_INT32:
|
|
||||||
case T_INT:
|
|
||||||
|
|
||||||
case T_UTINYINT:
|
|
||||||
case T_USMALLINT:
|
|
||||||
case T_UMEDIUMINT:
|
|
||||||
case T_UINT32:
|
|
||||||
case T_UINT64:
|
|
||||||
|
|
||||||
case T_OP_XOR:
|
case T_OP_XOR:
|
||||||
case T_OP_BOOL: {
|
case T_OP_BOOL: {
|
||||||
need_bool_expr = false;
|
need_bool_expr = false;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -639,19 +639,19 @@
|
|||||||
],
|
],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"item_type":"T_INT",
|
"item_type":"T_OP_BOOL",
|
||||||
"result_type": {
|
"result_type": {
|
||||||
"meta": {
|
"meta": {
|
||||||
"type":"BIGINT",
|
"type":"",
|
||||||
"collation":"binary",
|
"collation":"binary",
|
||||||
"coercibility":"NUMERIC"
|
"coercibility":"NUMERIC"
|
||||||
},
|
},
|
||||||
"accuracy": {
|
"accuracy": {
|
||||||
"length":1,
|
"length":-1,
|
||||||
"precision":1,
|
"precision":-1,
|
||||||
"scale":0
|
"scale":-1
|
||||||
},
|
},
|
||||||
"flag":1,
|
"flag":0,
|
||||||
"calc_type": {
|
"calc_type": {
|
||||||
"type":"NULL",
|
"type":"NULL",
|
||||||
"collation":"invalid_type",
|
"collation":"invalid_type",
|
||||||
@ -659,29 +659,59 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expr_info": [
|
"expr_info": [
|
||||||
"IS_CONST",
|
"IS_CONST_EXPR",
|
||||||
"CNT_CONST"
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
],
|
],
|
||||||
"rel_id": [
|
"rel_id": [
|
||||||
],
|
],
|
||||||
"value": {
|
"children": [
|
||||||
"BIGINT":1
|
{
|
||||||
}
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_type":"T_INT",
|
"item_type":"T_OP_BOOL",
|
||||||
"result_type": {
|
"result_type": {
|
||||||
"meta": {
|
"meta": {
|
||||||
"type":"BIGINT",
|
"type":"",
|
||||||
"collation":"binary",
|
"collation":"binary",
|
||||||
"coercibility":"NUMERIC"
|
"coercibility":"NUMERIC"
|
||||||
},
|
},
|
||||||
"accuracy": {
|
"accuracy": {
|
||||||
"length":1,
|
"length":-1,
|
||||||
"precision":1,
|
"precision":-1,
|
||||||
"scale":0
|
"scale":-1
|
||||||
},
|
},
|
||||||
"flag":1,
|
"flag":0,
|
||||||
"calc_type": {
|
"calc_type": {
|
||||||
"type":"NULL",
|
"type":"NULL",
|
||||||
"collation":"invalid_type",
|
"collation":"invalid_type",
|
||||||
@ -689,14 +719,44 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expr_info": [
|
"expr_info": [
|
||||||
"IS_CONST",
|
"IS_CONST_EXPR",
|
||||||
"CNT_CONST"
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
],
|
],
|
||||||
"rel_id": [
|
"rel_id": [
|
||||||
],
|
],
|
||||||
"value": {
|
"children": [
|
||||||
"BIGINT":1
|
{
|
||||||
}
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -729,19 +789,19 @@
|
|||||||
],
|
],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"item_type":"T_INT",
|
"item_type":"T_OP_BOOL",
|
||||||
"result_type": {
|
"result_type": {
|
||||||
"meta": {
|
"meta": {
|
||||||
"type":"BIGINT",
|
"type":"",
|
||||||
"collation":"binary",
|
"collation":"binary",
|
||||||
"coercibility":"NUMERIC"
|
"coercibility":"NUMERIC"
|
||||||
},
|
},
|
||||||
"accuracy": {
|
"accuracy": {
|
||||||
"length":3,
|
"length":-1,
|
||||||
"precision":3,
|
"precision":-1,
|
||||||
"scale":0
|
"scale":-1
|
||||||
},
|
},
|
||||||
"flag":1,
|
"flag":0,
|
||||||
"calc_type": {
|
"calc_type": {
|
||||||
"type":"NULL",
|
"type":"NULL",
|
||||||
"collation":"invalid_type",
|
"collation":"invalid_type",
|
||||||
@ -749,29 +809,59 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expr_info": [
|
"expr_info": [
|
||||||
"IS_CONST",
|
"IS_CONST_EXPR",
|
||||||
"CNT_CONST"
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
],
|
],
|
||||||
"rel_id": [
|
"rel_id": [
|
||||||
],
|
],
|
||||||
"value": {
|
"children": [
|
||||||
"BIGINT":100
|
{
|
||||||
}
|
"item_type":"T_INT",
|
||||||
|
"result_type": {
|
||||||
|
"meta": {
|
||||||
|
"type":"BIGINT",
|
||||||
|
"collation":"binary",
|
||||||
|
"coercibility":"NUMERIC"
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"length":3,
|
||||||
|
"precision":3,
|
||||||
|
"scale":0
|
||||||
|
},
|
||||||
|
"flag":1,
|
||||||
|
"calc_type": {
|
||||||
|
"type":"NULL",
|
||||||
|
"collation":"invalid_type",
|
||||||
|
"coercibility":"INVALID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"expr_info": [
|
||||||
|
"IS_CONST",
|
||||||
|
"CNT_CONST"
|
||||||
|
],
|
||||||
|
"rel_id": [
|
||||||
|
],
|
||||||
|
"value": {
|
||||||
|
"BIGINT":100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"item_type":"T_INT",
|
"item_type":"T_OP_BOOL",
|
||||||
"result_type": {
|
"result_type": {
|
||||||
"meta": {
|
"meta": {
|
||||||
"type":"BIGINT",
|
"type":"",
|
||||||
"collation":"binary",
|
"collation":"binary",
|
||||||
"coercibility":"NUMERIC"
|
"coercibility":"NUMERIC"
|
||||||
},
|
},
|
||||||
"accuracy": {
|
"accuracy": {
|
||||||
"length":1,
|
"length":-1,
|
||||||
"precision":1,
|
"precision":-1,
|
||||||
"scale":0
|
"scale":-1
|
||||||
},
|
},
|
||||||
"flag":1,
|
"flag":0,
|
||||||
"calc_type": {
|
"calc_type": {
|
||||||
"type":"NULL",
|
"type":"NULL",
|
||||||
"collation":"invalid_type",
|
"collation":"invalid_type",
|
||||||
@ -779,14 +869,44 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expr_info": [
|
"expr_info": [
|
||||||
"IS_CONST",
|
"IS_CONST_EXPR",
|
||||||
"CNT_CONST"
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
],
|
],
|
||||||
"rel_id": [
|
"rel_id": [
|
||||||
],
|
],
|
||||||
"value": {
|
"children": [
|
||||||
"BIGINT":0
|
{
|
||||||
}
|
"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":0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -821,37 +941,7 @@
|
|||||||
],
|
],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"item_type":"T_INT",
|
"item_type":"T_OP_BOOL",
|
||||||
"result_type": {
|
|
||||||
"meta": {
|
|
||||||
"type":"BIGINT",
|
|
||||||
"collation":"binary",
|
|
||||||
"coercibility":"NUMERIC"
|
|
||||||
},
|
|
||||||
"accuracy": {
|
|
||||||
"length":3,
|
|
||||||
"precision":3,
|
|
||||||
"scale":0
|
|
||||||
},
|
|
||||||
"flag":1,
|
|
||||||
"calc_type": {
|
|
||||||
"type":"NULL",
|
|
||||||
"collation":"invalid_type",
|
|
||||||
"coercibility":"INVALID"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"expr_info": [
|
|
||||||
"IS_CONST",
|
|
||||||
"CNT_CONST"
|
|
||||||
],
|
|
||||||
"rel_id": [
|
|
||||||
],
|
|
||||||
"value": {
|
|
||||||
"BIGINT":100
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"item_type":"T_OP_AND",
|
|
||||||
"result_type": {
|
"result_type": {
|
||||||
"meta": {
|
"meta": {
|
||||||
"type":"",
|
"type":"",
|
||||||
@ -872,41 +962,12 @@
|
|||||||
},
|
},
|
||||||
"expr_info": [
|
"expr_info": [
|
||||||
"IS_CONST_EXPR",
|
"IS_CONST_EXPR",
|
||||||
"CNT_CONST"
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
],
|
],
|
||||||
"rel_id": [
|
"rel_id": [
|
||||||
],
|
],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
|
||||||
"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":0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"item_type":"T_INT",
|
"item_type":"T_INT",
|
||||||
"result_type": {
|
"result_type": {
|
||||||
@ -938,6 +999,155 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_type":"T_OP_AND",
|
||||||
|
"result_type": {
|
||||||
|
"meta": {
|
||||||
|
"type":"",
|
||||||
|
"collation":"binary",
|
||||||
|
"coercibility":"NUMERIC"
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"length":-1,
|
||||||
|
"precision":-1,
|
||||||
|
"scale":-1
|
||||||
|
},
|
||||||
|
"flag":0,
|
||||||
|
"calc_type": {
|
||||||
|
"type":"NULL",
|
||||||
|
"collation":"invalid_type",
|
||||||
|
"coercibility":"INVALID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"expr_info": [
|
||||||
|
"IS_CONST_EXPR",
|
||||||
|
"CNT_CONST"
|
||||||
|
],
|
||||||
|
"rel_id": [
|
||||||
|
],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"item_type":"T_OP_BOOL",
|
||||||
|
"result_type": {
|
||||||
|
"meta": {
|
||||||
|
"type":"",
|
||||||
|
"collation":"binary",
|
||||||
|
"coercibility":"NUMERIC"
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"length":-1,
|
||||||
|
"precision":-1,
|
||||||
|
"scale":-1
|
||||||
|
},
|
||||||
|
"flag":0,
|
||||||
|
"calc_type": {
|
||||||
|
"type":"NULL",
|
||||||
|
"collation":"invalid_type",
|
||||||
|
"coercibility":"INVALID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"expr_info": [
|
||||||
|
"IS_CONST_EXPR",
|
||||||
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
|
],
|
||||||
|
"rel_id": [
|
||||||
|
],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"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":0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"item_type":"T_OP_BOOL",
|
||||||
|
"result_type": {
|
||||||
|
"meta": {
|
||||||
|
"type":"",
|
||||||
|
"collation":"binary",
|
||||||
|
"coercibility":"NUMERIC"
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"length":-1,
|
||||||
|
"precision":-1,
|
||||||
|
"scale":-1
|
||||||
|
},
|
||||||
|
"flag":0,
|
||||||
|
"calc_type": {
|
||||||
|
"type":"NULL",
|
||||||
|
"collation":"invalid_type",
|
||||||
|
"coercibility":"INVALID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"expr_info": [
|
||||||
|
"IS_CONST_EXPR",
|
||||||
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
|
],
|
||||||
|
"rel_id": [
|
||||||
|
],
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"item_type":"T_INT",
|
||||||
|
"result_type": {
|
||||||
|
"meta": {
|
||||||
|
"type":"BIGINT",
|
||||||
|
"collation":"binary",
|
||||||
|
"coercibility":"NUMERIC"
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"length":3,
|
||||||
|
"precision":3,
|
||||||
|
"scale":0
|
||||||
|
},
|
||||||
|
"flag":1,
|
||||||
|
"calc_type": {
|
||||||
|
"type":"NULL",
|
||||||
|
"collation":"invalid_type",
|
||||||
|
"coercibility":"INVALID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"expr_info": [
|
||||||
|
"IS_CONST",
|
||||||
|
"CNT_CONST"
|
||||||
|
],
|
||||||
|
"rel_id": [
|
||||||
|
],
|
||||||
|
"value": {
|
||||||
|
"BIGINT":100
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -2414,19 +2624,19 @@
|
|||||||
],
|
],
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"item_type":"T_INT",
|
"item_type":"T_OP_BOOL",
|
||||||
"result_type": {
|
"result_type": {
|
||||||
"meta": {
|
"meta": {
|
||||||
"type":"BIGINT",
|
"type":"",
|
||||||
"collation":"binary",
|
"collation":"binary",
|
||||||
"coercibility":"NUMERIC"
|
"coercibility":"NUMERIC"
|
||||||
},
|
},
|
||||||
"accuracy": {
|
"accuracy": {
|
||||||
"length":2,
|
"length":-1,
|
||||||
"precision":2,
|
"precision":-1,
|
||||||
"scale":0
|
"scale":-1
|
||||||
},
|
},
|
||||||
"flag":1,
|
"flag":0,
|
||||||
"calc_type": {
|
"calc_type": {
|
||||||
"type":"NULL",
|
"type":"NULL",
|
||||||
"collation":"invalid_type",
|
"collation":"invalid_type",
|
||||||
@ -2434,14 +2644,44 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expr_info": [
|
"expr_info": [
|
||||||
"IS_CONST",
|
"IS_CONST_EXPR",
|
||||||
"CNT_CONST"
|
"CNT_CONST",
|
||||||
|
"IS_INNER_ADDED_EXPR"
|
||||||
],
|
],
|
||||||
"rel_id": [
|
"rel_id": [
|
||||||
],
|
],
|
||||||
"value": {
|
"children": [
|
||||||
"BIGINT":10
|
{
|
||||||
}
|
"item_type":"T_INT",
|
||||||
|
"result_type": {
|
||||||
|
"meta": {
|
||||||
|
"type":"BIGINT",
|
||||||
|
"collation":"binary",
|
||||||
|
"coercibility":"NUMERIC"
|
||||||
|
},
|
||||||
|
"accuracy": {
|
||||||
|
"length":2,
|
||||||
|
"precision":2,
|
||||||
|
"scale":0
|
||||||
|
},
|
||||||
|
"flag":1,
|
||||||
|
"calc_type": {
|
||||||
|
"type":"NULL",
|
||||||
|
"collation":"invalid_type",
|
||||||
|
"coercibility":"INVALID"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"expr_info": [
|
||||||
|
"IS_CONST",
|
||||||
|
"CNT_CONST"
|
||||||
|
],
|
||||||
|
"rel_id": [
|
||||||
|
],
|
||||||
|
"value": {
|
||||||
|
"BIGINT":10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user