Comments

mondrake created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new3.98 KB

This seems nice.

alexpott’s picture

StatusFileSize
new1.45 KB
new4.33 KB
alexpott’s picture

StatusFileSize
new849 bytes
new4.31 KB

Less variables.

mondrake’s picture

Status: Needs review » Reviewed & tested by the community

Unless I'm mistaken, this is reducing PgSql test run times by 3 to 4 minutes?

mondrake’s picture

I do not think we need a CR here since this is an implementation detail.

daffie’s picture

Status: Reviewed & tested by the community » Needs work

I had my doubts about the if we needed the try-catch part, but I saw in the patch from comment #2 that it did not have the try-catch part and the testbot did not liked that patch.
There is already a lot of inserts being run by the testbot, therefore I do not see the need for extra tests.
To me it is almost RTBC, I have just 1 minor nitpick:

+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
@@ -149,14 +129,27 @@ public function __toString() {
+        $query .= ' RETURNING ' . $table_information->serial_fields[0];

We could add a comment that adding this to the insert statement will have the effect that the insert query will return the last inserted id. As this is not standard SQL.

@mondrake: Good find!

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new795 bytes
new4.46 KB
daffie’s picture

Status: Needs review » Reviewed & tested by the community

All changes in the patch look good to me.
For me it is RTBC.

@alexpott: Then my apologies, its your good find!

  • catch committed 340ff83 on 9.2.x
    Issue #3185399 by alexpott, mondrake, daffie: Use RETURNING to determine...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed 340ff83 and pushed to 9.2.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.