Merge lp:~wgrant/launchpad/tm-performance--1-disambiguate into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17368
Proposed branch: lp:~wgrant/launchpad/tm-performance--1-disambiguate
Merge into: lp:launchpad
Diff against target: 34 lines (+3/-3)
2 files modified
lib/lp/translations/model/pofile.py (+2/-2)
lib/lp/translations/model/potmsgset.py (+1/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/tm-performance--1-disambiguate
Reviewer Review Type Date Requested Status
Colin Watson (community) code Approve
Review via email: mp+251206@code.launchpad.net

Commit message

Disambiguate POTMsgSet.msgid_* references in queries that involve TM.

Description of the change

Disambiguate POTMsgSet.msgid_* references in queries that involve TranslationMessage, as it will soon grow denormalised copies of msgid_singular and msgid_plural.

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/translations/model/pofile.py'
--- lib/lp/translations/model/pofile.py 2013-06-20 05:50:00 +0000
+++ lib/lp/translations/model/pofile.py 2015-02-27 05:52:23 +0000
@@ -225,7 +225,7 @@
225 POTMsgSet.msgid_singular IN (225 POTMsgSet.msgid_singular IN (
226 SELECT POMsgID.id FROM POMsgID226 SELECT POMsgID.id FROM POMsgID
227 WHERE id IN (227 WHERE id IN (
228 SELECT DISTINCT(msgid_singular)228 SELECT DISTINCT(POTMsgSet.msgid_singular)
229 FROM POTMsgSet229 FROM POTMsgSet
230 JOIN TranslationTemplateItem230 JOIN TranslationTemplateItem
231 ON TranslationTemplateItem.potmsgset = POTMsgSet.id231 ON TranslationTemplateItem.potmsgset = POTMsgSet.id
@@ -246,7 +246,7 @@
246 POTMsgSet.msgid_plural IN (246 POTMsgSet.msgid_plural IN (
247 SELECT POMsgID.id FROM POMsgID247 SELECT POMsgID.id FROM POMsgID
248 WHERE id IN (248 WHERE id IN (
249 SELECT DISTINCT(msgid_plural)249 SELECT DISTINCT(POTMsgSet.msgid_plural)
250 FROM POTMsgSet250 FROM POTMsgSet
251 JOIN TranslationTemplateItem251 JOIN TranslationTemplateItem
252 ON TranslationTemplateItem.potmsgset = POTMsgSet.id252 ON TranslationTemplateItem.potmsgset = POTMsgSet.id
253253
=== modified file 'lib/lp/translations/model/potmsgset.py'
--- lib/lp/translations/model/potmsgset.py 2013-06-20 05:50:00 +0000
+++ lib/lp/translations/model/potmsgset.py 2015-02-27 05:52:23 +0000
@@ -414,7 +414,7 @@
414 JOIN SuggestivePOTemplate ON414 JOIN SuggestivePOTemplate ON
415 TranslationTemplateItem.potemplate =415 TranslationTemplateItem.potemplate =
416 SuggestivePOTemplate.potemplate416 SuggestivePOTemplate.potemplate
417 WHERE msgid_singular = %s and potmsgset.id <> %s417 WHERE POTMsgSet.msgid_singular = %s and POTMsgSet.id <> %s
418 )''' % sqlvalues(self.msgid_singular, self))418 )''' % sqlvalues(self.msgid_singular, self))
419419
420 # Subquery to find the ids of TranslationMessages that are420 # Subquery to find the ids of TranslationMessages that are