[MDEV-21196] Odd parsing error upon wrong partitioning expression Created: 2019-12-02  Updated: 2020-06-09

Status: Open
Project: MariaDB Server
Component/s: Parser, Partitioning
Affects Version/s: 5.5, 10.1, 10.2, 10.3, 10.4
Fix Version/s: 10.5

Type: Bug Priority: Trivial
Reporter: Elena Stepanova Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: upstream


 Description   

MariaDB [test]> create table t1 (c char(8)) partition by range (c(4)) (partition p1 values less than ('foo'));
ERROR 1064 (42000): Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed near ') (partition p1 values less than ('foo'))' at line 1

The text is odd, since it's neither constant, nor random, nor timezone-dependent expression. It is not very important though, the statement would fail anyway, since partitioning by CHAR is not supported.



 Comments   
Comment by Alexander Barkov [ 2020-06-01 ]

elenst,

The parser considers the `c(4)`part of the above statement as a stored function call.
IIUC, stored functions are not allowed in partition expressions, hence the error.

What would you suggest? Should we add an additional error message for such cases?

Thanks.

Comment by Elena Stepanova [ 2020-06-01 ]

Maybe just potentially rethink the text of this one. From the current message, I frankly didn't even guess that it was interpreting it as a function call.
It's not very important though. it's fine with me if you want to close it as "won't fix". If there are ever confused users, they'll be able to google up the bug report and solve the mystery.

Generated at Thu Feb 08 09:05:18 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.