Open AnyhowStep opened 3 years ago
The following are semantically equivalent,
CREATE TABLE T (X INT) PARTITION BY HASH(X IS NULL);
CREATE TABLE T (X INT) PARTITION BY HASH((X IS NULL));
The difference is X IS NULL vs (X IS NULL).
X IS NULL
(X IS NULL)
When given X IS NULL, we get a syntax error.
When given (X IS NULL), we are told IS NULL is not a valid partition function (ER_PARTITION_FUNCTION_IS_NOT_ALLOWED) per,
IS NULL
ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
check_partition_func_processor
We should probably allow Expression in the HashPartition rule, then push error checks down the pipeline.
Expression
HashPartition
Right now, X IS NULL will give,
X
IS
HASH(NULL)
And (X IS NULL) will just parse successfully without any parse errors.
The following are semantically equivalent,
The difference is
X IS NULL
vs(X IS NULL)
.When given
X IS NULL
, we get a syntax error.When given
(X IS NULL)
, we are toldIS NULL
is not a valid partition function (ER_PARTITION_FUNCTION_IS_NOT_ALLOWED
) per,check_partition_func_processor
https://github.com/mysql/mysql-server/search?q=check_partition_func_processorcheck_partition_func_processor
. If it returns false, we can use it. Otherwise, we can'tWe should probably allow
Expression
in theHashPartition
rule, then push error checks down the pipeline.Right now,
X IS NULL
will give,X
IS
HASH(NULL)
And
(X IS NULL)
will just parse successfully without any parse errors.