Bug #21090 Problem with decimal number in Varchar
Submitted: 17 Jul 2006 5:14 Modified: 17 Jul 2006 10:41
Reporter: Mathieu Tremblay Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.22 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[17 Jul 2006 5:14] Mathieu Tremblay
Description:
When I select part of a Varchar using string manipulation function LEFT(), if the last character are decimal number are trunc and disapear in the select query.

Column "NoMembre" is Varchar(12) 

How to repeat:
SELECT NoMembre,
LEFT(NoMembre,LENGTH(NoMembre-1))AS NewNoMembre,
LENGTH(NoMembre) AS Length
FROM Appel
WHERE RIGHT(NoMembre,1)="-"

+-------------+-------------+--------+
| NoMembre    | NewNoMembre | Length |
+-------------+-------------+--------+
| 2790159-    | 2790159     |      8 |OK
| 0246416-    | 024641      |      8 |OK
| VIN505-     | VI          |      7 |Error
| 2808638-    | 2808638     |      8 |OK
| 0105345-    | 010534      |      8 |OK
| VIN508-     | VI          |      7 |Error
| 2380138-    | 2380138     |      8 |OK
| NA-         | NA          |      3 |OK
| NA-         | NA          |      3 |OK
| VIN508-     | VI          |      7 |Error
| 4045597-    | 4045597     |      8 |OK
| 20L05014-   | 20          |      9 |Error
| 2674999-    | 2674999     |      8 |OK
+-------------+-------------+--------+
[17 Jul 2006 5:16] Mathieu Tremblay
Sorry I made a mistake close the bug please.