Skip to content

Commit

Permalink
replace calls to seq by adding a RETURNING * to all insert statements
Browse files Browse the repository at this point in the history
  • Loading branch information
mattbucci committed Feb 22, 2024
1 parent 23da9c0 commit 8d420dc
Show file tree
Hide file tree
Showing 17 changed files with 116 additions and 18 deletions.
42 changes: 38 additions & 4 deletions pg4wp/driver_pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
$GLOBALS['pg4wp_numrows_query'] = '';
$GLOBALS['pg4wp_ins_table'] = '';
$GLOBALS['pg4wp_ins_field'] = '';
$GLOBALS['pg4wp_ins_id'] = '';
$GLOBALS['pg4wp_last_insert'] = '';
$GLOBALS['pg4wp_connstr'] = '';
$GLOBALS['pg4wp_conn'] = false;
Expand Down Expand Up @@ -465,6 +466,23 @@ function wpsqli_rollback(&$connection, $flags = 0, $name = null)
pg_query($connection, "ROLLBACK");
}

function get_primary_key_for_table(&$connection, $table)
{
$query = <<<SQL
SELECT a.attname
FROM pg_index i
JOIN pg_attribute a ON a.attrelid = i.indrelid
AND a.attnum = ANY(i.indkey)
WHERE i.indrelid = '$table'::regclass
AND i.indisprimary
SQL;

$result = pg_query($connection, $query);

$row = pg_fetch_row($result);
return $row[0];
}

