matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: less than date type min value, load data and insert execute success.

Open tianyahui-python opened this issue 3 years ago • 4 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Environment

- Version or commit-id (e.g. v0.1.0 or 8b23a93):
- Hardware parameters:
- OS type:
- Others:

Actual Behavior

drop table if exists t4; create table t4( col1 date, col2 datetime, col3 timestamp, col4 bool );

load data infile 'csv' into table t4; should execute failed.

csv data: 0999-01-01,0001-01-01,,0

insert into t4(col1) values ("0999-01-01"); should execute failed

Expected Behavior

No response

Steps to Reproduce

No response

Additional information

No response

tianyahui-python avatar Sep 20 '22 09:09 tianyahui-python

now date type range is date[0001-01-01 to 9999-12-31], datetime range is date[0001-01-01 00:00:00 to 9999-12-31 23:59:59]

bbbearxyz avatar Sep 20 '22 12:09 bbbearxyz

截屏2022-09-20 下午9 52 48

https://docs.matrixorigin.io/cn/0.5.1/MatrixOne/Reference/Data-Types/data-types/

tianyahui-python avatar Sep 20 '22 13:09 tianyahui-python

now date type range is date[0001-01-01 to 9999-12-31]

Where can I look this up?

tianyahui-python avatar Sep 20 '22 13:09 tianyahui-python

now date type range is date[0001-01-01 to 9999-12-31]

Where can I look this up?

sorry, you better to look in the mo code or ask me.

bbbearxyz avatar Oct 12 '22 08:10 bbbearxyz

As product design, the range of date should be the same as mysql which is between 1000-01-01 and 9999-12-31

domingozhang avatar Oct 29 '22 07:10 domingozhang

As product design, the range of date should be the same as mysql which is between 1000-01-01 and 9999-12-31


@bbbearxyz

tianyahui-python avatar Oct 29 '22 07:10 tianyahui-python

pr #6245 all ready add date/datetime range check, if out of range, sys will report err. But in the extern table, only when select data from table, then the table parse data/datetime and report err . this is designed by @jianwan0214. Timestamp now don't do range check, in the code they said because of issue5305.

bbbearxyz avatar Nov 03 '22 13:11 bbbearxyz

now #6245 support timestamp range check

bbbearxyz avatar Nov 04 '22 06:11 bbbearxyz

Not a bug.

fengttt avatar Nov 04 '22 07:11 fengttt