← Back
Editing: type_varchar.result
drop table if exists t1, t2; create table t1 (v varchar(30), c char(3), e enum('abc','def','ghi'), t text); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `v` varchar(30) DEFAULT NULL, `c` char(3) DEFAULT NULL, `e` enum('abc','def','ghi') DEFAULT NULL, `t` text ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci insert into t1 values ('abc', 'de', 'ghi', 'jkl'); insert into t1 values ('abc ', 'de ', 'ghi', 'jkl '); insert into t1 values ('abc ', 'd ', 'ghi', 'jkl '); select length(v),length(c),length(e),length(t) from t1; length(v) length(c) length(e) length(t) 3 2 3 3 4 2 3 4 7 1 3 7 drop table t1; create table t1 (v varchar(20)) charset latin1; insert into t1 values('a '); select v='a' from t1; v='a' 1 select binary v='a' from t1; binary v='a' 0 Warnings: Warning 1287 'BINARY expr' is deprecated and will be removed in a future release. Please use CAST instead select binary v='a ' from t1; binary v='a ' 1 Warnings: Warning 1287 'BINARY expr' is deprecated and will be removed in a future release. Please use CAST instead insert into t1 values('a'); alter table t1 add primary key (v); ERROR 23000: Duplicate entry 'a ' for key 't1.PRIMARY' drop table t1; create table t1 (v varbinary(20)); insert into t1 values('a'); insert into t1 values('a '); alter table t1 add primary key (v); drop table t1; create table t1 (v varchar(254), index (v)) charset latin1; insert into t1 values ("This is a test "); insert into t1 values ("Some sample data"); insert into t1 values (" garbage "); insert into t1 values (" This is a test "); insert into t1 values ("This is a test"); insert into t1 values ("Hello world"); insert into t1 values ("Foo bar"); insert into t1 values ("This is a test"); insert into t1 values ("MySQL varchar test"); insert into t1 values ("test MySQL varchar"); insert into t1 values ("This is a long string to have some random length data included"); insert into t1 values ("Short string"); insert into t1 values ("VSS"); insert into t1 values ("Some samples"); insert into t1 values ("Bar foo"); insert into t1 values ("Bye"); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 257 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 1 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 257 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 2 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 257 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(255); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 258 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 1 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 258 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 2 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 258 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(256); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 259 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 1 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 259 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 2 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 259 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(257); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 260 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 1 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 260 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 2 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 260 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(258); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 261 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 1 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 261 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 2 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 261 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(259); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 262 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 3 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 262 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 4 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 262 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(258); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 261 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 3 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 261 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 4 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 261 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(257); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 260 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 3 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 260 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 4 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 260 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(256); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 259 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 3 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 259 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 4 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 259 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(255); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 258 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 3 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 258 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 4 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 258 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(254); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 257 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 3 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 257 const 3 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 4 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 257 NULL 3 100.00 Using where; Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` alter table t1 change v v varchar(253); alter table t1 change v v varchar(254), drop key v; alter table t1 change v v varchar(300), add key (v(10)); select * from t1 where v like 'This is a test' order by v; v This is a test This is a test select * from t1 where v='This is a test' order by v; v This is a test This is a test This is a test select * from t1 where v like 'S%' order by v; v Short string Some sample data Some samples explain select * from t1 where v like 'This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 13 NULL 4 100.00 Using where; Using filesort Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'This is a test') order by `test`.`t1`.`v` Helper line 5 for --skip_if_hypergraph diffing explain select * from t1 where v='This is a test' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL ref v v 13 const 4 100.00 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` = 'This is a test') order by `test`.`t1`.`v` Helper line 6 for --skip_if_hypergraph diffing explain select * from t1 where v like 'S%' order by v; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t1 NULL range v v 13 NULL 3 100.00 Using where; Using filesort Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`v` AS `v` from `test`.`t1` where (`test`.`t1`.`v` like 'S%') order by `test`.`t1`.`v` drop table t1; create table t1 (pkcol varchar(16), othercol varchar(16), primary key (pkcol)); insert into t1 values ('test', 'something'); update t1 set othercol='somethingelse' where pkcol='test'; select * from t1; pkcol othercol test somethingelse drop table t1; create table t1 (a int, b varchar(12)); insert into t1 values (1, 'A'), (22, NULL); create table t2 (a int); insert into t2 values (22), (22); select t1.a, t1.b, min(t1.b) from t1 inner join t2 ON t2.a = t1.a group by t1.b, t1.a; a b min(t1.b) 22 NULL NULL drop table t1, t2; create table t1 (f1 varchar(65500)) charset latin1; create index index1 on t1(f1(10)); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `f1` varchar(65500) DEFAULT NULL, KEY `index1` (`f1`(10)) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 alter table t1 modify f1 varchar(255); show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `f1` varchar(255) DEFAULT NULL, KEY `index1` (`f1`(10)) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 alter table t1 modify f1 tinytext; show create table t1; Table Create Table t1 CREATE TABLE `t1` ( `f1` tinytext, KEY `index1` (`f1`(10)) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 drop table t1; DROP TABLE IF EXISTS t1; CREATE TABLE t1(f1 VARCHAR(100) DEFAULT 'test'); INSERT INTO t1 VALUES(SUBSTR(f1, 1, 3)); DROP TABLE IF EXISTS t1; CREATE TABLE t1(f1 CHAR(100) DEFAULT 'test'); INSERT INTO t1 VALUES(SUBSTR(f1, 1, 3)); DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a CHAR(2)); INSERT INTO t1 VALUES (10), (50), (30), ('1a'), (60), ('t'); SELECT a,(a + 0) FROM t1 ORDER BY a; a (a + 0) 10 10 1a 1 30 30 50 50 60 60 t 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: '1a' Warning 1292 Truncated incorrect DOUBLE value: 't' SELECT a,(a DIV 2) FROM t1 ORDER BY a; a (a DIV 2) 10 5 1a 0 30 15 50 25 60 30 t 0 Warnings: Warning 1292 Truncated incorrect DECIMAL value: '1a' Warning 1366 Incorrect DECIMAL value: '0' for column '' at row -1 Warning 1292 Truncated incorrect DECIMAL value: 't' SELECT a,CAST(a AS SIGNED) FROM t1 ORDER BY a; a CAST(a AS SIGNED) 10 10 1a 1 30 30 50 50 60 60 t 0 Warnings: Warning 1292 Truncated incorrect INTEGER value: '1a' Warning 1292 Truncated incorrect INTEGER value: 't' DROP TABLE t1; CREATE TABLE t1 (a VARCHAR(16)); INSERT INTO t1 VALUES ('5'), ('s'), (''); SELECT 5 = a FROM t1; 5 = a 1 0 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 's' DROP TABLE t1; CREATE TABLE t1 (a CHAR(16)); INSERT INTO t1 VALUES ('5'), ('s'), (''); SELECT 5 = a FROM t1; 5 = a 1 0 0 Warnings: Warning 1292 Truncated incorrect DOUBLE value: 's' DROP TABLE t1;
Save File
Cancel