/**
* Performs a query against the database.
*
Expand Down Expand Up @@ -515,6 +533,19 @@ function wpsqli_query(&$connection, $query, $result_mode = 0)
$GLOBALS['pg4wp_conn'] = $connection;
$GLOBALS['pg4wp_result'] = $result;

if (false !== str_post("INSERT INTO")) {
$matches = array();
preg_match("/^INSERT INTO ([a-z0-9_]+)/i", $query, $matches);
$tableName = $matches[1];

if (false !== str_pos($sql, "RETURNING")) {
$primaryKey = $this->get_primary_key_for_table($connection, $tableName);
$row = pg_fetch_assoc($result);

$GLOBALS['pg4wp_ins_id'] = $row[$primaryKey];
}
}

return $result;
}

Expand Down Expand Up @@ -1077,9 +1108,8 @@ function wpsqli_get_primary_sequence_for_table(&$connection, $table)
}
}

// Fallback to default if we don't find a sequence
// Note: this will probably fail
return $table . '_seq';
// we didn't find a sequence for this table.
return null;
}

/**
Expand Down Expand Up @@ -1115,8 +1145,12 @@ function wpsqli_insert_id(&$connection = null)

// PostgreSQL: Setting the value of the sequence based on the latest inserted ID.
$GLOBALS['pg4wp_queued_query'] = "SELECT SETVAL('$seq',(SELECT MAX(\"ID\") FROM $table)+1);";
} elseif($GLOBALS['pg4wp_ins_id']) {
return $GLOBALS['pg4wp_ins_id'];
} elseif(empty($sql)) {
$sql = 'NO QUERY';
$data = 0;
} else {
// PostgreSQL: Using CURRVAL() to get the current value of the sequence.
// Double quoting is needed to prevent seq from being lowercased automatically
$sql = "SELECT CURRVAL('\"$seq\"')";
$res = pg_query($connection, $sql);
Expand Down
37 changes: 37 additions & 0 deletions pg4wp/rewriters/InsertSQLRewriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,43 @@ public function rewrite(): string
$sql = utf8_encode($sql);
}

if(false === strpos($sql, 'RETURNING')) {
$end_of_statement = $this->findSemicolon($sql);
if ($end_of_statement !== false) {
// Create the substrings up to and after the semicolon
$sql_before_semicolon = substr($sql, 0, $end_of_statement);
$sql_after_semicolon = substr($sql, $end_of_statement, strlen($sql));

// Splice the SQL string together with 'RETURNING *'
$sql = $sql_before_semicolon . ' RETURNING *' . $sql_after_semicolon;

} else {
$sql = $sql .=" RETURNING *";
}
}

return $sql;
}

// finds semicolons that aren't in variables
private function findSemicolon($sql) {
$quoteOpened = false;
$parenthesisDepth = 0;

$sqlAsArray = str_split($sql);
for($i=0; $i<count($sqlAsArray); $i++) {
if(($sqlAsArray[$i] == '"' || $sqlAsArray[$i]=="'") && ($i == 0 || $sqlAsArray[$i-1]!='\\'))
$quoteOpened = !$quoteOpened;

else if($sqlAsArray[$i] == '(' && !$quoteOpened)
$parenthesisDepth++;

else if($sqlAsArray[$i] == ')' && !$quoteOpened)
$parenthesisDepth--;

else if($sqlAsArray[$i] == ';' && !$quoteOpened && $parenthesisDepth == 0)
return $i;
}
return false;
}
}
27 changes: 27 additions & 0 deletions tests/rewriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,33 @@ public function test_it_can_create_double_keys_with_length()
$this->assertSame(trim($expected), trim($postgresql));
}

public function test_it_will_append_returning_id_to_insert_statements()
{
$sql = <<<SQL
INSERT INTO wp_translations_term_relations (
object_id,
object_lang,
source_id)
VALUES (%d, %s, %d)
ON DUPLICATE KEY
UPDATE object_id=VALUES(object_id), object_lang=VALUES(object_lang), source_id=VALUES(source_id);
SQL;

$expected = <<<SQL
INSERT INTO wp_translations_term_relations (
object_id,
object_lang,
source_id)
VALUES (%d, %s, %d)
ON DUPLICATE KEY
UPDATE object_id=VALUES(object_id), object_lang=VALUES(object_lang), source_id=VALUES(source_id) RETURNING *;
SQL;

$postgresql = pg4wp_rewrite($sql);
$this->assertSame(trim($expected), trim($postgresql));
}




protected function setUp(): void
Expand Down
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679874.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_postmeta` (`post_id`, `meta_key`, `meta_value`) VALUES (55, '_edit_lock', '1698679874:1')","postgresql":"INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (55, '_edit_lock', '1698679874:1')"}
{"mysql":"INSERT INTO `wp_postmeta` (`post_id`, `meta_key`, `meta_value`) VALUES (55, '_edit_lock', '1698679874:1')","postgresql":"INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (55, '_edit_lock', '1698679874:1') RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679877.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_sitemeta` (`site_id`, `meta_key`, `meta_value`) VALUES (1, '_site_transient_wp_remote_block_patterns_03fe7d7ccb043466cdff46c6061da4a5', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')","postgresql":"INSERT INTO wp_sitemeta (site_id, meta_key, meta_value) VALUES ('1', '_site_transient_wp_remote_block_patterns_03fe7d7ccb043466cdff46c6061da4a5', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')"}
{"mysql":"INSERT INTO `wp_sitemeta` (`site_id`, `meta_key`, `meta_value`) VALUES (1, '_site_transient_wp_remote_block_patterns_03fe7d7ccb043466cdff46c6061da4a5', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')","postgresql":"INSERT INTO wp_sitemeta (site_id, meta_key, meta_value) VALUES ('1', '_site_transient_wp_remote_block_patterns_03fe7d7ccb043466cdff46c6061da4a5', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"') RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679878.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_sitemeta` (`site_id`, `meta_key`, `meta_value`) VALUES (1, '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')","postgresql":"INSERT INTO wp_sitemeta (site_id, meta_key, meta_value) VALUES ('1', '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')"}
{"mysql":"INSERT INTO `wp_sitemeta` (`site_id`, `meta_key`, `meta_value`) VALUES (1, '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')","postgresql":"INSERT INTO wp_sitemeta (site_id, meta_key, meta_value) VALUES ('1', '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"') RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679884.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (1, '2023-10-30 15:31:24', '2023-10-30 15:31:24', '', '', 'New Post 123', '', 'inherit', 'revision', 'closed', 'closed', '', '55-revision-v1', '', '', '2023-10-30 15:31:24', '2023-10-30 15:31:24', 55, 0, '', '')","postgresql":"INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid) VALUES ('1', '2023-10-30 15:31:24', '2023-10-30 15:31:24', '', '', 'New Post 123', '', 'inherit', 'revision', 'closed', 'closed', '', '55-revision-v1', '', '', '2023-10-30 15:31:24', '2023-10-30 15:31:24', 55, 0, '', '')"}
{"mysql":"INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (1, '2023-10-30 15:31:24', '2023-10-30 15:31:24', '', '', 'New Post 123', '', 'inherit', 'revision', 'closed', 'closed', '', '55-revision-v1', '', '', '2023-10-30 15:31:24', '2023-10-30 15:31:24', 55, 0, '', '')","postgresql":"INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid) VALUES ('1', '2023-10-30 15:31:24', '2023-10-30 15:31:24', '', '', 'New Post 123', '', 'inherit', 'revision', 'closed', 'closed', '', '55-revision-v1', '', '', '2023-10-30 15:31:24', '2023-10-30 15:31:24', 55, 0, '', '') RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679897.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('category_children', 'a:0:{}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)","postgresql":"INSERT INTO \"wp_options\" (\"option_name\", \"option_value\", \"autoload\") VALUES ('category_children', 'a:0:{}', 'yes') ON CONFLICT (\"option_name\") DO UPDATE SET \"option_name\" = EXCLUDED.\"option_name\", \"option_value\" = EXCLUDED.\"option_value\", \"autoload\" = EXCLUDED.\"autoload\""}
{"mysql":"INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('category_children', 'a:0:{}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)","postgresql":"INSERT INTO \"wp_options\" (\"option_name\", \"option_value\", \"autoload\") VALUES ('category_children', 'a:0:{}', 'yes') ON CONFLICT (\"option_name\") DO UPDATE SET \"option_name\" = EXCLUDED.\"option_name\", \"option_value\" = EXCLUDED.\"option_value\", \"autoload\" = EXCLUDED.\"autoload\" RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679908.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_term_taxonomy` (`term_id`, `taxonomy`, `description`, `parent`, `count`) VALUES (3, 'post_tag', 'tag', 0, 0)","postgresql":"INSERT INTO wp_term_taxonomy (term_id, taxonomy, description, parent, count) VALUES (3, 'post_tag', 'tag', 0, 0)"}
{"mysql":"INSERT INTO `wp_term_taxonomy` (`term_id`, `taxonomy`, `description`, `parent`, `count`) VALUES (3, 'post_tag', 'tag', 0, 0)","postgresql":"INSERT INTO wp_term_taxonomy (term_id, taxonomy, description, parent, count) VALUES (3, 'post_tag', 'tag', 0, 0) RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679917.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_postmeta` (`post_id`, `meta_key`, `meta_value`) VALUES (57, '_edit_lock', '1698679917:1')","postgresql":"INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (57, '_edit_lock', '1698679917:1')"}
{"mysql":"INSERT INTO `wp_postmeta` (`post_id`, `meta_key`, `meta_value`) VALUES (57, '_edit_lock', '1698679917:1')","postgresql":"INSERT INTO wp_postmeta (post_id, meta_key, meta_value) VALUES (57, '_edit_lock', '1698679917:1') RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679920.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_sitemeta` (`site_id`, `meta_key`, `meta_value`) VALUES (1, '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')","postgresql":"INSERT INTO wp_sitemeta (site_id, meta_key, meta_value) VALUES ('1', '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')"}
{"mysql":"INSERT INTO `wp_sitemeta` (`site_id`, `meta_key`, `meta_value`) VALUES (1, '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"')","postgresql":"INSERT INTO wp_sitemeta (site_id, meta_key, meta_value) VALUES ('1', '_site_transient_wp_remote_block_patterns_0dc4db57500f00dee60778de7fb84b69', 'O:8:\"WP_Error\":3:{s:6:\"errors\";a:1:{s:19:\"http_request_failed\";a:1:{i:0;s:95:\"cURL error 35: OpenSSL\/3.1.4: error:0A000152:SSL routines::unsafe legacy renegotiation disabled\";}}s:10:\"error_data\";a:0:{}s:18:\"') RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679923.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (1, '2023-10-30 15:32:03', '2023-10-30 15:32:03', '', '', 'Test Page', '', 'inherit', 'revision', 'closed', 'closed', '', '57-revision-v1', '', '', '2023-10-30 15:32:03', '2023-10-30 15:32:03', 57, 0, '', '')","postgresql":"INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid) VALUES ('1', '2023-10-30 15:32:03', '2023-10-30 15:32:03', '', '', 'Test Page', '', 'inherit', 'revision', 'closed', 'closed', '', '57-revision-v1', '', '', '2023-10-30 15:32:03', '2023-10-30 15:32:03', 57, 0, '', '')"}
{"mysql":"INSERT INTO `wp_posts` (`post_author`, `post_date`, `post_date_gmt`, `post_content`, `post_content_filtered`, `post_title`, `post_excerpt`, `post_status`, `post_type`, `comment_status`, `ping_status`, `post_password`, `post_name`, `to_ping`, `pinged`, `post_modified`, `post_modified_gmt`, `post_parent`, `menu_order`, `post_mime_type`, `guid`) VALUES (1, '2023-10-30 15:32:03', '2023-10-30 15:32:03', '', '', 'Test Page', '', 'inherit', 'revision', 'closed', 'closed', '', '57-revision-v1', '', '', '2023-10-30 15:32:03', '2023-10-30 15:32:03', 57, 0, '', '')","postgresql":"INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_content, post_content_filtered, post_title, post_excerpt, post_status, post_type, comment_status, ping_status, post_password, post_name, to_ping, pinged, post_modified, post_modified_gmt, post_parent, menu_order, post_mime_type, guid) VALUES ('1', '2023-10-30 15:32:03', '2023-10-30 15:32:03', '', '', 'Test Page', '', 'inherit', 'revision', 'closed', 'closed', '', '57-revision-v1', '', '', '2023-10-30 15:32:03', '2023-10-30 15:32:03', 57, 0, '', '') RETURNING *"}
2 changes: 1 addition & 1 deletion tests/stubs/insert-int_1698679936.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"mysql":"INSERT INTO `wp_comments` (`comment_post_ID`, `comment_author_IP`, `comment_author`, `comment_author_email`, `comment_author_url`, `comment_date`, `comment_date_gmt`, `comment_content`, `comment_karma`, `comment_approved`, `comment_agent`, `comment_type`, `comment_parent`, `user_id`) VALUES (55, '10.42.0.8', 'root', '[email protected]', 'http:\/\/example.com\/site', '2023-10-30 15:32:16', '2023-10-30 15:32:16', 'This is a comment', 0, '1', 'Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/118.0.0.0 Safari\/537.36', 'comment', 0, 1)","postgresql":"INSERT INTO wp_comments (\"comment_post_ID\" , comment_author_IP, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, user_id) VALUES (55, '10.42.0.8', 'root', '[email protected]', 'http:\/\/example.com\/site', '2023-10-30 15:32:16', '2023-10-30 15:32:16', 'This is a comment', 0, '1', 'Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/118.0.0.0 Safari\/537.36', 'comment', 0, 1)"}
{"mysql":"INSERT INTO `wp_comments` (`comment_post_ID`, `comment_author_IP`, `comment_author`, `comment_author_email`, `comment_author_url`, `comment_date`, `comment_date_gmt`, `comment_content`, `comment_karma`, `comment_approved`, `comment_agent`, `comment_type`, `comment_parent`, `user_id`) VALUES (55, '10.42.0.8', 'root', '[email protected]', 'http:\/\/example.com\/site', '2023-10-30 15:32:16', '2023-10-30 15:32:16', 'This is a comment', 0, '1', 'Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/118.0.0.0 Safari\/537.36', 'comment', 0, 1)","postgresql":"INSERT INTO wp_comments (\"comment_post_ID\" , comment_author_IP, comment_author, comment_author_email, comment_author_url, comment_date, comment_date_gmt, comment_content, comment_karma, comment_approved, comment_agent, comment_type, comment_parent, user_id) VALUES (55, '10.42.0.8', 'root', '[email protected]', 'http:\/\/example.com\/site', '2023-10-30 15:32:16', '2023-10-30 15:32:16', 'This is a comment', 0, '1', 'Mozilla\/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/118.0.0.0 Safari\/537.36', 'comment', 0, 1) RETURNING *"}
Loading

0 comments on commit 8d420dc

Please sign in to comment.