List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:March 2 2010 5:54am
Subject:Re: 5.1.42 community version select ordno>=' ' error (2)
View as plain text  
In the last episode (Mar 02), wang shuming said:
> Hi,
> 
>   Any table with a ordno char(n)  not null  field
> 
> for example
> 
> ordno     qty
>              35
>                0
>                1
> 'abc'         3
> '000'     100
> 
> select * from table1 where ordno>'   ' or ordno='   '
> > 5 rows
> 
>  select * from table1 where ordno>='   '
>  > 2 rows

I cannot reproduce this, with either mysql 5.1.35 or 5.5.1-m2:

mysql> create table table1 (ordno char(3) not null);
Query OK, 0 rows affected (0.00 sec)

mysql> insert into table1 values ('   '),('   '),('   '),('000'),('abc');
Query OK, 5 rows affected (0.00 sec)
Records: 5  Duplicates: 0  Warnings: 0

mysql> select * from table1 where ordno>='   ';
+-------+
| ordno |
+-------+
|       |
|       |
|       |
| 000   |
| abc   |
+-------+
5 rows in set (0.00 sec)

mysql> select * from table1 where ordno>'   ' or ordno='   ';
+-------+
| ordno |
+-------+
|       |
|       |
|       |
| 000   |
| abc   |
+-------+
5 rows in set (0.00 sec)

mysql>

-- 
	Dan Nelson
	dnelson@stripped
Thread
5.1.42 community version select ordno>=' ' error (2)wang shuming2 Mar
  • Re: 5.1.42 community version select ordno>=' ' error (2)Dan Nelson2 Mar