@@ -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
215217class 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