diff --git a/pg4wp/rewriters/InsertSQLRewriter.php b/pg4wp/rewriters/InsertSQLRewriter.php index fe753c7..b401e28 100644 --- a/pg4wp/rewriters/InsertSQLRewriter.php +++ b/pg4wp/rewriters/InsertSQLRewriter.php @@ -8,15 +8,6 @@ class InsertSQLRewriter extends AbstractSQLRewriter $sql = $this->original(); - $sql = str_replace('(0,', "('0',", $sql); - $sql = str_replace('(1,', "('1',", $sql); - - // Fix inserts into wp_categories - if(false !== strpos($sql, 'INSERT INTO ' . $wpdb->categories)) { - $sql = str_replace('"cat_ID",', '', $sql); - $sql = str_replace("VALUES ('0',", "VALUES(", $sql); - } - // Those are used when we need to set the date to now() in gmt time $sql = str_replace("'0000-00-00 00:00:00'", 'now() AT TIME ZONE \'gmt\'', $sql); diff --git a/tests/rewriteTest.php b/tests/rewriteTest.php index eeb5f8c..e3a5922 100644 --- a/tests/rewriteTest.php +++ b/tests/rewriteTest.php @@ -426,6 +426,59 @@ final class rewriteTest extends TestCase } + public function test_it_can_handle_insert_sql_containing_nested_parathesis_with_numbers() + { + $sql = <<