2001-09-27 23:05:54 -06:00
|
|
|
drop table if exists t1;
|
|
|
|
CREATE TABLE t1 (id CHAR(12) not null, PRIMARY KEY (id));
|
|
|
|
insert into t1 values ('000000000001'),('000000000002');
|
|
|
|
explain select * from t1 where id=000000000001;
|
2002-09-26 23:08:22 +03:00
|
|
|
id select_type table type possible_keys key key_len ref rows Extra
|
2002-11-21 15:56:48 +02:00
|
|
|
1 SIMPLE t1 index PRIMARY PRIMARY 12 NULL 2 Using where; Using index
|
2001-09-27 23:05:54 -06:00
|
|
|
select * from t1 where id=000000000001;
|
2000-12-28 03:56:38 +02:00
|
|
|
id
|
|
|
|
000000000001
|
2001-09-27 23:05:54 -06:00
|
|
|
delete from t1 where id=000000000002;
|
|
|
|
select * from t1;
|
2000-12-28 03:56:38 +02:00
|
|
|
id
|
|
|
|
000000000001
|
2001-09-27 23:05:54 -06:00
|
|
|
drop table t1;
|
2004-03-26 18:14:39 +04:00
|
|
|
SELECT 'a' = 'a ';
|
|
|
|
'a' = 'a '
|
|
|
|
1
|
|
|
|
SELECT 'a\0' < 'a';
|
|
|
|
'a\0' < 'a'
|
|
|
|
1
|
|
|
|
SELECT 'a\0' < 'a ';
|
|
|
|
'a\0' < 'a '
|
|
|
|
1
|
|
|
|
SELECT 'a\t' < 'a';
|
|
|
|
'a\t' < 'a'
|
|
|
|
1
|
|
|
|
SELECT 'a\t' < 'a ';
|
|
|
|
'a\t' < 'a '
|
|
|
|
1
|
|
|
|
CREATE TABLE t1 (a char(10) not null);
|
|
|
|
INSERT INTO t1 VALUES ('a'),('a\0'),('a\t'),('a ');
|
|
|
|
SELECT hex(a),STRCMP(a,'a'), STRCMP(a,'a ') FROM t1;
|
|
|
|
hex(a) STRCMP(a,'a') STRCMP(a,'a ')
|
|
|
|
61 0 0
|
|
|
|
6100 -1 -1
|
|
|
|
6109 -1 -1
|
|
|
|
61 0 0
|
|
|
|
DROP TABLE t1;
|
2005-01-28 17:18:35 -08:00
|
|
|
SELECT CHAR(31) = '', '' = CHAR(31);
|
|
|
|
CHAR(31) = '' '' = CHAR(31)
|
|
|
|
0 0
|
2005-02-01 16:27:08 +02:00
|
|
|
SELECT CHAR(30) = '', '' = CHAR(30);
|
|
|
|
CHAR(30) = '' '' = CHAR(30)
|
|
|
|
0 0
|