Skip to content

bug: TIME type, return incorrect result set #1175

@davidshiz

Description

@davidshiz

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!

Metadata

Metadata

Assignees

Labels

A-bugSomething isn't workingB-storagedata type, data storage, insert,update,delete, transactionsgood first issueGood for newcomersprio: lowLow priority

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions