| Bug #4721 | ENCODE function worck incorrect | ||
|---|---|---|---|
| Submitted: | 23 Jul 2004 13:26 | Modified: | 23 Jul 2004 18:02 |
| Reporter: | Dmitriy Buldakov | Email Updates: | |
| Status: | Can't repeat | Impact on me: | |
| Category: | MySQL Server | Severity: | S1 (Critical) |
| Version: | 4.0.17 | OS: | FreeBSD (FreeBSD 5.1) |
| Assigned to: | Dean Ellis | CPU Architecture: | Any |
[23 Jul 2004 13:26]
Dmitriy Buldakov
[23 Jul 2004 18:02]
Dean Ellis
I cannot repeat a problem decoding those with 4.0.21:
mysql> SELECT DECODE(ENCODE( 'Billy Johnson', 'ETAdirect' ),'ETAdirect') AS `Johnson` , DECODE(ENCODE('Billy Johnso', 'ETAdirect' ),'ETAdirect') AS `Johnso`;
+---------------+--------------+
| Johnson | Johnso |
+---------------+--------------+
| Billy Johnson | Billy Johnso |
+---------------+--------------+
Does the above report a different result for you in a current release?
[26 Jul 2004 10:43]
Dmitriy Buldakov
Query like "SELECT DECODE(ENCODE( 'Billy Johnson', 'ETAdirect' ),'ETAdirect') AS
`Johnson` , DECODE(ENCODE('Billy Johnso', 'ETAdirect' ),'ETAdirect') AS
`Johnso`" works correctly in 4.0.17 too.
But i send you another one : "SELECT ENCODE( 'Billy Johnson', 'ETAdirect' ) AS
`Johnson` , ENCODE( 'Billy
Johnso', 'ETAdirect' ) AS `Johnso` , ENCODE( 'Billy Johnson', 'ETAdirect' ) =
ENCODE( 'Billy Johnso', 'ETAdirect' ) AS `Johnson_is_Johnson`". Please try it.
I think last char code of result ENCODE( 'Billy Johnson', 'ETAdirect' ) is '0' and last
char may be lost while comparing or storing operations.
[16 Sep 2004 19:24]
Dean Ellis
That query works against 4.0.21 also. Please try a current release.
