* @package MediaWiki
*/
-/**
- * Depends on database
- */
-require_once( 'Database.php' );
-
class OracleBlob extends DBObject {
function isLOB() {
return true;
*/
function open( $server, $user, $password, $dbName ) {
if ( !function_exists( 'oci_connect' ) ) {
- die( "Oracle functions missing, have you compiled PHP with the --with-oci8 option?\n" );
+ throw new DBConnectionError( $this, "Oracle functions missing, have you compiled PHP with the --with-oci8 option?\n" );
}
$this->close();
$this->mServer = $server;
function freeResult( $res ) {
if (!oci_free_statement($res)) {
- wfDebugDieBacktrace( "Unable to free Oracle result\n" );
+ throw new DBUnexpectedError( $this, "Unable to free Oracle result\n" );
}
unset($this->mFetchID[$res]);
unset($this->mFetchCache[$res]);
# DELETE where the condition is a join
function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = "Database::deleteJoin" ) {
if ( !$conds ) {
- wfDebugDieBacktrace( 'Database::deleteJoin() called with empty $conds' );
+ throw new DBUnexpectedError( $this, 'Database::deleteJoin() called with empty $conds' );
}
$delTable = $this->tableName( $delTable );
# return "TO_TIMESTAMP('" . $this->strencode(wfTimestamp(TS_DB, $ts)) . "', 'RRRR-MM-DD HH24:MI:SS')";
}
- /**
- * Return aggregated value function call
- */
- function aggregateValue ($valuedata,$valuename='value') {
- return $valuedata;
- }
+ /**
+ * Return aggregated value function call
+ */
+ function aggregateValue ($valuedata,$valuename='value') {
+ return $valuedata;
+ }
function reportQueryError( $error, $errno, $sql, $fname, $tempIgnore = false ) {
"Query: $sql\n" .
"Function: $fname\n" .
"Error: $errno $error\n";
- wfDebugDieBacktrace($message);
+ throw new DBUnexpectedError($this, $message);
}
/**
function immediateCommit( $fname = 'Database::immediateCommit' ) {
oci_commit($this->mConn);
$this->mTrxLevel = 0;
- }
+ }
function rollback( $fname = 'Database::rollback' ) {
oci_rollback($this->mConn);
$this->mTrxLevel = 0;
if (is_object($value) && $value->isLOB()) {
$blob = oci_new_descriptor($this->mConn, OCI_D_LOB);
$bdata = $value->data();
- oci_bind_by_name($stmt, ":bobj", &$blob, -1, OCI_B_BLOB);
+ oci_bind_by_name($stmt, ":bobj", $blob, -1, OCI_B_BLOB);
} else
oci_bind_by_name($stmt, ":$k", $a[$key][$k], -1);
if ($this->debug())