diff options
author | Sergei Golubchik <sergii@pisem.net> | 2011-03-08 19:41:58 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2011-03-08 19:41:58 +0100 |
commit | 8b7fd8f577fe3edc84eea54288c7d30775a1559b (patch) | |
tree | 6d245df86f99894d74eea055dc01800ccc2d7bb4 /mysql-test/t/distinct.test | |
parent | 2c80662d231414eb98b5cd4cede069d1482ccc20 (diff) | |
download | mariadb-git-8b7fd8f577fe3edc84eea54288c7d30775a1559b.tar.gz |
lp:731124 Loss of precision on DISTINCT
many changes:
* NOT_FIXED_DEC now create hires fields, not old ones.
As a result, temp tables preserve microseconds (on DISTINCT, GROUP BY)
* I_S tables force decimals=0 on temporal types (backward compatibility)
* Item_func_coalesce calculates decimals for temporal types
* no precision for TIME/DATETIME in CAST means 0, not NOT_FIXED_DEC
* addtime/timediff calculate decimals from arguments (not NOT_FIXED_DEC)
sql/field.h:
NOT_FIXED_DEC now create hires fields, not old ones
sql/item.h:
force decimals=0 for I_S tables
sql/item_cmpfunc.cc:
Item_func_coalesce calculates decimals for temporal types
sql/item_create.cc:
no precision for TIME/DATETIME in CAST means 0, not NOT_FIXED_DEC
sql/item_timefunc.cc:
addtime calculates decimals from arguments (not NOT_FIXED_DEC)
sql/item_timefunc.h:
timediff calculates decimals from arguments (not NOT_FIXED_DEC)
Diffstat (limited to 'mysql-test/t/distinct.test')
-rw-r--r-- | mysql-test/t/distinct.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/t/distinct.test b/mysql-test/t/distinct.test index 9cc5dce6754..89d3f85a38d 100644 --- a/mysql-test/t/distinct.test +++ b/mysql-test/t/distinct.test @@ -624,3 +624,12 @@ select * from t1 where a = DATE('2010-10-10'); select distinct a from t1 where a = DATE('2010-10-10'); drop table t1; +# +# lp:731124 Loss of precision on DISTINCT +# +create table t1 (f1 varchar(40)); +insert into t1 values ('2010-10-10 00:00:00.0001'),('2010-10-10 00:00:00.0002'),('2010-10-10 00:00:00.0003'); +select time(f1) from t1 ; +select distinct time(f1) from t1 ; +drop table t1; + |