https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292015-03-25T20:34:39ZRedmineRedmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=625532015-03-25T20:34:39ZToshi MARUYAMA
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/62553/diff?detail_id=47524">diff</a>)</li></ul> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=629072015-04-08T07:59:33ZRafaĆ Lisowski
<ul></ul><p>are you sure that you don't have any other plugins?<br />In my logs sql look the same and is working:<br /><pre>
SELECT DISTINCT `users`.* FROM `users`
INNER JOIN `email_addresses` ON `email_addresses`.`user_id` = `users`.`id`
WHERE `users`.`type` IN ('User', 'AnonymousUser') AND (LOWER(address) IN ('l.ka@company.com'))
ORDER BY `users`.`id` ASC LIMIT 1
</pre></p> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=629102015-04-08T08:32:35ZToshi MARUYAMA
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Needs feedback</i></li></ul><p>I think your "users" table has "address" column created by plugin which you use or used.</p> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=630152015-04-12T04:38:21ZGo MAEDA
<ul></ul><p>The same error is reported in <a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Broken "receiving emails" (Closed)" href="https://www.redmine.org/issues/19595">#19595</a> and that issue has a workaround.</p> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=630182015-04-12T04:40:40ZToshi MARUYAMA
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/19595">Defect #19595</a>: Broken "receiving emails"</i> added</li></ul> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=630192015-04-12T05:02:51ZGo MAEDA
<ul></ul><p>A workaround by Andrey Sennikov (<a class="issue tracker-1 status-5 priority-4 priority-default closed" title="Defect: Broken "receiving emails" (Closed)" href="https://www.redmine.org/issues/19595">#19595</a>).</p>
<pre><code class="diff syntaxhl"><span class="gh">Index: app/models/user.rb
===================================================================
</span><span class="gd">--- app/models/user.rb (revision 14160)
</span><span class="gi">+++ app/models/user.rb (working copy)
</span><span class="p">@@ -130,7 +130,7 @@</span>
scope :having_mail, lambda {|arg|
addresses = Array.wrap(arg).map {|a| a.to_s.downcase}
if addresses.any?
<span class="gd">- joins(:email_addresses).where("LOWER(address) IN (?)", addresses).uniq
</span><span class="gi">+ joins(:email_addresses).where("LOWER(email_addresses.address) IN (?)", addresses).uniq
</span> else
none
end
</code></pre> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=637912015-05-20T03:04:24ZToshi MARUYAMA
<ul><li><strong>Subject</strong> changed from <i>error in imap fetch task after update to 3.0.1</i> to <i>Column 'address' in where clause is ambiguous</i></li></ul> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=637952015-05-20T03:06:03ZToshi MARUYAMA
<ul><li><strong>Has duplicate</strong> <i><a class="issue tracker-1 status-5 priority-4 priority-default closed" href="/issues/19884">Defect #19884</a>: address column in WHERE clause is ambiguous</i> added</li></ul> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=637962015-05-20T03:06:28ZToshi MARUYAMA
<ul><li><strong>Category</strong> changed from <i>Email receiving</i> to <i>Database</i></li></ul> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=638642015-05-24T18:10:24ZFuture Link Corporation pkgsrc team
<ul></ul><p>For us, it was the <a href="http://www.redminecrm.com/projects/people/pages/1" class="external">People plugin</a> which caused this problem. In any case, less ambiguity in the <code>SELECT</code> statement wouldn't be a bad thing. Can this patch be integrated? It seems we fixed it in the same way.</p> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=638662015-05-25T11:16:28ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Target version</strong> set to <i>3.0.4</i></li></ul> Redmine - Defect #19485: Column 'address' in where clause may be ambiguoushttps://www.redmine.org/issues/19485?journal_id=639492015-05-30T08:24:13ZJean-Philippe Langjp_lang@yahoo.fr
<ul><li><strong>Subject</strong> changed from <i>Column 'address' in where clause is ambiguous</i> to <i>Column 'address' in where clause may be ambiguous</i></li><li><strong>Category</strong> changed from <i>Database</i> to <i>Code cleanup/refactoring</i></li><li><strong>Status</strong> changed from <i>Needs feedback</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Jean-Philippe Lang</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fixed in <a class="changeset" title="Column 'address' in where clause may be ambiguous (#19485)." href="https://www.redmine.org/projects/redmine/repository/svn/revisions/14284">r14284</a>.</p>