Bug #62696 | Using a numeric operator on a TIME column should return an error or warning | ||
---|---|---|---|
Submitted: | 12 Oct 2011 9:36 | Modified: | 12 Oct 2011 13:18 |
Reporter: | Daniël van Eeden | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Parser | Severity: | S3 (Non-critical) |
Version: | 5.5.17, 5.6.4-m5 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | compatibility, STANDARDS, time |
[12 Oct 2011 9:36]
Daniël van Eeden
[12 Oct 2011 9:36]
Daniël van Eeden
See also: http://databaseblog.myname.nl/2011/10/same-query-3-databases-3-different.html
[12 Oct 2011 13:18]
Valeriy Kravchuk
This is easy to verify: macbook-pro:5.5 openxs$ bin/mysql -uroot test Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 13 Server version: 5.5.17-debug Source distribution Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> drop table t1; Query OK, 0 rows affected (0.16 sec) mysql> create table t1 (id serial, t time); Query OK, 0 rows affected (0.11 sec) mysql> insert into t1(t) values ('00:05:10'); Query OK, 1 row affected (0.05 sec) mysql> select t,t*1.5 from t1; +----------+-------+ | t | t*1.5 | +----------+-------+ | 00:05:10 | 765 | +----------+-------+ 1 row in set (0.03 sec) mysql> select t,t*1.5, 510*1.5 from t1; +----------+-------+---------+ | t | t*1.5 | 510*1.5 | +----------+-------+---------+ | 00:05:10 | 765 | 765.0 | +----------+-------+---------+ 1 row in set (0.00 sec) But looks liek a documented "feature" (when different data types are mixed in the same expression they are treated/implicitly converted as double). So your request to change current intended behavior is a reasonable feature request.