Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

connection#insert no longer returns last inserted id

#384

In rails 2.0, I have several postgres migrations that rely on @connection.insert returning the last inserted id. When I upgraded to the 2.1 gems, this stopped working, and #insert now returns nil. The docs still say that #insert should return the last inserted id.

Attached is a patch that adds a failing unit test for this behavior. Note: I couldn't find ANY tests for any of the DatabaseStatements methods. I created a new file, test/cases/database_statements_test.rb.

Reported by Paul Sadauskas (Rando) · June 10th, 2008 @ 10:33 PM

State: resolved
Milestone: 2.1.1
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 2.1.1
    • State changed from new to open
    • Assigned user set to Jeremy Kemper

    June 10th, 2008 @ 10:41 PM

  2. Repository
    Repository
    • State changed from open to resolved

    (from [a065144afb9e8b4666a5097e3e81de80251e86e6]) PostgreSQL: insert looks up pk and sequence name if not given. [#384 state:resolved]

    http://github.com/rails/rails/co...

    June 10th, 2008 @ 11:54 PM

  3. Repository
    Repository

    (from [b440aeb54a969ec25228881dd02eb019bbfd7c1e]) PostgreSQL: insert looks up pk and sequence name if not given. [#384 state:resolved]

    http://github.com/rails/rails/co...

    June 10th, 2008 @ 11:54 PM