stonedb icon indicating copy to clipboard operation
stonedb copied to clipboard

bug: create table as select str_to_date() return error

Open davidshiz opened this issue 1 year ago • 3 comments

Have you read the Contributing Guidelines on issues?

Please confirm if bug report does NOT exists already ?

  • [X] I confirm there is no existing issue for this

Describe the problem

mysql> SET sql_mode = 'NO_ENGINE_SUBSTITUTION';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> select str_to_date("02 10", "%d %H");
+-------------------------------+
| str_to_date("02 10", "%d %H") |
+-------------------------------+
| 58:00:00                      |
+-------------------------------+
1 row in set (0.00 sec)

mysql> create table t2 select str_to_date("02 10", "%d %H");
Query OK, 1 row affected (0.01 sec)
Records: 1  Duplicates: 0  Warnings: 0

mysql> select * from t2;
+-------------------------------+
| str_to_date("02 10", "%d %H") |
+-------------------------------+
| 82:00:00                      |
+-------------------------------+
1 row in set (0.00 sec)

Expected behavior

mysql> select * from t2;
+-------------------------------+
| str_to_date("02 10", "%d %H") |
+-------------------------------+
| 58:00:00                      |
+-------------------------------+
1 row in set (0.00 sec)

How To Reproduce

No response

Environment

root@ub01:~# /stonedb57/install//bin/mysqld --version
/stonedb57/install//bin/mysqld  Ver 5.7.36-StoneDB-v1.0.3 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: 1fa5661e4
        Last commit time: Date:   Thu Mar 23 20:19:17 2023 +0800
        Build time: Date: Wed Mar 29 10:31:02 CST 2023

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

  • [ ] Yes, I will!

davidshiz avatar Mar 30 '23 02:03 davidshiz