Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php |
— | — | @@ -779,8 +779,7 @@ |
780 | 780 | if ($this->m_dbs->affectedRows() == 0) { // no change, exit loop |
781 | 781 | break; |
782 | 782 | } |
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 |
785 | 784 | $tmpname = $tmpnew; |
786 | 785 | $tmpnew = $tmpres; |
787 | 786 | $tmpres = $tmpname; |
— | — | @@ -860,7 +859,8 @@ |
861 | 860 | |
862 | 861 | /** |
863 | 862 | * 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. |
865 | 865 | */ |
866 | 866 | protected function cleanUp() { |
867 | 867 | global $wgDBtype; |
— | — | @@ -874,9 +874,9 @@ |
875 | 875 | /** |
876 | 876 | * Get SQL code suitable to create a temporary table of the given name, used to store ids. |
877 | 877 | * 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. |
881 | 881 | */ |
882 | 882 | protected function getCreateTempIDTableSQL($tablename) { |
883 | 883 | global $wgDBtype; |