r47130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47129‎ | r47130 | r47131 >
Date:08:50, 11 February 2009
Author:mkroetzsch
Status:deferred
Tags:
Comment:
removed CASCASDE option from PostgreSQL-specific code, not needed; updated some comments
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php
@@ -779,8 +779,7 @@
780780 if ($this->m_dbs->affectedRows() == 0) { // no change, exit loop
781781 break;
782782 }
783 - /// TODO Why does PostgreSQL CASCADE here?
784 - $this->m_dbs->query('TRUNCATE TABLE ' . $tmpnew . (($wgDBtype=='postgres')?' CASCADE':'') , 'SMW::executeHierarchyQuery'); // empty "new" table
 783+ $this->m_dbs->query('TRUNCATE TABLE ' . $tmpnew, 'SMW::executeHierarchyQuery'); // empty "new" table
785784 $tmpname = $tmpnew;
786785 $tmpnew = $tmpres;
787786 $tmpres = $tmpname;
@@ -860,7 +859,8 @@
861860
862861 /**
863862 * After querying, make sure no temporary database tables are left.
864 - * Postgres will eventually clean up everything at the end of the transaction (" ON COMMIT DROP ").
 863+ * @todo I might be better to keep the tables and possibly reuse them later
 864+ * on. Being temporary, the tables will vanish with the session anyway.
865865 */
866866 protected function cleanUp() {
867867 global $wgDBtype;
@@ -874,9 +874,9 @@
875875 /**
876876 * Get SQL code suitable to create a temporary table of the given name, used to store ids.
877877 * MySQL can do that simply by creating new temporary tables. PostgreSQL first checks if such
878 - * a table exists. Also, PostgreSQL tables will use a RULE to achieve built-in duplicate
879 - * elimination. The latter is done using INSERT IGNORE in MySQL.
880 - * @todo Should the check for table existence in PostgreSQL be otptional? Is it really needed?
 878+ * a table exists, so the code is ready to reuse existing tables if the code was modified to
 879+ * keep them after query answering. Also, PostgreSQL tables will use a RULE to achieve built-in
 880+ * duplicate elimination. The latter is done using INSERT IGNORE in MySQL.
881881 */
882882 protected function getCreateTempIDTableSQL($tablename) {
883883 global $wgDBtype;

Status & tagging log