append RETURNING * to REPLACE Commands

This commit is contained in:
Matthew Bucci
2024-02-26 23:31:22 -08:00
12 changed files with 99 additions and 19 deletions
-9
View File
@@ -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);