diff options
author | unknown <monty@mysql.com> | 2003-12-12 22:26:58 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2003-12-12 22:26:58 +0200 |
commit | 759ea82ee1335543da1d484d76468b6686057e90 (patch) | |
tree | 771f288d33d415cb8e3d292f33e46fdb512d9dff /mysql-test | |
parent | 22c12eaeb296b55d6121531bea44a97fb5297f04 (diff) | |
download | mariadb-git-759ea82ee1335543da1d484d76468b6686057e90.tar.gz |
Fix autoincrement for signed columns (Bug #1366)
Fixed problem with char > 128 in QUOTE() function. (Bug #1868)
Disable creation of symlinks if my_disable_symlink is set
Fixed searching of TEXT with end space. (Bug #1651)
Fixed caching bug in multi-table-update where same table was used twice. (Bug #1711)
Fixed problem with UNIX_TIMESTAMP() for timestamps close to 0. (Bug #1998)
Fixed timestamp.test
include/my_base.h:
Add HA_END_SPACE_KEY to mark keys that has VARCHAR/TEXT fields.
myisam/mi_check.c:
Delete not used variable
myisam/mi_key.c:
Fix autoincrement for signed columns (Bug #1366). Patch by Holyfoot
myisam/mi_open.c:
Bug fix for future (doesn't affect current code)
myisam/mi_search.c:
Ignore end space for VARCHAR/TEXT columns
mysql-test/r/auto_increment.result:
Test auto_increment with signed numbers
mysql-test/r/binary.result:
Update results (old result was wrong)
mysql-test/r/func_str.result:
Added test of QUOTE()
mysql-test/r/func_time.result:
Add test of unix_timestamp()
mysql-test/r/have_met_timezone.require:
Fixed test
mysql-test/r/innodb.result:
Add test for InnoDB behaviour with TRUNCATE
mysql-test/r/multi_update.result:
Test of multi-update bug
mysql-test/r/symlink.result:
Test of ALTER TABLE and symlinks
mysql-test/r/timezone.result:
Test of from_unixtime()
mysql-test/r/truncate.result:
Test of truncate and auto_increment
mysql-test/r/type_blob.result:
Test of key search on TEXT/VARCHAR column with end space
mysql-test/t/auto_increment.test:
Test auto_increment with signed numbers
mysql-test/t/func_str.test:
Added test of QUOTE()
mysql-test/t/func_time.test:
Add test of unix_timestamp()
mysql-test/t/innodb.test:
Add test for InnoDB behaviour with TRUNCATE
mysql-test/t/multi_update.test:
Test of multi-update bug
mysql-test/t/symlink.test:
Test of ALTER TABLE and symlinks
mysql-test/t/timezone.test:
Test of from_unixtime()
mysql-test/t/truncate.test:
Test of truncate and auto_increment
mysql-test/t/type_blob.test:
Test of key search on TEXT/VARCHAR column with end space
mysys/my_symlink2.c:
Disable creation of symlinks if my_disable_symlink is set
sql/field.h:
Indentation cleanup
sql/ha_innodb.cc:
HA_PART_KEY -> HA_PART_KEY_SEG
sql/item_strfunc.cc:
Fixed problem with char > 128 in QUOTE() function. (Bug #1868)
sql/mysql_priv.h:
Make check_dup() external
sql/opt_range.cc:
Fixed searching of TEXT with end space. (Bug #1651)
sql/records.cc:
Fixed caching bug in multi-table-update where same table was used twice.
(Bug #1711)
sql/sql_acl.cc:
Reset ip and ip_mask if hostname is NULL
sql/sql_parse.cc:
Make check_dup() global
sql/sql_select.cc:
Fixed searching of TEXT with end space. (Bug #1651)
sql/sql_table.cc:
Fixed searching of TEXT with end space. (Bug #1651)
sql/sql_update.cc:
Fixed caching bug in multi-table-update where same table was used twice.
(Bug #1711)
sql/table.cc:
Fixed searching of TEXT with end space. (Bug #1651)
sql/table.h:
Fixed caching bug in multi-table-update where same table was used twice.
(Bug #1711)
sql/time.cc:
Fixed problem with UNIX_TIMESTAMP() for timestamps close to 0. (Bug #1998)
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/auto_increment.result | 26 | ||||
-rw-r--r-- | mysql-test/r/binary.result | 1 | ||||
-rw-r--r-- | mysql-test/r/func_str.result | 3 | ||||
-rw-r--r-- | mysql-test/r/func_time.result | 9 | ||||
-rw-r--r-- | mysql-test/r/have_met_timezone.require (renamed from mysql-test/r/have_mest_timezone.require) | 2 | ||||
-rw-r--r-- | mysql-test/r/innodb.result | 10 | ||||
-rw-r--r-- | mysql-test/r/multi_update.result | 10 | ||||
-rw-r--r-- | mysql-test/r/symlink.result | 20 | ||||
-rw-r--r-- | mysql-test/r/timezone.result | 6 | ||||
-rw-r--r-- | mysql-test/r/truncate.result | 9 | ||||
-rw-r--r-- | mysql-test/r/type_blob.result | 146 | ||||
-rw-r--r-- | mysql-test/t/auto_increment.test | 19 | ||||
-rw-r--r-- | mysql-test/t/func_str.test | 1 | ||||
-rw-r--r-- | mysql-test/t/func_time.test | 7 | ||||
-rw-r--r-- | mysql-test/t/innodb.test | 12 | ||||
-rw-r--r-- | mysql-test/t/multi_update.test | 10 | ||||
-rw-r--r-- | mysql-test/t/symlink.test | 22 | ||||
-rw-r--r-- | mysql-test/t/timezone.test | 10 | ||||
-rw-r--r-- | mysql-test/t/truncate.test | 12 | ||||
-rw-r--r-- | mysql-test/t/type_blob.test | 49 |
20 files changed, 381 insertions, 3 deletions
diff --git a/mysql-test/r/auto_increment.result b/mysql-test/r/auto_increment.result index e79e6aab56b..cbd2d48b38d 100644 --- a/mysql-test/r/auto_increment.result +++ b/mysql-test/r/auto_increment.result @@ -105,3 +105,29 @@ Table Op Msg_type Msg_text test.t1 check warning Found row where the auto_increment column has the value 0 test.t1 check status OK drop table t1; +create table t1 (a int not null auto_increment primary key); +insert into t1 values (NULL); +insert into t1 values (-1); +select last_insert_id(); +last_insert_id() +1 +insert into t1 values (NULL); +select * from t1; +a +-1 +1 +2 +drop table t1; +create table t1 (a int not null auto_increment primary key) /*!41002 type=heap */; +insert into t1 values (NULL); +insert into t1 values (-1); +select last_insert_id(); +last_insert_id() +1 +insert into t1 values (NULL); +select * from t1; +a +-1 +1 +2 +drop table t1; diff --git a/mysql-test/r/binary.result b/mysql-test/r/binary.result index 4d5eb62cc71..2de8b01bc3a 100644 --- a/mysql-test/r/binary.result +++ b/mysql-test/r/binary.result @@ -65,6 +65,7 @@ a b alter table t1 modify b tinytext not null, drop key b, add key (b(100)); select * from t1 where b="hello "; a b +hello hello select * from t1 ignore index (b) where b="hello "; a b hello hello diff --git a/mysql-test/r/func_str.result b/mysql-test/r/func_str.result index dcb788f520f..35a5ba70e86 100644 --- a/mysql-test/r/func_str.result +++ b/mysql-test/r/func_str.result @@ -164,6 +164,9 @@ NULL '\0\Z' select length(quote(concat(char(0),"test"))); length(quote(concat(char(0),"test"))) 8 +select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); +hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))) +27E0E3E6E7E8EAEB27 select reverse(""); reverse("") diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result index 61aa4306c61..4715227425e 100644 --- a/mysql-test/r/func_time.result +++ b/mysql-test/r/func_time.result @@ -431,3 +431,12 @@ select * from t1, t3 where t1.start between t3.ctime1 and t3.ctime2; start ctime1 ctime2 2002-11-04 00:00:00 2002-10-29 16:51:06 2002-11-05 16:47:31 drop table t1,t2,t3; +select @a:=FROM_UNIXTIME(1); +@a:=FROM_UNIXTIME(1) +1970-01-01 03:00:01 +select unix_timestamp(@a); +unix_timestamp(@a) +1 +select unix_timestamp('1969-12-01 19:00:01'); +unix_timestamp('1969-12-01 19:00:01') +0 diff --git a/mysql-test/r/have_mest_timezone.require b/mysql-test/r/have_met_timezone.require index 2a219f39b7e..4ab263e2c0d 100644 --- a/mysql-test/r/have_mest_timezone.require +++ b/mysql-test/r/have_met_timezone.require @@ -1,2 +1,2 @@ Variable_name Value -timezone MEST +timezone MET diff --git a/mysql-test/r/innodb.result b/mysql-test/r/innodb.result index 3938fc80f10..ce5491a718f 100644 --- a/mysql-test/r/innodb.result +++ b/mysql-test/r/innodb.result @@ -1233,3 +1233,13 @@ create table t2 (c char(8) not null, b char(8) not null, a char(8) not null, pri insert into t2 select * from t1; delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; +SET AUTOCOMMIT=1; +create table t1 (a integer auto_increment primary key) type=innodb; +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +a +3 +4 +drop table t1; diff --git a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result index 350cea420b6..5486d9ec5f0 100644 --- a/mysql-test/r/multi_update.result +++ b/mysql-test/r/multi_update.result @@ -327,3 +327,13 @@ select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and a b a b 2 2 NULL NULL drop table t1,t2; +create table t1 (a int not null auto_increment primary key, b int not null); +insert into t1 (b) values (1),(2),(3),(4); +update t1, t1 as t2 set t1.b=t2.b+1 where t1.a=t2.a; +select * from t1; +a b +1 2 +2 3 +3 4 +4 5 +drop table t1; diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result index 2deecae7243..d07a8613883 100644 --- a/mysql-test/r/symlink.result +++ b/mysql-test/r/symlink.result @@ -64,3 +64,23 @@ t9 CREATE TABLE `t9` ( PRIMARY KEY (`a`) ) TYPE=MyISAM DATA DIRECTORY='TEST_DIR/var/tmp/' INDEX DIRECTORY='TEST_DIR/var/run/' drop database mysqltest; +create table t1 (a int not null) type=myisam; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0' +) TYPE=MyISAM +alter table t1 add b int; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + `b` int(11) default NULL +) TYPE=MyISAM +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` int(11) NOT NULL default '0', + `b` int(11) default NULL +) TYPE=MyISAM +drop table t1; diff --git a/mysql-test/r/timezone.result b/mysql-test/r/timezone.result index b82b39da262..de75e649ee4 100644 --- a/mysql-test/r/timezone.result +++ b/mysql-test/r/timezone.result @@ -23,3 +23,9 @@ ts from_unixtime(ts) 1048989599 2003-03-30 03:59:59 1048989601 2003-03-30 04:00:01 DROP TABLE t1; +select @a:=FROM_UNIXTIME(1); +@a:=FROM_UNIXTIME(1) +1970-01-01 01:00:01 +select unix_timestamp(@a); +unix_timestamp(@a) +1 diff --git a/mysql-test/r/truncate.result b/mysql-test/r/truncate.result index ad390c9fa92..1b387214292 100644 --- a/mysql-test/r/truncate.result +++ b/mysql-test/r/truncate.result @@ -23,3 +23,12 @@ n drop table t1; truncate non_existing_table; Table 'test.non_existing_table' doesn't exist +create table t1 (a integer auto_increment primary key); +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +a +1 +2 +drop table t1; diff --git a/mysql-test/r/type_blob.result b/mysql-test/r/type_blob.result index d7c41743bf3..0bb9146fafc 100644 --- a/mysql-test/r/type_blob.result +++ b/mysql-test/r/type_blob.result @@ -455,3 +455,149 @@ select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; if(imagem is null, "ERROR", "OK") length(imagem) OK 581 drop table t1; +create table t1 (id integer primary key auto_increment, txt text not null, unique index txt_index (txt (20))); +insert into t1 (txt) values ('Chevy'), ('Chevy '); +select * from t1 where txt='Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy ' or txt='Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where id='1' or id='2'; +id txt +1 Chevy +2 Chevy +insert into t1 (txt) values('Ford'); +select * from t1 where txt='Chevy' or txt='Chevy ' or txt='Ford'; +id txt +1 Chevy +2 Chevy +3 Ford +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy ' or txt=' Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy ','Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt < 'Chevy '; +id txt +select * from t1 where txt <= 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt > 'Chevy'; +id txt +3 Ford +select * from t1 where txt >= 'Chevy'; +id txt +1 Chevy +2 Chevy +3 Ford +drop table t1; +create table t1 (id integer primary key auto_increment, txt text, unique index txt_index (txt (20))); +insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL); +select * from t1 where txt='Chevy' or txt is NULL; +id txt +3 NULL +1 Chevy +2 Chevy +select * from t1 where txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy ' or txt='Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where id='1' or id='2'; +id txt +1 Chevy +2 Chevy +insert into t1 (txt) values('Ford'); +select * from t1 where txt='Chevy' or txt='Chevy ' or txt='Ford'; +id txt +1 Chevy +2 Chevy +4 Ford +select * from t1 where txt='Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt='Chevy' or txt='Chevy ' or txt=' Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy ','Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt in ('Chevy'); +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy' or txt='Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt between 'Chevy' and 'Chevy '; +id txt +1 Chevy +2 Chevy +select * from t1 where txt < 'Chevy '; +id txt +select * from t1 where txt < 'Chevy ' or txt is NULL; +id txt +3 NULL +select * from t1 where txt <= 'Chevy'; +id txt +1 Chevy +2 Chevy +select * from t1 where txt > 'Chevy'; +id txt +4 Ford +select * from t1 where txt >= 'Chevy'; +id txt +1 Chevy +2 Chevy +4 Ford +drop table t1; diff --git a/mysql-test/t/auto_increment.test b/mysql-test/t/auto_increment.test index 5fba4bb9234..8c614131684 100644 --- a/mysql-test/t/auto_increment.test +++ b/mysql-test/t/auto_increment.test @@ -70,3 +70,22 @@ select * from t1; check table t1; drop table t1; +# +# Test negative values (Bug #1366) +# + +create table t1 (a int not null auto_increment primary key); +insert into t1 values (NULL); +insert into t1 values (-1); +select last_insert_id(); +insert into t1 values (NULL); +select * from t1; +drop table t1; + +create table t1 (a int not null auto_increment primary key) /*!41002 type=heap */; +insert into t1 values (NULL); +insert into t1 values (-1); +select last_insert_id(); +insert into t1 values (NULL); +select * from t1; +drop table t1; diff --git a/mysql-test/t/func_str.test b/mysql-test/t/func_str.test index b07b0b635c1..33d89b3ca37 100644 --- a/mysql-test/t/func_str.test +++ b/mysql-test/t/func_str.test @@ -67,6 +67,7 @@ select quote('\'\"\\test'); select quote(concat('abc\'', '\\cba')); select quote(1/0), quote('\0\Z'); select length(quote(concat(char(0),"test"))); +select hex(quote(concat(char(224),char(227),char(230),char(231),char(232),char(234),char(235)))); # # Wrong usage of functions diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test index deb3358da00..99824ab121d 100644 --- a/mysql-test/t/func_time.test +++ b/mysql-test/t/func_time.test @@ -201,3 +201,10 @@ select * from t1, t2 where t1.start between t2.ctime1 and t2.ctime2; select * from t1, t2 where t1.start >= t2.ctime1 and t1.start <= t2.ctime2; select * from t1, t3 where t1.start between t3.ctime1 and t3.ctime2; drop table t1,t2,t3; + +# +# Test unix timestamp +# +select @a:=FROM_UNIXTIME(1); +select unix_timestamp(@a); +select unix_timestamp('1969-12-01 19:00:01'); diff --git a/mysql-test/t/innodb.test b/mysql-test/t/innodb.test index ea9c5e0cf55..7cc509caf74 100644 --- a/mysql-test/t/innodb.test +++ b/mysql-test/t/innodb.test @@ -857,3 +857,15 @@ insert into t2 select * from t1; delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b; drop table t1,t2; + +# +# test autoincrement with TRUNCATE +# + +SET AUTOCOMMIT=1; +create table t1 (a integer auto_increment primary key) type=innodb; +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +drop table t1; diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test index 7aa4e74cec0..df1174ce9af 100644 --- a/mysql-test/t/multi_update.test +++ b/mysql-test/t/multi_update.test @@ -267,3 +267,13 @@ insert into t2 values (1,1), (3,1); update t1 left join t2 on t1.a=t2.a set t1.b=2, t2.b=2 where t1.b=1 and t2.b=1 or t2.a is NULL; select t1.a, t1.b,t2.a, t2.b from t1 left join t2 on t1.a=t2.a where t1.b=1 and t2.b=1 or t2.a is NULL; drop table t1,t2; + +# +# Test reuse of same table +# + +create table t1 (a int not null auto_increment primary key, b int not null); +insert into t1 (b) values (1),(2),(3),(4); +update t1, t1 as t2 set t1.b=t2.b+1 where t1.a=t2.a; +select * from t1; +drop table t1; diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test index 5e1fe313a7e..7a42a60054e 100644 --- a/mysql-test/t/symlink.test +++ b/mysql-test/t/symlink.test @@ -90,3 +90,25 @@ select count(*) from mysqltest.t9; --replace_result $MYSQL_TEST_DIR TEST_DIR show create table mysqltest.t9; drop database mysqltest; + +# +# Test changing data dir (Bug #1662) +# + +create table t1 (a int not null) type=myisam; +disable_query_log; +eval alter table t1 data directory="$MYSQL_TEST_DIR/var/tmp"; +enable_query_log; +--replace_result $MYSQL_TEST_DIR TEST_DIR +show create table t1; +alter table t1 add b int; +disable_query_log; +eval alter table t1 data directory="$MYSQL_TEST_DIR/var/log"; +enable_query_log; +--replace_result $MYSQL_TEST_DIR TEST_DIR +show create table t1; +disable_query_log; +eval alter table t1 index directory="$MYSQL_TEST_DIR/var/log"; +enable_query_log; +show create table t1; +drop table t1; diff --git a/mysql-test/t/timezone.test b/mysql-test/t/timezone.test index 14facc0374a..d9603c51766 100644 --- a/mysql-test/t/timezone.test +++ b/mysql-test/t/timezone.test @@ -1,7 +1,7 @@ # -# Test of timezone handling. This script must be run with TZ=MEST +# Test of timezone handling. This script must be run with TZ=MET --- require r/have_mest_timezone.require +-- require r/have_met_timezone.require disable_query_log; show variables like "timezone"; enable_query_log; @@ -26,3 +26,9 @@ INSERT INTO t1 (ts) VALUES (Unix_timestamp('2003-03-30 04:00:01')); SELECT ts,from_unixtime(ts) FROM t1; DROP TABLE t1; + +# +# Test unix timestamp +# +select @a:=FROM_UNIXTIME(1); +select unix_timestamp(@a); diff --git a/mysql-test/t/truncate.test b/mysql-test/t/truncate.test index eeb79f497fa..3acab9f56de 100644 --- a/mysql-test/t/truncate.test +++ b/mysql-test/t/truncate.test @@ -21,3 +21,15 @@ select * from t1; drop table t1; --error 1146 truncate non_existing_table; + +# +# test autoincrement with TRUNCATE +# + +create table t1 (a integer auto_increment primary key); +insert into t1 (a) values (NULL),(NULL); +truncate table t1; +insert into t1 (a) values (NULL),(NULL); +SELECT * from t1; +drop table t1; + diff --git a/mysql-test/t/type_blob.test b/mysql-test/t/type_blob.test index 4132b1f48a4..cf5c0d6e581 100644 --- a/mysql-test/t/type_blob.test +++ b/mysql-test/t/type_blob.test @@ -263,3 +263,52 @@ insert into t1 (id) values (1); update t1 set imagem=load_file('../../std_data/words.dat') where id=1; select if(imagem is null, "ERROR", "OK"),length(imagem) from t1 where id = 1; drop table t1; + +# +# Test blob's with end space (Bug #1651) +# + +create table t1 (id integer primary key auto_increment, txt text not null, unique index txt_index (txt (20))); +insert into t1 (txt) values ('Chevy'), ('Chevy '); +select * from t1 where txt='Chevy'; +select * from t1 where txt='Chevy '; +select * from t1 where txt='Chevy ' or txt='Chevy'; +select * from t1 where txt='Chevy' or txt='Chevy '; +select * from t1 where id='1' or id='2'; +insert into t1 (txt) values('Ford'); +select * from t1 where txt='Chevy' or txt='Chevy ' or txt='Ford'; +select * from t1 where txt='Chevy' or txt='Chevy '; +select * from t1 where txt='Chevy' or txt='Chevy ' or txt=' Chevy'; +select * from t1 where txt in ('Chevy ','Chevy'); +select * from t1 where txt in ('Chevy'); +select * from t1 where txt between 'Chevy' and 'Chevy'; +select * from t1 where txt between 'Chevy' and 'Chevy' or txt='Chevy '; +select * from t1 where txt between 'Chevy' and 'Chevy '; +select * from t1 where txt < 'Chevy '; +select * from t1 where txt <= 'Chevy'; +select * from t1 where txt > 'Chevy'; +select * from t1 where txt >= 'Chevy'; +drop table t1; + +create table t1 (id integer primary key auto_increment, txt text, unique index txt_index (txt (20))); +insert into t1 (txt) values ('Chevy'), ('Chevy '), (NULL); +select * from t1 where txt='Chevy' or txt is NULL; +select * from t1 where txt='Chevy '; +select * from t1 where txt='Chevy ' or txt='Chevy'; +select * from t1 where txt='Chevy' or txt='Chevy '; +select * from t1 where id='1' or id='2'; +insert into t1 (txt) values('Ford'); +select * from t1 where txt='Chevy' or txt='Chevy ' or txt='Ford'; +select * from t1 where txt='Chevy' or txt='Chevy '; +select * from t1 where txt='Chevy' or txt='Chevy ' or txt=' Chevy'; +select * from t1 where txt in ('Chevy ','Chevy'); +select * from t1 where txt in ('Chevy'); +select * from t1 where txt between 'Chevy' and 'Chevy'; +select * from t1 where txt between 'Chevy' and 'Chevy' or txt='Chevy '; +select * from t1 where txt between 'Chevy' and 'Chevy '; +select * from t1 where txt < 'Chevy '; +select * from t1 where txt < 'Chevy ' or txt is NULL; +select * from t1 where txt <= 'Chevy'; +select * from t1 where txt > 'Chevy'; +select * from t1 where txt >= 'Chevy'; +drop table t1; |