forked from stoneatom/stonedb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tianmu): fix bug: Convert DATETIME to TIME type error. (stoneatom…
…#995) [summary] 1 treat zero data legal;
- Loading branch information
Showing
4 changed files
with
35 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
USE test; | ||
CREATE TABLE t1 (a CHAR(1), b INT, c DATETIME, d DOUBLE); | ||
INSERT INTO t1 VALUES ('', NULL, '0-0-0', NULL), | ||
('a', 12, '1212-12-12', 1.19691E+100), | ||
('b', 13, '1313-3-13 13:13:13', 2.1961E+18), | ||
('c', 14, '1414-4-14', 0.16191), | ||
('d', 15, '2015-5-15 15:15:15', 1.971917); | ||
SELECT CONVERT(c, TIME) FROM t1; | ||
CONVERT(c, TIME) | ||
00:00:00 | ||
00:00:00 | ||
13:13:13 | ||
00:00:00 | ||
15:15:15 | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--sql_mode=NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--source include/have_tianmu.inc | ||
|
||
USE test; | ||
|
||
CREATE TABLE t1 (a CHAR(1), b INT, c DATETIME, d DOUBLE); | ||
|
||
INSERT INTO t1 VALUES ('', NULL, '0-0-0', NULL), | ||
('a', 12, '1212-12-12', 1.19691E+100), | ||
('b', 13, '1313-3-13 13:13:13', 2.1961E+18), | ||
('c', 14, '1414-4-14', 0.16191), | ||
('d', 15, '2015-5-15 15:15:15', 1.971917); | ||
|
||
SELECT CONVERT(c, TIME) FROM t1; | ||
DROP TABLE t1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters