Bug #17334 IF unworking when exist more than once
Submitted: 12 Feb 2006 23:30 Modified: 15 Apr 2006 13:32
Reporter: Maciej Wojciechowski Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1.4 OS:Windows (Windows XP)
Assigned to: CPU Architecture:Any

[12 Feb 2006 23:30] Maciej Wojciechowski
Description:
At MySQLQueryBrowser I'd like use as part of query:

CAST(CONCAT(IF(UsbClass, UsbClass, '?'), IF(Manufacturer, ', '+Manufacturer, ''), IF(Name, ', '+Name, '')) AS CHAR(2048)

to receive correct answer string but.... if IF exist once on any of this positions it's work ok, if exist more times doesn't work correctly

How to repeat:
QUERY:

SELECT Id, InfoLabel, a8.HostId, HostAddress, 8 AS DataType, CAST(CONCAT(IF(UsbClass, UsbClass, '?'), IF(Manufacturer, ', '+Manufacturer, ''), IF(Name, ', '+Name, '')) AS CHAR(2048) CHARACTER SET CP1250) AS Info
FROM currentusb a8
LEFT OUTER JOIN nethosts ON nethosts.HostId=a8.HostId

DDL:

CREATE TABLE `currentusb` (
  `Id` varchar(40) collate cp1250_polish_ci NOT NULL,
  `HostId` varchar(40) collate cp1250_polish_ci default NULL,
  `Appearence` int(11) default NULL,
  `UsbClass` varchar(128) collate cp1250_polish_ci default NULL,
  `Manufacturer` varchar(128) collate cp1250_polish_ci default NULL,
  `Name` varchar(128) collate cp1250_polish_ci default NULL,
  `SerialNumber` varchar(128) collate cp1250_polish_ci default NULL,
  `PortNumber` int(11) default NULL,
  `DeviceAddress` int(11) default NULL,
  `MaxPower` int(11) default NULL,
  `MajorVersion` int(11) default NULL,
  `MinorVersion` int(11) default NULL,
  `ProductId` int(11) default NULL,
  `VendorId` int(11) default NULL,
  `InfoLabel` int(11) default NULL,
  PRIMARY KEY  (`Id`),
  KEY `Host` (`HostId`,`Appearence`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1250 COLLATE=cp1250_polish_ci;

CREATE TABLE `nethosts` (
  `NetId` varchar(40) character set cp1250 collate cp1250_polish_ci NOT NULL,
  `HostId` varchar(40) character set cp1250 collate cp1250_polish_ci NOT NULL,
  `HostAddress` varchar(15) NOT NULL,
  `AuditorClient` int(11) default NULL,
  `LastUpdate` datetime default NULL,
  `UserName1` varchar(100) default NULL,
  `UserName2` varchar(100) default NULL,
  `UserInteger` int(11) default NULL,
  `UserFloat1` float(9,0) default NULL,
  `UserFloat2` float(9,3) default NULL,
  PRIMARY KEY  (`NetId`,`HostId`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1250;
[14 Feb 2006 10:52] Valeriy Kravchuk
Thank you for a problem report. Please, add some sample data to the tables, execute your query in mysql client and just copy and paste the results. Explain, why do you think these results is a bug.

Are you really using MySQL server 5.1.4?
[15 Mar 2006 0:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[15 Mar 2006 1:57] Maciej Wojciechowski
Realu 5.1.4 because of needs for polish national characters (cp1250_polish)
There is few more bugs with polish national characters comparing, but I'm too worry now to send reports. Maybe I do it in short time
[15 Mar 2006 2:05] Maciej Wojciechowski
Screenshoot demonstrating a bug

Attachment: mysqlbug.JPG (image/pjpeg, text), 165.00 KiB.

[15 Mar 2006 13:32] Valeriy Kravchuk
Please, inform about other problems with polish characters that you can show with a repeatable test case. Just reopen this report. And, please, try to check on the newer version, 5.1.7.
[15 Apr 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".