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

bug: TIME type, return incorrect result set #1175

Open
2 of 3 tasks
davidshiz opened this issue Dec 30, 2022 · 4 comments
Open
2 of 3 tasks

bug: TIME type, return incorrect result set #1175

davidshiz opened this issue Dec 30, 2022 · 4 comments
Assignees
Labels
A-bug Something isn't working B-storage data type, data storage, insert,update,delete, transactions good first issue Good for newcomers prio: low Low priority

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

mysql> CREATE TABLE t1 (a TIME NOT NULL);
Query OK, 0 rows affected (0.01 sec)

mysql> INSERT INTO t1 VALUES ('00:00:02.9');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO t1 VALUES ('800:00:02');
Query OK, 1 row affected (0.00 sec)

mysql> INSERT INTO t1 VALUES ('-800:00:02.9');
Query OK, 1 row affected (0.00 sec)

mysql> select * from t1;
+------------+
| a          |
+------------+
| 00:00:03   |
| 838:59:59  |
| -838:59:59 |
+------------+
3 rows in set (0.00 sec)

Expected behavior

mysql> select * from t1;
+------------+
| a          |
+------------+
| 00:00:03   |
| 800:00:02  |
| -800:00:03 |
+------------+
3 rows in set (0.00 sec)

How To Reproduce

drop table t1;
CREATE TABLE t1 (a TIME NOT NULL);
INSERT INTO t1 VALUES ('00:00:02.9');
INSERT INTO t1 VALUES ('800:00:02');
INSERT INTO t1 VALUES ('-800:00:02.9');
select * from t1;

Environment

[root@localhost ~]# /opt/stonedb57/install/bin/mysqld --version
/opt/stonedb57/install/bin/mysqld  Ver 5.7.36-StoneDB for Linux on x86_64 (build-)
build information as follow:
        Repository address: https://github.com/stoneatom/stonedb.git:HEAD
        Branch name: HEAD
        Last commit ID: b44a51ce8
        Last commit time: Date:   Fri Dec 2 16:11:06 2022 +0000
        Build time: Date: Mon Dec  5 06:12:44 UTC 2022
[root@localhost ~]# cat /etc/system-release
CentOS Linux release 7.9.2009 (Core)

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 Dec 30, 2022
@wisehead wisehead added this to the stonedb_5.7_v1.0.3 milestone Jan 6, 2023
@wisehead wisehead added the B-storage data type, data storage, insert,update,delete, transactions label Jan 9, 2023
@hustjieke hustjieke added prio: low Low priority good first issue Good for newcomers labels Jan 30, 2023
@StLeoX
Copy link

StLeoX commented Feb 25, 2023

I'll focus on this at the same time.

@konghaiya
Copy link
Collaborator

If you are interested in fixing this problem, we are very happy to hand it over to you.
@StLeoX

@StLeoX
Copy link

StLeoX commented Feb 25, 2023

Yes, working on it. Thinks if assigning it to me.

@konghaiya konghaiya assigned StLeoX and unassigned konghaiya Feb 25, 2023
@duanjr
Copy link
Contributor

duanjr commented May 8, 2023

It's probably because DATATIME and TIME share the same data struct in tianmu engine, and we didn't distinguish between them when storing. I‘’ve implemented a solution and will submit a PR tomorrow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-bug Something isn't working B-storage data type, data storage, insert,update,delete, transactions good first issue Good for newcomers prio: low Low priority
Projects
Development

No branches or pull requests

6 participants