Page 1 of 1

Error "unknown column usr_id1 in field list" where usr_id1 is an alias generated by dbForge

Posted: Thu 29 Aug 2013 07:35
by aoagroup
I am currently running version 6.0.441.

When running the query below, dbForge generates a temporary alias "usr_id1" for column 4 "employment.usr_id" because column 4 has the same name as column 1.

Code: Select all

SELECT
  usr.usr_id,
  usr.name,
  usr.email,
  employment.usr_id,
  employment.title
FROM usr
  LEFT OUTER JOIN employment
    ON usr.usr_id = employment.usr_id
I update the column "employment.title" and submit the update. The update itself is fine but it generates an error "unknown column usr_id1 in field list" when retrieving the row data because dbForge uses the temporary alias `usr_id1` instead of `usr_id` in the query.

Code: Select all

UPDATE `company`.`employment` SET `title` = :p1 WHERE (((:p2 = 1 AND `usr_id` IS NULL) OR (`usr_id` = :p3)));
SELECT `usr_id1`, `title` FROM `company`.`employment` WHERE `usr_id` = :p3 AND `title` = :p1
Parameters: 
	p1: Office Assistant
	p2: 0
	p3: 12345
Thanks in advance :wink:

Re: Error "unknown column usr_id1 in field list" where usr_id1 is an alias generated by dbForge

Posted: Fri 30 Aug 2013 01:48
by aoagroup
Received reply from dbForge Support and the bug will be fixed in one of the next builds.

Re: Error "unknown column usr_id1 in field list" where usr_id1 is an alias generated by dbForge

Posted: Fri 30 Aug 2013 11:04
by alexa
We were able to reproduce this issue and will fix it in one of the next builds of dbForge Studio for MySQL. We will notify you once it's available for downloading.