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 incorrect result of TIME type by distinguishing the processing of…
… TIME type from other time types
- Loading branch information
1 parent
9805e07
commit 6c11356
Showing
3 changed files
with
146 additions
and
2 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,67 @@ | ||
DROP DATABASE IF EXISTS issue1175_test; | ||
# Creating test database issue1175_test | ||
CREATE DATABASE issue1175_test; | ||
USE issue1175_test; | ||
# Create test table with tianmu engine | ||
CREATE TABLE t1 ( | ||
id INT AUTO_INCREMENT PRIMARY KEY, | ||
t TIME, | ||
d DATE, | ||
dt DATETIME, | ||
ts TIMESTAMP | ||
) ENGINE=TIANMU; | ||
# Insert data into test table | ||
INSERT INTO t1 (t, d, dt, ts) VALUES | ||
('00:00:00', '2000-01-01', '2000-01-01 00:00:00', '2000-01-01 00:00:00'), | ||
('-838:59:59', '2001-02-28', '2001-02-28 00:00:00', '2001-02-28 00:00:00'), | ||
('838:59:59', '2002-03-31', '2002-03-31 23:59:59', '2002-03-31 23:59:59'), | ||
('-100:00:00', '2010-12-31', '2010-12-31 12:34:56', '2010-12-31 12:34:56'), | ||
('200:00:00', '2011-11-30', '2011-11-30 18:00:00', '2011-11-30 18:00:00'), | ||
('-400:00:00', '2012-02-29', '2012-02-29 01:23:45', '2012-02-29 01:23:45'), | ||
('720:00:00', '2020-10-31', '2020-10-31 14:00:00', '2020-10-31 14:00:00'), | ||
('05:30:15', '1985-04-12', '1985-04-12 05:30:15.123', '1985-04-12 05:30:15.123'), | ||
('-23:45:01', '1995-08-24', '1995-08-24 15:45:30.987', '1995-08-24 15:45:30.987'), | ||
('67:15:45', '2005-06-15', '2005-06-15 10:59:59.001', '2005-06-15 10:59:59.001'), | ||
('-115:00:00', '2007-12-25', '2007-12-25 23:30:45.500', '2007-12-25 23:30:45.500'), | ||
('350:30:15', '2015-09-05', '2015-09-05 12:00:00.999', '2015-09-05 12:00:00.999'), | ||
('-500:45:30', '2017-03-01', '2017-03-01 01:23:45.250', '2017-03-01 01:23:45.250'), | ||
('600:15:00', '2021-05-01', '2021-05-01 17:30:00.123', '2021-05-01 17:30:00.123'), | ||
('12:34:56', '1970-01-01', '1970-01-01 12:34:56', '1970-01-01 12:34:56'), | ||
('-300:00:00.123', '1980-06-30', '1980-06-30 18:30:45.123', '1980-06-30 18:30:45.123'), | ||
('450:00:00', '1990-03-15', '1990-03-15 11:59:59.999', '1990-03-15 11:59:59.999'), | ||
('-600:00:00.9', '1999-09-09', '1999-09-09 06:45:00.250', '1999-09-09 06:45:00.250'), | ||
('-09:00:00', '2005-02-28', '2005-02-28 15:00:00.123', '2005-02-28 15:00:00.123'), | ||
('-123:45:00', '2008-08-08', '2008-08-08 20:15:30.987', '2008-08-08 20:15:30.987'), | ||
('99:00:00', '2013-07-07', '2013-07-07 17:30:45.500', '2013-07-07 17:30:45.500'), | ||
('-220:00:00', '2016-04-30', '2016-04-30 02:00:00.999', '2016-04-30 02:00:00.999'), | ||
('580:00:00', '2019-12-31', '2019-12-31 01:23:45.250', '2019-12-31 01:23:45.250'), | ||
('-750:00:00', '2021-08-31', '2021-08-31 09:45:00.123', '2021-08-31 09:45:00.123'); | ||
# Select all data from test table | ||
SELECT * FROM t1 ORDER BY id; | ||
id t d dt ts | ||
1 00:00:00 2000-01-01 2000-01-01 00:00:00 2000-01-01 00:00:00 | ||
2 -838:59:59 2001-02-28 2001-02-28 00:00:00 2001-02-28 00:00:00 | ||
3 838:59:59 2002-03-31 2002-03-31 23:59:59 2002-03-31 23:59:59 | ||
4 -100:00:00 2010-12-31 2010-12-31 12:34:56 2010-12-31 12:34:56 | ||
5 200:00:00 2011-11-30 2011-11-30 18:00:00 2011-11-30 18:00:00 | ||
6 -400:00:00 2012-02-29 2012-02-29 01:23:45 2012-02-29 01:23:45 | ||
7 720:00:00 2020-10-31 2020-10-31 14:00:00 2020-10-31 14:00:00 | ||
8 05:30:15 1985-04-12 1985-04-12 05:30:15 1985-04-12 05:30:15 | ||
9 -23:45:01 1995-08-24 1995-08-24 15:45:31 1995-08-24 15:45:31 | ||
10 67:15:45 2005-06-15 2005-06-15 10:59:59 2005-06-15 10:59:59 | ||
11 -115:00:00 2007-12-25 2007-12-25 23:30:46 2007-12-25 23:30:46 | ||
12 350:30:15 2015-09-05 2015-09-05 12:00:01 2015-09-05 12:00:01 | ||
13 -500:45:30 2017-03-01 2017-03-01 01:23:45 2017-03-01 01:23:45 | ||
14 600:15:00 2021-05-01 2021-05-01 17:30:00 2021-05-01 17:30:00 | ||
15 12:34:56 1970-01-01 1970-01-01 12:34:56 1970-01-01 12:34:56 | ||
16 -300:00:00 1980-06-30 1980-06-30 18:30:45 1980-06-30 18:30:45 | ||
17 450:00:00 1990-03-15 1990-03-15 12:00:00 1990-03-15 12:00:00 | ||
18 -600:00:01 1999-09-09 1999-09-09 06:45:00 1999-09-09 06:45:00 | ||
19 -09:00:00 2005-02-28 2005-02-28 15:00:00 2005-02-28 15:00:00 | ||
20 -123:45:00 2008-08-08 2008-08-08 20:15:31 2008-08-08 20:15:31 | ||
21 99:00:00 2013-07-07 2013-07-07 17:30:46 2013-07-07 17:30:46 | ||
22 -220:00:00 2016-04-30 2016-04-30 02:00:01 2016-04-30 02:00:01 | ||
23 580:00:00 2019-12-31 2019-12-31 01:23:45 2019-12-31 01:23:45 | ||
24 -750:00:00 2021-08-31 2021-08-31 09:45:00 2021-08-31 09:45:00 | ||
# Dropping test database issue1175_test | ||
DROP DATABASE issue1175_test; |
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,54 @@ | ||
--source include/have_tianmu.inc | ||
|
||
--disable_warnings | ||
DROP DATABASE IF EXISTS issue1175_test; | ||
--enable_warnings | ||
|
||
--echo # Creating test database issue1175_test | ||
CREATE DATABASE issue1175_test; | ||
|
||
USE issue1175_test; | ||
|
||
--disable_warnings | ||
|
||
--echo # Create test table with tianmu engine | ||
CREATE TABLE t1 ( | ||
id INT AUTO_INCREMENT PRIMARY KEY, | ||
t TIME, | ||
d DATE, | ||
dt DATETIME, | ||
ts TIMESTAMP | ||
) ENGINE=TIANMU; | ||
|
||
--echo # Insert data into test table | ||
INSERT INTO t1 (t, d, dt, ts) VALUES | ||
('00:00:00', '2000-01-01', '2000-01-01 00:00:00', '2000-01-01 00:00:00'), | ||
('-838:59:59', '2001-02-28', '2001-02-28 00:00:00', '2001-02-28 00:00:00'), | ||
('838:59:59', '2002-03-31', '2002-03-31 23:59:59', '2002-03-31 23:59:59'), | ||
('-100:00:00', '2010-12-31', '2010-12-31 12:34:56', '2010-12-31 12:34:56'), | ||
('200:00:00', '2011-11-30', '2011-11-30 18:00:00', '2011-11-30 18:00:00'), | ||
('-400:00:00', '2012-02-29', '2012-02-29 01:23:45', '2012-02-29 01:23:45'), | ||
('720:00:00', '2020-10-31', '2020-10-31 14:00:00', '2020-10-31 14:00:00'), | ||
('05:30:15', '1985-04-12', '1985-04-12 05:30:15.123', '1985-04-12 05:30:15.123'), | ||
('-23:45:01', '1995-08-24', '1995-08-24 15:45:30.987', '1995-08-24 15:45:30.987'), | ||
('67:15:45', '2005-06-15', '2005-06-15 10:59:59.001', '2005-06-15 10:59:59.001'), | ||
('-115:00:00', '2007-12-25', '2007-12-25 23:30:45.500', '2007-12-25 23:30:45.500'), | ||
('350:30:15', '2015-09-05', '2015-09-05 12:00:00.999', '2015-09-05 12:00:00.999'), | ||
('-500:45:30', '2017-03-01', '2017-03-01 01:23:45.250', '2017-03-01 01:23:45.250'), | ||
('600:15:00', '2021-05-01', '2021-05-01 17:30:00.123', '2021-05-01 17:30:00.123'), | ||
('12:34:56', '1970-01-01', '1970-01-01 12:34:56', '1970-01-01 12:34:56'), | ||
('-300:00:00.123', '1980-06-30', '1980-06-30 18:30:45.123', '1980-06-30 18:30:45.123'), | ||
('450:00:00', '1990-03-15', '1990-03-15 11:59:59.999', '1990-03-15 11:59:59.999'), | ||
('-600:00:00.9', '1999-09-09', '1999-09-09 06:45:00.250', '1999-09-09 06:45:00.250'), | ||
('-09:00:00', '2005-02-28', '2005-02-28 15:00:00.123', '2005-02-28 15:00:00.123'), | ||
('-123:45:00', '2008-08-08', '2008-08-08 20:15:30.987', '2008-08-08 20:15:30.987'), | ||
('99:00:00', '2013-07-07', '2013-07-07 17:30:45.500', '2013-07-07 17:30:45.500'), | ||
('-220:00:00', '2016-04-30', '2016-04-30 02:00:00.999', '2016-04-30 02:00:00.999'), | ||
('580:00:00', '2019-12-31', '2019-12-31 01:23:45.250', '2019-12-31 01:23:45.250'), | ||
('-750:00:00', '2021-08-31', '2021-08-31 09:45:00.123', '2021-08-31 09:45:00.123'); | ||
|
||
--echo # Select all data from test table | ||
SELECT * FROM t1 ORDER BY id; | ||
|
||
--echo # Dropping test database issue1175_test | ||
DROP DATABASE issue1175_test; |
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