Skip to content

Error executing query with varchar column #5111

@Novemser

Description

@Novemser
  1. What did you do?
    mysql:
mysql> select count(1) from full_data_type_table  where tp_varchar < 1;
ERROR 1105 (HY000): strconv.ParseFloat: parsing "1e649": value out of range

mysql> show create table full_data_type_table;
| full_data_type_table | CREATE TABLE `full_data_type_table` (
  `id_dt` int(11) NOT NULL,
  `tp_varchar` varchar(45) DEFAULT NULL,
  `tp_datetime` datetime DEFAULT CURRENT_TIMESTAMP,
  `tp_blob` blob DEFAULT NULL,
  `tp_binary` binary(2) DEFAULT NULL,
  `tp_date` date DEFAULT NULL,
  `tp_timestamp` timestamp DEFAULT CURRENT_TIMESTAMP,
  `tp_year` year DEFAULT NULL,
  `tp_bigint` bigint(20) DEFAULT NULL,
  `tp_decimal` decimal DEFAULT NULL,
  `tp_double` double DEFAULT NULL,
  `tp_float` float DEFAULT NULL,
  `tp_int` int(11) DEFAULT NULL,
  `tp_mediumint` mediumint(9) DEFAULT NULL,
  `tp_real` double DEFAULT NULL,
  `tp_smallint` smallint(6) DEFAULT NULL,
  `tp_tinyint` tinyint(4) DEFAULT NULL,
  `tp_char` char(10) DEFAULT NULL,
  `tp_nvarchar` varchar(40) DEFAULT NULL,
  `tp_longtext` longtext DEFAULT NULL,
  `tp_mediumtext` mediumtext DEFAULT NULL,
  `tp_text` text DEFAULT NULL,
  `tp_tinytext` tinytext DEFAULT NULL,
  `tp_bit` bit(1) DEFAULT NULL,
  `tp_time` time DEFAULT NULL,
  `tp_enum` enum('1','2','3','4') DEFAULT NULL,
  `tp_set` set('a','b','c','d') DEFAULT NULL,
  PRIMARY KEY (`id_dt`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin |
  1. What did you expect to see?
    Something like:
+----------+
| count(1) |
+----------+
|        0 |
+----------+
  1. What did you see instead?
ERROR 1105 (HY000): strconv.ParseFloat: parsing "1e649": value out of range
  1. What version of TiDB are you using (tidb-server -V)?
Release Version: v1.1.0-alpha-89-g7fd147b
Git Commit Hash: 7fd147bc57f3025c734a7b59edd06530419a604c
Git Commit Branch: master
UTC Build Time:  2017-11-14 03:49:43

Metadata

Metadata

Assignees

Labels

type/bugThe issue is confirmed as a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions