Bug #349 Subselect doesnt work
Submitted: 30 Apr 2003 6:57 Modified: 10 Nov 2003 2:09
Reporter: Sven Dawitz Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:4.1.0 OS:Linux (Linux (Suse 8.1))
Assigned to: Assigned Account CPU Architecture:Any

[30 Apr 2003 6:57] Sven Dawitz
Description:
The following select does not give out any results.
I guess, the SQL is correct and should give out results.
we have a master-detail relation between cargo (master - primary key cacaid) and cargopos (detail - primary key cpcpid - foreign key cpcaid).
the datafields dont need any further explanation i guess.

select * from cargo where 
upper(concat(caloadid, 
  DATE_FORMAT(caloaddt, '%d.%m.%Y'), 
  DATE_FORMAT(caetamont, '%d.%m.%Y'), cavessel,
  DATE_FORMAT(caetdhh, '%d.%m.%Y'),  
  DATE_FORMAT(caetadet, '%d.%m.%Y'), caups, 
  DATE_FORMAT(caleavsky, '%d.%m.%Y'), caupstracknr, 
  DATE_FORMAT(cacustclear, '%d.%m.%Y'), cacustentry, cadelttai))
LIKE
upper( '%SELECTTEST%' )

or cacaid in ( select cpcaid from cargopos where upper(concat(
                                      cpnumber, cpsupplier, cpsuppliernr, cpttairef,
                                      cpttesain, cppartsnr, cpquant, cpnopack, cpweight,
                                      cpcbm
                                    )) 
LIKE upper('%SELECTTEST%' )
)

How to repeat:
Execute Query on a similar db.
Or ask me for a db dump - no problem. email works.

Suggested fix:
would be nice, if it would work in next version - have to do this by hand right now :(
[30 Apr 2003 7:11] MySQL Verification Team
db dump required.

upload to :

ftp://support.mysql.com:/pub/mysql/secret

and use this bug to report a file name.
[8 Aug 2003 2:44] Lenz Grimmer
Sanja, can you tell if this one has been fixed already? If yes, please close this bug. Thanks!
[8 Aug 2003 3:06] Oleksandr Byelkin
No, I can't (now), because I did not find any mention about place where I can 
find database dump or any other repeatble sequence of SQL statements in this 
discussion. As far as I get test-suite I will check it.