<?php
/**
- * This script is the IBM DB2 database abstraction layer
- *
+ * This is the IBM DB2 database abstraction layer.
* See maintenance/ibm_db2/README for development notes and other specific information
- * @ingroup Database
+ *
* @file
+ * @ingroup Database
* @author leo.petr+mediawiki@gmail.com
*/
* getSlavePos
* getMasterPos
* getLag
+ * setFakeMaster
*
* Generation: (9)
* tableNames
* select [Done]
*
* Slave/master: 2 / 2
- * setFakeSlaveLag [Done]
- * setFakeMaster [Done]
+ * setFakeSlaveLag [Done] - Where??
*
* Reflection: 5 / 5
* indexInfo [Done]
$res = $this->query( "VALUES NEXTVAL FOR $safeseq" );
$row = $this->fetchRow( $res );
$this->mInsertId = $row[0];
- $this->freeResult( $res );
return $this->mInsertId;
*/
return null;
// assume success
$res = true;
// If we are not in a transaction, we need to be for savepoint trickery
- $didbegin = 0;
if (! $this->mTrxLevel) {
$this->begin();
- $didbegin = 1;
}
$sql = "INSERT INTO $table (" . implode( ',', $keys ) . ') VALUES ';
$this->begin();
if ( !$ignore ) {
- $first = true;
foreach ( $args as $row ) {
// insert each row into the database
$res = $res & $this->execute($stmt, $row);
$overhead = "SAVEPOINT $ignore ON ROLLBACK RETAIN CURSORS";
db2_exec($this->mConn, $overhead, $this->mStmtOptions);
- $res2 = $this->execute($stmt, $row);
+ $this->execute($stmt, $row);
// get the last inserted value into a generated column
$this->calcInsertId($table, $primaryKey, $stmt);
* Returns link to IBM DB2 free download
* @return string wikitext of a link to the server software's web site
*/
- public function getSoftwareLink() {
+ public static function getSoftwareLink() {
return "[http://www.ibm.com/software/data/db2/express/?s_cmp=ECDDWW01&s_tact=MediaWiki IBM DB2]";
}
/**
* Not implemented
* @return string ''
- * @deprecated
*/
public function getStatus( $which="%" ) { $this->installPrint('Not implemented for DB2: getStatus()'); return ''; }
- /**
- * Not implemented
- * @deprecated
- */
- public function setFakeMaster( $enabled = true ) { $this->installPrint('Not implemented for DB2: setFakeMaster()'); }
/**
* Not implemented
* @return string $sql
- * @deprecated
*/
public function limitResultForUpdate($sql, $num) { $this->installPrint('Not implemented for DB2: limitResultForUpdate()'); return $sql; }
$res = $this->query($sql);
$row = $this->fetchObject($res);
$size = $row->size;
- $this->freeResult( $res );
return $size;
}
*/
function bitNot($field) {
//expecting bit-fields smaller than 4bytes
- return 'BITNOT('.$bitField.')';
+ return 'BITNOT('.$field.')';
}
/**