Index: trunk/phase3/includes/db/DatabaseIbm_db2.php |
— | — | @@ -466,11 +466,8 @@ |
467 | 467 | |
468 | 468 | $ret = db2_exec( $this->mConn, $sql, $this->mStmtOptions ); |
469 | 469 | if( $ret == false ) { |
470 | | - //TODO: Remove commented-out debug code once done debugging |
471 | | - //echo '<pre>ERROR</pre>'; |
472 | | - //echo '<pre>' . $sql . '</pre>'; |
473 | 470 | $error = db2_stmt_errormsg(); |
474 | | - //echo '<pre>' . $error . '</pre>'; |
| 471 | + |
475 | 472 | $this->installPrint( "<pre>$sql</pre>" ); |
476 | 473 | $this->installPrint( $error ); |
477 | 474 | throw new DBUnexpectedError( $this, 'SQL error: ' |
— | — | @@ -495,10 +492,7 @@ |
496 | 493 | */ |
497 | 494 | public function tableExists( $table ) { |
498 | 495 | $schema = $this->mSchema; |
499 | | - /*$sql = <<< EOF |
500 | | -SELECT COUNT( * ) FROM SYSIBM.SYSTABLES ST |
501 | | -WHERE ST.NAME = '$table' AND ST.CREATOR = '$schema' |
502 | | -EOF;*/ |
| 496 | + |
503 | 497 | $sql = "SELECT COUNT( * ) FROM SYSIBM.SYSTABLES ST WHERE ST.NAME = '" . |
504 | 498 | strtoupper( $table ) . |
505 | 499 | "' AND ST.CREATOR = '" . |
— | — | @@ -558,7 +552,7 @@ |
559 | 553 | . htmlspecialchars( $this->lastError() ) ); |
560 | 554 | } |
561 | 555 | return $row; |
562 | | - } |
| 556 | + } |
563 | 557 | return false; |
564 | 558 | } |
565 | 559 | |
— | — | @@ -977,11 +971,14 @@ |
978 | 972 | */ |
979 | 973 | private function removeNullPrimaryKeys( $table, $args ) { |
980 | 974 | $schema = $this->mSchema; |
| 975 | + |
981 | 976 | // find out the primary keys |
982 | | - /*$keyres = db2_primary_keys( $this->mConn, null, strtoupper( $schema ), |
983 | | - strtoupper( $table ) |
984 | | - );*/ |
985 | | - $keyres = $this->doQuery( "SELECT NAME FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = '" . strtoupper( $table ) . "' AND TBCREATOR = '" . strtoupper( $schema ) . "' AND KEYSEQ > 0" ); |
| 977 | + $keyres = $this->doQuery( "SELECT NAME FROM SYSIBM.SYSCOLUMNS WHERE TBNAME = '" |
| 978 | + . strtoupper( $table ) |
| 979 | + . "' AND TBCREATOR = '" |
| 980 | + . strtoupper( $schema ) |
| 981 | + . "' AND KEYSEQ > 0" ); |
| 982 | + |
986 | 983 | $keys = array(); |
987 | 984 | for ( |
988 | 985 | $row = $this->fetchRow( $keyres ); |
— | — | @@ -1123,12 +1120,8 @@ |
1124 | 1121 | $this->query( $sql, $fname ); |
1125 | 1122 | } |
1126 | 1123 | |
1127 | | - $this->insert($table, $row); |
1128 | 1124 | # Now insert the row |
1129 | | - /*$sql = "INSERT INTO $table ( " |
1130 | | - . $this->makeList( array_keys( $row ), LIST_NAMES ) |
1131 | | - .' ) VALUES ( ' . $this->makeList( $row, LIST_COMMA ) . ' )'; |
1132 | | - $this->query( $sql, $fname );*/ |
| 1125 | + $this->insert($table, $row); |
1133 | 1126 | } |
1134 | 1127 | } |
1135 | 1128 | |
— | — | @@ -1507,7 +1500,7 @@ |
1508 | 1501 | $sql = <<<SQL |
1509 | 1502 | DELETE FROM $delTable |
1510 | 1503 | WHERE $delVar IN ( |
1511 | | - SELECT $joinVar FROM $joinTable |
| 1504 | + SELECT $joinVar FROM $joinTable |
1512 | 1505 | |
1513 | 1506 | SQL; |
1514 | 1507 | if ( $conds != '*' ) { |
— | — | @@ -1576,7 +1569,7 @@ |
1577 | 1570 | */ |
1578 | 1571 | public function prepare( $sql, $func = 'DB2::prepare' ) { |
1579 | 1572 | $stmt = db2_prepare( $this->mConn, $sql, $this->mStmtOptions ); |
1580 | | - return $stmt; |
| 1573 | + return $stmt; |
1581 | 1574 | } |
1582 | 1575 | |
1583 | 1576 | /** |
Index: trunk/phase3/includes/installer/Ibm_db2Installer.php |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | elseif ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBmwschema'] ) ) { |
81 | 81 | $status->fatal( 'config-invalid-schema', $newValues['wgDBmwschema'] ); |
82 | 82 | } |
83 | | - if ( !strlen( $newValues['wgDBport'] ) ) { |
| 83 | + if ( !strlen( $newValues['wgDBport'] ) ) { |
84 | 84 | $status->fatal( 'config-invalid-port' ); |
85 | 85 | } |
86 | 86 | elseif ( !preg_match( '/^[0-9_]*$/', $newValues['wgDBport'] ) ) { |
— | — | @@ -94,8 +94,8 @@ |
95 | 95 | return $status; |
96 | 96 | } |
97 | 97 | |
98 | | - global $wgDBport; |
99 | | - $wgDBport = $newValues['wgDBport']; |
| 98 | + global $wgDBport; |
| 99 | + $wgDBport = $newValues['wgDBport']; |
100 | 100 | |
101 | 101 | // Try to connect |
102 | 102 | $status->merge( $this->getConnection() ); |
— | — | @@ -107,7 +107,6 @@ |
108 | 108 | $this->parent->setVar( 'wgDBpassword', $this->getVar( '_InstallPassword' ) ); |
109 | 109 | |
110 | 110 | return $status; |
111 | | - |
112 | 111 | } |
113 | 112 | |
114 | 113 | /** |