MySQL 4 -> 5 upgrade problem

Giganews Newsgroups
Subject: MySQL 4 -> 5 upgrade problem
Posted by:  Mary Pegg (inval…@invalid.com)
Date: Tue, 17 Apr 2007

Had the following reported to me.  Any ideas for fixes?  Tried
starting MySQL 5 in "4.0 mode", but no dice.

========
This works:

SELECT  `u` . * , `s`.id AS is_staff, `s`.system AS is_system
FROM `USER` AS `u` , `STAFF` AS `s`
WHERE `s`.user_id = `u`.id
GROUP BY `u`.id
ORDER BY `u`.username
LIMIT 0 , 15

This does not:

SELECT  `u` . * , `ud` . * , `s`.id AS is_staff, `s`.system AS is_system
FROM `USER` AS `u` , `STAFF` AS `s`
LEFT JOIN `USERDETAIL` AS `ud` ON `ud`.user_id = `u`.id
WHERE `s`.user_id = `u`.id
GROUP BY `u`.id
ORDER BY `ud`.nameshow, `u`.username
LIMIT 0 , 15

#1054 - Unknown column 'u.id' in 'on clause'

--
"Checking identity papers is a complete waste of time.  If anyone can
be counted on to have valid papers, it will be the terrorists".

Replies