summaryrefslogtreecommitdiff
path: root/mysql-test/t/select.test
diff options
context:
space:
mode:
authorram@gw.mysql.r18.ru <>2004-01-22 18:05:47 +0400
committerram@gw.mysql.r18.ru <>2004-01-22 18:05:47 +0400
commite515d7018f05b0f007f8d672ec58e87b6433e569 (patch)
treee54fe0db01fe767dff386d9f648bc7f6557511f8 /mysql-test/t/select.test
parenta0bbfbf4a35cc3b11f98adf294fedb70f26aa741 (diff)
downloadmariadb-git-e515d7018f05b0f007f8d672ec58e87b6433e569.tar.gz
a proper fix for the bug #2298 Trailing whitespace inconsistently handled in WHERE clause.
<monty> ramil, in MySQL/MyISAM we should only strip end space, not 'space-like' characters. <monty> This is according to SQL; When doing a comparision end space and only end space are ignored.
Diffstat (limited to 'mysql-test/t/select.test')
-rw-r--r--mysql-test/t/select.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/select.test b/mysql-test/t/select.test
index 3e23fa1a3f2..7cb157f194e 100644
--- a/mysql-test/t/select.test
+++ b/mysql-test/t/select.test
@@ -1858,3 +1858,19 @@ left join t4 on id3 = id4 where id2 = 1 or id4 = 1;
drop table t1,t2,t3,t4;
+#
+# Bug #2298
+#
+
+create table t1(s varchar(10) not null);
+create table t2(s varchar(10) not null primary key);
+create table t3(s varchar(10) not null primary key);
+insert into t1 values ('one\t'), ('two\t');
+insert into t2 values ('one\r'), ('two\t');
+insert into t3 values ('one '), ('two\t');
+select * from t1 where s = 'one';
+select * from t2 where s = 'one';
+select * from t3 where s = 'one';
+select * from t1,t2 where t1.s = t2.s;
+select * from t2,t3 where t2.s = t3.s;
+drop table t1, t2, t3;