r50979 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50978‎ | r50979 | r50980 >
Date:14:08, 25 May 2009
Author:daniel
Status:deferred
Tags:
Comment:
fixed access to ID field before IDs get resolved
Modified paths:
  • /trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWordBuilder/src/main/java/de/brightbyte/wikiword/store/builder/DatabaseLocalConceptStoreBuilder.java
@@ -660,21 +660,21 @@
661661 }
662662
663663 private int deleteAmbiguousAliases(RelationTable aliasTable, String sourceField, String sourceNameField, String targetField, String where) throws PersistenceException {
664 - String sql = "CREATE TEMPORARY TABLE bad_alias ( id INT, name varbinary(255), PRIMARY KEY (id, name) )";
 664+ String sql = "CREATE TEMPORARY TABLE bad_alias ( id INT DEFAULT NULL, name varbinary(255), PRIMARY KEY (id, name) )";
665665 executeUpdate("deleteAmbiguousAliases:createTemp", sql);
666666
667667 sql = "INSERT IGNORE INTO bad_alias " +
668668 " SELECT " + sourceField + ", " + sourceNameField + " " +
669669 " FROM " + aliasTable.getSQLName() + " " +
670670 (where==null ? "" : " WHERE " + where + " ") +
671 - " GROUP BY " + sourceField + ", " + sourceNameField + " " +
 671+ " GROUP BY " + (idManager!=null ? sourceField : sourceNameField ) + " " +
672672 " HAVING count(DISTINCT " + targetField + ") > 1";
673673
674674 executeUpdate("deleteAmbiguousAliases:fillTemp", sql);
675675
676676 sql = "DELETE FROM A " +
677677 " USING " + aliasTable.getSQLName() + " AS A " +
678 - " JOIN bad_alias AS T ON T.id = A." + sourceField + " AND T.name = A." + sourceNameField + " " +
 678+ " JOIN bad_alias AS T ON " + (idManager!=null ? " T.id = A." + sourceField : " T.name = A." + sourceNameField ) + " " +
679679 (where==null ? "" : " WHERE " + where + " ");
680680
681681 int n = executeUpdate("deleteAmbiguousAliases:delete", sql);

Status & tagging log