Index: trunk/extensions/Wikidata/util/missing.php |
— | — | @@ -97,7 +97,7 @@ |
98 | 98 | # Malafaya: This is my query (performance must be checked live) for missing expressions based on |
99 | 99 | # * don't count deleted stuff (old query did) |
100 | 100 | # * do 2 joins: between members of collection and target language, and then with english for default, but only for elements having target language expression as NULL (non-existing) |
101 | | -# * this gives us the DM id, the spelling in target language (or NULL, if none), the spelling in English (or NULL, if none) |
| 101 | +# * this gives us the DM id, the spelling in target language (or NULL, if none), the spelling in English (or NULL, if none) |
102 | 102 | # Warning: some DMs came up in OLPC and Swadesh collections belonging to those collections but having no expressions associated... These are visible in this query |
103 | 103 | |
104 | 104 | $result = mysql_query(" |
— | — | @@ -116,6 +116,13 @@ |
117 | 117 | uw_expression_ns.expression_id = uw_syntrans.expression_id |
118 | 118 | AND uw_syntrans.remove_transaction_id IS NULL |
119 | 119 | AND language_id = $language_esc |
| 120 | + AND defined_meaning_id IN |
| 121 | + ( |
| 122 | + SELECT member_mid as id |
| 123 | + FROM uw_collection_contents WHERE |
| 124 | + collection_id = $collection_esc |
| 125 | + AND remove_transaction_id IS NULL |
| 126 | + ) |
120 | 127 | ) as translation |
121 | 128 | ON |
122 | 129 | translation.defined_meaning_id = member.id |
— | — | @@ -126,6 +133,13 @@ |
127 | 134 | uw_expression_ns.expression_id = uw_syntrans.expression_id |
128 | 135 | AND uw_syntrans.remove_transaction_id IS NULL |
129 | 136 | AND language_id = 85 |
| 137 | + AND defined_meaning_id IN |
| 138 | + ( |
| 139 | + SELECT member_mid as id |
| 140 | + FROM uw_collection_contents WHERE |
| 141 | + collection_id = $collection_esc |
| 142 | + AND remove_transaction_id IS NULL |
| 143 | + ) |
130 | 144 | ) as translation_en |
131 | 145 | ON |
132 | 146 | translation_en.defined_meaning_id = member.id |