Index: trunk/extensions/SemanticDrilldown/specials/SD_BrowseData.php |
— | — | @@ -234,15 +234,13 @@ |
235 | 235 | */ |
236 | 236 | function createTempTable( $category, $subcategory, $subcategories, $applied_filters ) { |
237 | 237 | $dbr = wfGetDB( DB_SLAVE ); |
238 | | - $sql = <<<END |
239 | | - CREATE TEMPORARY TABLE semantic_drilldown_values ( |
240 | | - id INT NOT NULL, |
241 | | - INDEX id_index (id) |
242 | | - ) AS SELECT ids.smw_id AS id |
243 | | - |
244 | | -END; |
245 | | - $sql .= $this->getSQLFromClause( $category, $subcategory, $subcategories, $applied_filters ); |
246 | | - $dbr->query( $sql ); |
| 238 | + $sql1 = "CREATE TEMPORARY TABLE semantic_drilldown_values ( id INT NOT NULL )"; |
| 239 | + $dbr->query( $sql1 ); |
| 240 | + $sql2 = "CREATE INDEX id_index ON semantic_drilldown_values ( id )"; |
| 241 | + $dbr->query( $sql2 ); |
| 242 | + $sql3 = "INSERT INTO semantic_drilldown_values SELECT ids.smw_id AS id\n"; |
| 243 | + $sql3 .= $this->getSQLFromClause( $category, $subcategory, $subcategories, $applied_filters ); |
| 244 | + $dbr->query( $sql3 ); |
247 | 245 | } |
248 | 246 | |
249 | 247 | /** |
Index: trunk/extensions/SemanticDrilldown/includes/SD_Filter.php |
— | — | @@ -204,7 +204,9 @@ |
205 | 205 | */ |
206 | 206 | function dropTempTable() { |
207 | 207 | $dbr = wfGetDB( DB_SLAVE ); |
208 | | - $sql = "DROP TEMPORARY TABLE semantic_drilldown_filter_values"; |
| 208 | + // DROP TEMPORARY TABLE would be marginally safer, but it's |
| 209 | + // not supported on all RDBMS's. |
| 210 | + $sql = "DROP TABLE semantic_drilldown_filter_values"; |
209 | 211 | $dbr->query( $sql ); |
210 | 212 | } |
211 | 213 | } |