Index: trunk/phase3/includes/db/DatabaseMysql.php |
— | — | @@ -787,7 +787,7 @@ |
788 | 788 | * @return bool|ResultWrapper |
789 | 789 | */ |
790 | 790 | public function dropTable( $tableName, $fName = 'DatabaseMysql::dropTable' ) { |
791 | | - if( !$this->tableExists( $tableName ) ) { |
| 791 | + if( !$this->tableExists( $tableName, $fName ) ) { |
792 | 792 | return false; |
793 | 793 | } |
794 | 794 | return $this->query( "DROP TABLE IF EXISTS " . $this->tableName( $tableName ), $fName ); |
Index: trunk/phase3/includes/db/DatabaseOracle.php |
— | — | @@ -856,7 +856,7 @@ |
857 | 857 | /** |
858 | 858 | * Query whether a given table exists (in the given schema, or the default mw one if not given) |
859 | 859 | */ |
860 | | - function tableExists( $table ) { |
| 860 | + function tableExists( $table, $fname = __METHOD__ ) { |
861 | 861 | $table = $this->tableName( $table ); |
862 | 862 | $table = $this->addQuotes( strtoupper( $this->removeIdentifierQuotes( $table ) ) ); |
863 | 863 | $owner = $this->addQuotes( strtoupper( $this->mDBname ) ); |
— | — | @@ -1316,9 +1316,9 @@ |
1317 | 1317 | public function getSearchEngine() { |
1318 | 1318 | return 'SearchOracle'; |
1319 | 1319 | } |
1320 | | - |
| 1320 | + |
1321 | 1321 | public function getInfinity() { |
1322 | 1322 | return '31-12-2030 12:00:00.000000'; |
1323 | 1323 | } |
1324 | | - |
| 1324 | + |
1325 | 1325 | } // end DatabaseOracle class |
Index: trunk/phase3/includes/db/DatabasePostgres.php |
— | — | @@ -771,7 +771,7 @@ |
772 | 772 | * For backward compatibility, this function checks both tables and |
773 | 773 | * views. |
774 | 774 | */ |
775 | | - function tableExists( $table, $schema = false ) { |
| 775 | + function tableExists( $table, $fname = __METHOD__, $schema = false ) { |
776 | 776 | return $this->relationExists( $table, array( 'r', 'v' ), $schema ); |
777 | 777 | } |
778 | 778 | |
Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -492,7 +492,7 @@ |
493 | 493 | * Queries whether a given table exists |
494 | 494 | * @return boolean |
495 | 495 | */ |
496 | | - public function tableExists( $table ) { |
| 496 | + public function tableExists( $table, $fname = __METHOD__ ) { |
497 | 497 | $schema = $this->mSchema; |
498 | 498 | |
499 | 499 | $sql = "SELECT COUNT( * ) FROM SYSIBM.SYSTABLES ST WHERE ST.NAME = '" . |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1528,13 +1528,14 @@ |
1529 | 1529 | * Query whether a given table exists |
1530 | 1530 | * |
1531 | 1531 | * @param $table string |
| 1532 | + * @param $fname string |
1532 | 1533 | * |
1533 | 1534 | * @return bool |
1534 | 1535 | */ |
1535 | | - function tableExists( $table ) { |
| 1536 | + function tableExists( $table, $fname = __METHOD__ ) { |
1536 | 1537 | $table = $this->tableName( $table ); |
1537 | 1538 | $old = $this->ignoreErrors( true ); |
1538 | | - $res = $this->query( "SELECT 1 FROM $table LIMIT 1", __METHOD__ ); |
| 1539 | + $res = $this->query( "SELECT 1 FROM $table LIMIT 1", $fname ); |
1539 | 1540 | $this->ignoreErrors( $old ); |
1540 | 1541 | |
1541 | 1542 | return (bool)$res; |
— | — | @@ -3311,7 +3312,7 @@ |
3312 | 3313 | * @since 1.18 |
3313 | 3314 | */ |
3314 | 3315 | public function dropTable( $tableName, $fName = 'DatabaseBase::dropTable' ) { |
3315 | | - if( !$this->tableExists( $tableName ) ) { |
| 3316 | + if( !$this->tableExists( $tableName, $fName ) ) { |
3316 | 3317 | return false; |
3317 | 3318 | } |
3318 | 3319 | $sql = "DROP TABLE " . $this->tableName( $tableName ); |
Index: trunk/phase3/includes/db/DatabaseMssql.php |
— | — | @@ -631,7 +631,7 @@ |
632 | 632 | return $version; |
633 | 633 | } |
634 | 634 | |
635 | | - function tableExists ( $table, $schema = false ) { |
| 635 | + function tableExists ( $table, , $fname = __METHOD__, $schema = false ) { |
636 | 636 | $res = sqlsrv_query( $this->mConn, "SELECT * FROM information_schema.tables |
637 | 637 | WHERE table_type='BASE TABLE' AND table_name = '$table'" ); |
638 | 638 | if ( $res === false ) { |
Index: trunk/phase3/includes/installer/DatabaseUpdater.php |
— | — | @@ -315,7 +315,7 @@ |
316 | 316 | * @return boolean |
317 | 317 | */ |
318 | 318 | protected function canUseNewUpdatelog() { |
319 | | - return $this->db->tableExists( 'updatelog' ) && |
| 319 | + return $this->db->tableExists( 'updatelog', __METHOD__ ) && |
320 | 320 | $this->db->fieldExists( 'updatelog', 'ul_value' ); |
321 | 321 | } |
322 | 322 | |
— | — | @@ -399,7 +399,7 @@ |
400 | 400 | * @param $fullpath Boolean Whether to treat $patch path as a relative or not |
401 | 401 | */ |
402 | 402 | protected function addTable( $name, $patch, $fullpath = false ) { |
403 | | - if ( $this->db->tableExists( $name ) ) { |
| 403 | + if ( $this->db->tableExists( $name, __METHOD__ ) ) { |
404 | 404 | $this->output( "...$name table already exists.\n" ); |
405 | 405 | } else { |
406 | 406 | $this->output( "Creating $name table..." ); |
— | — | @@ -416,7 +416,7 @@ |
417 | 417 | * @param $fullpath Boolean Whether to treat $patch path as a relative or not |
418 | 418 | */ |
419 | 419 | protected function addField( $table, $field, $patch, $fullpath = false ) { |
420 | | - if ( !$this->db->tableExists( $table ) ) { |
| 420 | + if ( !$this->db->tableExists( $table, __METHOD__ ) ) { |
421 | 421 | $this->output( "...$table table does not exist, skipping new field patch\n" ); |
422 | 422 | } elseif ( $this->db->fieldExists( $table, $field ) ) { |
423 | 423 | $this->output( "...have $field field in $table table.\n" ); |
— | — | @@ -486,7 +486,7 @@ |
487 | 487 | * @param $fullpath bool |
488 | 488 | */ |
489 | 489 | protected function dropTable( $table, $patch, $fullpath = false ) { |
490 | | - if ( $this->db->tableExists( $table ) ) { |
| 490 | + if ( $this->db->tableExists( $table, __METHOD__ ) ) { |
491 | 491 | $this->output( "Dropping table $table... " ); |
492 | 492 | $this->applyPatch( $patch, $fullpath ); |
493 | 493 | $this->output( "ok\n" ); |
— | — | @@ -505,7 +505,7 @@ |
506 | 506 | */ |
507 | 507 | public function modifyField( $table, $field, $patch, $fullpath = false ) { |
508 | 508 | $updateKey = "$table-$field-$patch"; |
509 | | - if ( !$this->db->tableExists( $table ) ) { |
| 509 | + if ( !$this->db->tableExists( $table, __METHOD__ ) ) { |
510 | 510 | $this->output( "...$table table does not exist, skipping modify field patch\n" ); |
511 | 511 | } elseif ( !$this->db->fieldExists( $table, $field ) ) { |
512 | 512 | $this->output( "...$field field does not exist in $table table, skipping modify field patch\n" ); |
Index: trunk/phase3/includes/installer/MysqlUpdater.php |
— | — | @@ -243,7 +243,7 @@ |
244 | 244 | protected function doInterwikiUpdate() { |
245 | 245 | global $IP; |
246 | 246 | |
247 | | - if ( $this->db->tableExists( "interwiki" ) ) { |
| 247 | + if ( $this->db->tableExists( "interwiki", __METHOD__ ) ) { |
248 | 248 | $this->output( "...already have interwiki table\n" ); |
249 | 249 | return; |
250 | 250 | } |
— | — | @@ -315,7 +315,7 @@ |
316 | 316 | } |
317 | 317 | |
318 | 318 | function doSchemaRestructuring() { |
319 | | - if ( $this->db->tableExists( 'page' ) ) { |
| 319 | + if ( $this->db->tableExists( 'page', __METHOD__ ) ) { |
320 | 320 | $this->output( "...page table already exists.\n" ); |
321 | 321 | return; |
322 | 322 | } |
— | — | @@ -506,7 +506,7 @@ |
507 | 507 | } |
508 | 508 | |
509 | 509 | protected function doPagelinksUpdate() { |
510 | | - if ( $this->db->tableExists( 'pagelinks' ) ) { |
| 510 | + if ( $this->db->tableExists( 'pagelinks', __METHOD__ ) ) { |
511 | 511 | $this->output( "...already have pagelinks table.\n" ); |
512 | 512 | return; |
513 | 513 | } |
— | — | @@ -555,7 +555,7 @@ |
556 | 556 | } |
557 | 557 | |
558 | 558 | protected function doUserGroupsUpdate() { |
559 | | - if ( $this->db->tableExists( 'user_groups' ) ) { |
| 559 | + if ( $this->db->tableExists( 'user_groups', __METHOD__ ) ) { |
560 | 560 | $info = $this->db->fieldInfo( 'user_groups', 'ug_group' ); |
561 | 561 | if ( $info->type() == 'int' ) { |
562 | 562 | $oldug = $this->db->tableName( 'user_groups' ); |
— | — | @@ -582,7 +582,7 @@ |
583 | 583 | $this->applyPatch( 'patch-user_groups.sql' ); |
584 | 584 | $this->output( "ok\n" ); |
585 | 585 | |
586 | | - if ( !$this->db->tableExists( 'user_rights' ) ) { |
| 586 | + if ( !$this->db->tableExists( 'user_rights', __METHOD__ ) ) { |
587 | 587 | if ( $this->db->fieldExists( 'user', 'user_rights' ) ) { |
588 | 588 | $this->output( "Upgrading from a 1.3 or older database? Breaking out user_rights for conversion..." ); |
589 | 589 | $this->db->applyPatch( 'patch-user_rights.sql' ); |
— | — | @@ -651,7 +651,7 @@ |
652 | 652 | } |
653 | 653 | |
654 | 654 | protected function doTemplatelinksUpdate() { |
655 | | - if ( $this->db->tableExists( 'templatelinks' ) ) { |
| 655 | + if ( $this->db->tableExists( 'templatelinks', __METHOD__ ) ) { |
656 | 656 | $this->output( "...templatelinks table already exists\n" ); |
657 | 657 | return; |
658 | 658 | } |
— | — | @@ -709,7 +709,7 @@ |
710 | 710 | * -- Andrew Garrett, January 2007. |
711 | 711 | */ |
712 | 712 | protected function doRestrictionsUpdate() { |
713 | | - if ( $this->db->tableExists( 'page_restrictions' ) ) { |
| 713 | + if ( $this->db->tableExists( 'page_restrictions', __METHOD__ ) ) { |
714 | 714 | $this->output( "...page_restrictions table already exists.\n" ); |
715 | 715 | return; |
716 | 716 | } |
— | — | @@ -760,7 +760,7 @@ |
761 | 761 | } |
762 | 762 | |
763 | 763 | protected function doMaybeProfilingMemoryUpdate() { |
764 | | - if ( !$this->db->tableExists( 'profiling' ) ) { |
| 764 | + if ( !$this->db->tableExists( 'profiling', __METHOD__ ) ) { |
765 | 765 | // Simply ignore |
766 | 766 | } elseif ( $this->db->fieldExists( 'profiling', 'pf_memory' ) ) { |
767 | 767 | $this->output( "...profiling table has pf_memory field.\n" ); |
Index: trunk/phase3/includes/installer/DatabaseInstaller.php |
— | — | @@ -148,7 +148,7 @@ |
149 | 149 | } |
150 | 150 | $this->db->selectDB( $this->getVar( 'wgDBname' ) ); |
151 | 151 | |
152 | | - if( $this->db->tableExists( 'user' ) ) { |
| 152 | + if( $this->db->tableExists( 'user', __METHOD__ ) ) { |
153 | 153 | $status->warning( 'config-install-tables-exist' ); |
154 | 154 | $this->enableLB(); |
155 | 155 | return $status; |
— | — | @@ -466,7 +466,7 @@ |
467 | 467 | if ( !$this->db->selectDB( $this->getVar( 'wgDBname' ) ) ) { |
468 | 468 | return false; |
469 | 469 | } |
470 | | - return $this->db->tableExists( 'cur' ) || $this->db->tableExists( 'revision' ); |
| 470 | + return $this->db->tableExists( 'cur', __METHOD__ ) || $this->db->tableExists( 'revision', __METHOD__ ); |
471 | 471 | } |
472 | 472 | |
473 | 473 | /** |
Index: trunk/phase3/includes/installer/MysqlInstaller.php |
— | — | @@ -164,7 +164,7 @@ |
165 | 165 | $conn->selectDB( $this->getVar( 'wgDBname' ) ); |
166 | 166 | |
167 | 167 | # Determine existing default character set |
168 | | - if ( $conn->tableExists( "revision" ) ) { |
| 168 | + if ( $conn->tableExists( "revision", __METHOD__ ) ) { |
169 | 169 | $revision = $conn->buildLike( $this->getVar( 'wgDBprefix' ) . 'revision' ); |
170 | 170 | $res = $conn->query( "SHOW TABLE STATUS $revision", __METHOD__ ); |
171 | 171 | $row = $conn->fetchObject( $res ); |