Skip to content

Commit 48b58d8

Browse files
author
Daniel Kinzler
committed
use insert ignore for page sets
git-svn-id: https://svn.toolserver.org/svnroot/daniel/duesenstuff/trunk/gpClient@553 9f2c43bc-b3c0-43f4-b155-41619b16f219
1 parent 1d5c3ea commit 48b58d8

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

php/gpMediaWiki.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,12 +306,12 @@ public function resolve_ids( ) {
306306
}
307307

308308
public function make_sink() {
309-
$sink = $this->glue->make_sink( $this->table_obj );
309+
$sink = $this->glue->make_sink( $this->table_obj, true );
310310
return $sink;
311311
}
312312

313313
public function make_id_sink() {
314-
$sink = $this->glue->make_sink( $this->table_id_obj );
314+
$sink = $this->glue->make_sink( $this->table_id_obj, true );
315315
return $sink;
316316
}
317317

php/gpMySQL.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,11 @@ abstract class gpMySQLInserter {
176176
var $table;
177177
var $fields;
178178

179-
function __construct ( gpMySQLGlue $glue, gpMySQLTable $table ) {
179+
function __construct ( gpMySQLGlue $glue, gpMySQLTable $table, $ignore_dupes = false ) {
180180
$this->glue = $glue;
181181
$this->table = $table;
182+
183+
$this->ignore_dupes = $ignore_dupes; #TODO: port $ignore_dupes to python!
182184
}
183185

184186
public abstract function insert( $values );
@@ -199,7 +201,7 @@ public function as_list( $values ) {
199201
}
200202

201203
protected function insert_command( ) {
202-
return $this->table->get_insert();
204+
return $this->table->get_insert( $this->ignore_dupes ); #TODO: port use of $ignore_dupes to python!
203205
}
204206

205207
public function insert( $values ) {
@@ -214,8 +216,8 @@ public function insert( $values ) {
214216

215217
class gpMySQLBufferedInserter extends gpMySQLSimpleInserter {
216218

217-
function __construct ( gpMySQLGlue $glue, gpMySQLTable $table ) {
218-
parent::__construct( $glue, $table );
219+
function __construct ( gpMySQLGlue $glue, gpMySQLTable $table, $ignore_dupes = false ) {
220+
parent::__construct( $glue, $table, $ignore_dupes );
219221
$this->buffer = "";
220222
}
221223

@@ -537,21 +539,21 @@ public function select_into( $query, gpDataSink $sink ) {
537539
return $c;
538540
}
539541

540-
protected function new_inserter( gpMySQLTable $table ) {
541-
return new gpMySQLBufferedInserter( $this, $table );
542+
protected function new_inserter( gpMySQLTable $table, $ignore_dupes = false ) {
543+
return new gpMySQLBufferedInserter( $this, $table, $ignore_dupes );
542544
}
543545

544-
public function make_temp_sink( gpMySQLTable $table ) {
546+
public function make_temp_sink( gpMySQLTable $table, $ignore_dupes = false ) {
545547
$table = $this->make_temp_table($table);
546548

547-
$ins = $this->new_inserter($table);
549+
$ins = $this->new_inserter($table, $ignore_dupes);
548550
$sink = new gpMySQLTempSink( $ins, $this, $table );
549551

550552
return $sink;
551553
}
552554

553-
public function make_sink( gpMySQLTable $table ) {
554-
$inserter = $this->new_inserter($table);
555+
public function make_sink( gpMySQLTable $table, $ignore_dupes = false ) { #TODO: port $ignore_dupes to python
556+
$inserter = $this->new_inserter($table, $ignore_dupes);
555557
$sink = new gpMySQLSink( $inserter );
556558

557559
return $sink;

0 commit comments

Comments
 (0)