return;
}
}
- $fields['job_id'] = $dbw->nextSequenceValue( 'job_job_id_seq' );
$dbw->insert( 'job', $fields, __METHOD__ );
}
protected function insertFields() {
+ $dbw = wfGetDB( DB_MASTER );
return array(
+ 'job_id' => $dbw->nextSequenceValue( 'job_job_id_seq' ),
'job_cmd' => $this->command,
'job_namespace' => $this->title->getNamespace(),
'job_title' => $this->title->getDBkey(),
if (!is_array(reset($a))) {
$a = array($a);
}
- foreach ($a as $row) {
+
+ foreach ($a as &$row) {
$this->insertOneRow($table, $row, $fname);
}
$retVal = true;
if (preg_match('/^timestamp.*/i', $col_type) == 1 && strtolower($val) == 'infinity')
$val = '31-12-2030 12:00:00.000000';
- $val = $wgLang->checkTitleEncoding($val);
+ $val = ($wgLang != null) ? $wgLang->checkTitleEncoding($val) : $val;
if (oci_bind_by_name($stmt, ":$col", $val) === false)
$this->reportQueryError($this->lastErrno(), $this->lastError(), $sql, __METHOD__);
} else {
public function delete( $table, $conds, $fname = 'DatabaseOracle::delete' ) {
global $wgLang;
- $conds2 = array();
- foreach($conds as $col=>$val) {
- $col_type=$this->fieldInfo($this->tableName($table), $col)->type();
- if ($col_type == 'CLOB')
- $conds2['TO_CHAR('.$col.')'] = $wgLang->checkTitleEncoding($val);
- else
- $conds2[$col] = $wgLang->checkTitleEncoding($val);
- }
-
- return parent::delete( $table, $conds2, $fname );
+ if ($wgLang != null) {
+ $conds2 = array();
+ foreach($conds as $col=>$val) {
+ $col_type=$this->fieldInfo($this->tableName($table), $col)->type();
+ if ($col_type == 'CLOB')
+ $conds2['TO_CHAR('.$col.')'] = $wgLang->checkTitleEncoding($val);
+ else
+ $conds2[$col] = $wgLang->checkTitleEncoding($val);
+ }
+
+ return parent::delete( $table, $conds2, $fname );
+ } else return parent::delete( $table, $conds, $fname );
}
function bitNot($field) {
'iw_url' => 'http://ru.wikipedia.org/wiki/$1',
'iw_local' => 1 ),
) );
+
+
+ #Anonymous user
+ $db->insert( 'user', array(
+ 'user_id' => 0,
+ 'user_name' => 'Anonymous') );
+
# Hack-on-Hack: Insert a test user to be able to insert an image
$db->insert( 'user', array(
'user_id' => 1,