Project

General

Profile

Actions

Defect #19595

closed

Broken "receiving emails"

Added by Semyon Dubina about 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Email receiving
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Duplicate
Affected version:

Description

After update 2.6.1 -> 3.0.1 fetching emails from an IMAP server is brokened with error:

PG::AmbiguousColumn: ERROR: column reference "address" is ambiguous
LINE 1: ...s"."type" IN ('User', 'AnonymousUser') AND (LOWER I...
^
: SELECT DISTINCT "users".* FROM "users" INNER JOIN "email_addresses" ON "email_addresses"."user_id" = "users"."id" WHERE "users"."type" IN ('User', >'AnonymousUser') AND (LOWER IN ('')) ORDER BY "users"."id" ASC LIMIT 1

In sql bothe tables(email_addresses and users) have column "address".
Not sure when the columns were created. If it is not "out of the box", then this one of some plugins.

Step-by-steb find out: having_mail have wrong condition:

joins(:email_addresses).where("LOWER(address) IN (?)", addresses).uniq

For me worked:

joins(:email_addresses).where("LOWER(email_addresses.address) IN (?)", addresses).uniq


Related issues

Is duplicate of Redmine - Defect #19485: Column 'address' in where clause may be ambiguousClosedJean-Philippe Lang

Actions
Actions #1

Updated by Toshi MARUYAMA about 9 years ago

  • Status changed from New to Closed
  • Resolution set to Duplicate

Duplicate of #19485.

Actions #2

Updated by Toshi MARUYAMA about 9 years ago

  • Is duplicate of Defect #19485: Column 'address' in where clause may be ambiguous added
Actions #3

Updated by Go MAEDA about 9 years ago

Thank you for investigating.
I pasted the workaround on #19485-6.

Actions

Also available in: Atom PDF