List:General Discussion« Previous MessageNext Message »
From:wang shuming Date:March 4 2010 8:17am
Subject:Re: 5.1.44 community version select ordno>=' ' error (2)
View as plain text  
Oh,
   If any char fields add to index key ,then the >=' ' gets wrong .

  ordno, qty ,mem
               1
               3
               5
    aaa    18
    bbbbb 20

  1. CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`),
  KEY `key03` (`ordno`))

select * from t1 where ordno>='  '
 gets wrong  result 2 rows

2CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`))

select * from t1 where ordno>='  '
 gets  OK 5 rows

3.CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`),
  KEY `key03` (`mem`))

select * from t1 where mem>='   '
0 rows  wrong

4.CREATE TABLE `t1` (
  `mid` int(11) NOT NULL,
  `qty` decimal(12,2) NOT NULL DEFAULT '0.00',
  `ordno` char(8) NOT NULL DEFAULT '',
  `mem` char(1) DEFAULT '',
  PRIMARY KEY (`mid`))

select * from t1 where mem>='   '
 5 rows OK

Regards!

Shuming wang

Thread
5.1.44 community version select ordno>=' ' error (2)wang shuming4 Mar
  • Re: 5.1.44 community version select ordno>=' ' error (2)Dan Nelson4 Mar
Re: 5.1.44 community version select ordno>=' ' error (2)wang shuming4 Mar
  • Re: 5.1.44 community version select ordno>=' ' error (2)Peter Brawley4 Mar