matrixorigin / matrixorigin/matrixone

[Bug]: UNIX_TIMESTAMP func is not allowed for partition function

Open
#18,865 21 comments 0 reactions 1 assignee Claimed by @ck89119 View on GitHub
area/partition deferred kind/bug kind/feature
Dominant language
Go
Stars
1.9k
Forks
311
Avg merge
1d 3h
Merged PRs (30d)
768

Description

### Is there an existing issue for the same bug?

- [X] I have checked the existing issues.

### Branch Name

main

### Commit ID

afd7c53370cd67a1b21b84e2463ce60702493d06

### Other Environment Information

```Markdown
- Hardware parameters:
- OS type:
- Others:
```

### Actual Behavior

MO:
mysql> CREATE TABLE t1 (c TIMESTAMP)
-> PARTITION BY RANGE (UNIX_TIMESTAMP(c))
-> (PARTITION p0 VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01 00:00:00')),
-> PARTITION p1 VALUES LESS THAN (MAXVALUE));
ERROR 1564 (HY000): This partition function is not allowed

MYSQL:
mysql> CREATE TABLE t1 (c TIMESTAMP)
-> PARTITION BY RANGE (UNIX_TIMESTAMP(c))
-> (PARTITION p0 VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01 00:00:00')),
-> PARTITION p1 VALUES LESS THAN (MAXVALUE));
Query OK, 0 rows affected (0.04 sec)

### Expected Behavior

_No response_

### Steps to Reproduce

```Markdown
CREATE TABLE t1 (c TIMESTAMP)
PARTITION BY RANGE (UNIX_TIMESTAMP(c))
(PARTITION p0 VALUES LESS THAN (UNIX_TIMESTAMP('2000-01-01 00:00:00')),
PARTITION p1 VALUES LESS THAN (MAXVALUE));
DROP TABLE t1;
```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.