Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load data (Incorrect timestamp value) into a StoneDB table, but No warnning was returned #656

Closed
2 of 3 tasks
davidshiz opened this issue Oct 8, 2022 · 2 comments · Fixed by #1078
Closed
2 of 3 tasks
Assignees
Labels
A-enhancement New feature or request A-wontfix This will not be worked on

Comments

@davidshiz
Copy link
Collaborator

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • I confirm there is no existing issue for this

Describe the problem

The TIMESTAMP data type is used for values that contain both date and time parts. TIMESTAMP has a
range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC;

when I am trying to load data into a StoneDB table and all of my timestamps (out of range) are being loaded as '0000-00-00 00:00:00', and no warning.

image

Expected behavior

A warning message should be returned

image
image

How To Reproduce

ubuntu@ubuntu:~$ cat /home/ubuntu/test
1,2056-08-22 11:24:49
CREATE TABLE `test` (
  `id` int(11) DEFAULT NULL,
  `t` timestamp NULL DEFAULT NULL
) ENGINE=TIANMU DEFAULT CHARSET=utf8mb4;

load data local infile '/home/ubuntu/test' into table test fields terminated by ',';

Environment

ubuntu@ubuntu:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

ubuntu@ubuntu:~$ /stonedb57/install/bin/mysqld --version
/stonedb57/install/bin/mysqld Ver 5.7.36_v1.0.1_beta_2-StoneDB for Linux on x86_64 (build-)
build information as follow:
Repository address: https://github.com/stoneatom/stonedb.git:stonedb-5.7-dev
Branch name: stonedb-5.7-dev
Last commit ID: 208f79d
Last commit time: Date: Sat Sep 17 16:19:42 2022 +0800
Build time: Date: Fri Sep 23 14:14:27 CST 2022

Are you interested in submitting a PR to solve the problem?

  • Yes, I will!
@davidshiz davidshiz added the A-bug Something isn't working label Oct 8, 2022
@davidshiz davidshiz added this to the stonedb_5.7_v1.0.1 milestone Oct 9, 2022
@lylth lylth self-assigned this Oct 13, 2022
@hustjieke hustjieke self-assigned this Nov 17, 2022
@hustjieke hustjieke added the prio: low Low priority label Nov 24, 2022
@hustjieke
Copy link
Collaborator

hustjieke commented Nov 24, 2022

MySQL result, The same with Tianmu, but Tianmu has no warnings:

mysql> show warnings;
+---------+------+--------------------------------------------+
| Level   | Code | Message                                    |
+---------+------+--------------------------------------------+
| Warning | 1264 | Out of range value for column 't' at row 1 |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)

mysql> select * from t;
+------+---------------------+
| id   | t                   |
+------+---------------------+
|    1 | 0000-00-00 00:00:00 |
+------+---------------------+
1 row in set (0.00 sec)

@RingsC RingsC assigned adofsauron and unassigned hustjieke and lylth Nov 30, 2022
@RingsC RingsC added prio: high High priority A-enhancement New feature or request A-wontfix This will not be worked on and removed prio: low Low priority A-bug Something isn't working prio: high High priority labels Nov 30, 2022
@adofsauron
Copy link
Collaborator

Using insert statements to go through the insert process, timestamp is recognized when it crosses the boundary

mysql> INSERT test_timestamp(a) VALUES('2038-01-19 03:14:07');
ERROR 1292 (22007): Incorrect datetime value: '2038-01-19 03:14:07' for column 'a' at row 1
mysql> INSERT test_timestamp(a) VALUES('2038-01-19 03:14:06');
ERROR 1292 (22007): Incorrect datetime value: '2038-01-19 03:14:06' for column 'a' at row 1
mysql> INSERT test_timestamp(a) VALUES('2038-01-18 03:14:06');
Query OK, 1 row affected (0.00 sec)

@RingsC RingsC changed the title bug: load data (Incorrect timestamp value) into a StoneDB table, but No warnning was returned feat: load data (Incorrect timestamp value) into a StoneDB table, but No warnning was returned Nov 30, 2022
@lujiashun lujiashun assigned lujiashun and unassigned adofsauron Dec 2, 2022
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Dec 6, 2022
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Dec 6, 2022
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Dec 7, 2022
lujiashun pushed a commit to lujiashun/stonedb that referenced this issue Dec 7, 2022
@mergify mergify bot closed this as completed in #1078 Dec 7, 2022
mergify bot pushed a commit that referenced this issue Dec 7, 2022
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-enhancement New feature or request A-wontfix This will not be worked on
Projects
Development

Successfully merging a pull request may close this issue.

6 participants