There seems to be a matching bug in MySQL.

Why will it match if I do a > of a number smaller that is in the 
custom_price column, or if I do a strcmp(custom_price, '355.62'), but 
will NOT match if I do "WHERE custom_price = '355.62'" OR if I try 
"WHERE custom_price = 355.62"? This happens in both 3.23.28-gamma and 
the latest 3.23.33. Tested on redhat 6.1,6.2 and 7.0.

Here is an outline of the problem:


mysql> desc service;
+------------------+-------------+------+-----+---------------------+----------------+
| Field            | Type        | Null | Key | Default             | 
Extra          |
+------------------+-------------+------+-----+---------------------+----------------+
| id               | int(10)     |      | PRI | NULL                | 
auto_increment |
| accountid        | int(10)     |      | MUL | 0                   | 
              |
| servicetypeid    | int(10)     |      | MUL | 0                   | 
              |
| status           | varchar(32) |      |     | Pending             | 
              |
| date             | date        |      |     | 0000-00-00          | 
              |
| statuschangedate | datetime    |      |     | 0000-00-00 00:00:00 | 
              |
| addedby          | int(10)     |      |     | 0                   | 
              |
| updatedby        | int(10)     |      |     | 0                   | 
              |
| referral         | varchar(50) |      |     |                     | 
              |
| serverid         | int(10)     |      |     | 0                   | 
              |
| chargedate       | date        |      |     | 0000-00-00          | 
              |
| chargeinterval   | varchar(5)  |      |     |                     | 
              |
| quantity         | float(10,1) |      |     | 0.0                 | 
              |
| chargedsetup     | int(1)      |      |     | 0                   | 
              |
| discountid       | int(10)     |      |     | 0                   | 
              |
| custom_price     | float(10,2) |      |     | -1.00               | 
              |
+------------------+-------------+------+-----+---------------------+----------------+
16 rows in set (0.00 sec)


(not work)
mysql> select custom_price from service where accountid = 2625 and 
custom_price = '355.62';
Empty set (0.01 sec)

mysql> select custom_price from service where accountid = 2625 and 
custom_price = 355.62;
Empty set (0.00 sec)


(work)
mysql> select custom_price from service where accountid = 2625 and 
custom_price > '355.61';
+--------------+
| custom_price |
+--------------+
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
+--------------+
9 rows in set (0.01 sec)


mysql> select custom_price from service where accountid = 2625 and 
strcmp(custom_price,'355.62') = 0;
+--------------+
| custom_price |
+--------------+
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
|       355.62 |
+--------------+
9 rows in set (0.00 sec)


-- 
Mike Machado
[EMAIL PROTECTED]
InnerCite Inc.
Engineering Director / CTO


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to