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.

sqlite missing ddl transactions and savepoints

#2080

The sqlite adapter is out of date regarding ddl transactions and savepoint support. This patch updates it.

Hard for you guys to confirm, so I have the forum post from drh where he states when DDL support in transactions came into sqlite, and the commit history of sqlite showing when savepoints arrived.

Reported by JasonKing · February 26th, 2009 @ 05:54 AM

State: resolved
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. JasonKing
    JasonKing
    • Tag changed from 2.2, sqlite, sqlite3, sqlite_adapter to 2.3, patch, sqlite, sqlite3, sqlite_adapter

    Just noticed another bug in the existing version comparisons. Attaching a new patch including both changesets.

    February 26th, 2009 @ 10:34 AM

  2. Repository
    Repository
    • State changed from new to committed

    (from [38136f86dc5504bde94dc7399d4a854023d7481f]) DDL transactions and savepoints for sqlite

    Sqlite has had DDL transactions since 2.0.0[1] and savepoints since 3.6.8[2]. This patch updates the connection_adapters.

    [1] http://tinyurl.com/sqlite-v2-0-0 [2] http://tinyurl.com/sqlite-v3-6-8

    Signed-off-by: Michael Koziarski michael@koziarski.com [#2080 state:committed] http://github.com/rails/rails/co...

    March 2nd, 2009 @ 05:47 AM

  3. Repository
    Repository
    • State changed from committed to open

    (from [818556ec4f237b19f28fdecdfe6037718cceba37]) Revert "DDL transactions and savepoints for sqlite"

    This reverts commit 38136f86dc5504bde94dc7399d4a854023d7481f.

    Caused several test failures on the ci box:

    http://ci.rubyonrails.org/builds... [#2080 state:open] http://github.com/rails/rails/co...

    March 2nd, 2009 @ 06:09 AM

  4. JasonKing
    JasonKing

    Fixed.

    I hadn't run the tests, but have now. All fixed to take account of the old VACUUM call in add_column which was preventing it from being wrapped in a transaction.

    March 2nd, 2009 @ 11:06 AM

  5. JasonKing
    JasonKing
    • Assigned user set to Michael Koziarski

    Not sure if I was meant to assign this to you Michael. I haven't seen any action on it, and wanted to make sure it doesn't slip off the plate.

    It's a good patch that will give sqlite3 users an important boost - especially for migrations.

    March 5th, 2009 @ 11:06 PM

  6. Michael Koziarski
    Michael Koziarski

    Yeah, you were meant to assign it to me :)

    
    -      def supports_count_distinct? #:nodoc:
    -        false
    -      end
    

    Why did you remove that?

    March 5th, 2009 @ 11:23 PM

  7. JasonKing
    JasonKing

    Because this is in SQLiteAdapter which SQLite2Adapter inherits from:

    @@@ruby def supports_count_distinct? #:nodoc: sqlite_version >= '3.2.6' end @@@@

    Which made it redundant in SQLite2Adapter.

    March 6th, 2009 @ 01:35 AM

  8. JasonKing
    JasonKing

    Oops:

    
    def supports_count_distinct? #:nodoc:
      sqlite_version >= '3.2.6'
    end
    

    March 6th, 2009 @ 01:36 AM

  9. JasonKing
  10. Michael Koziarski
    Michael Koziarski

    Looks good to me, I'll take a proper look tomorrow though.

    As for the comments, don't stress, I pretty much only use the emails anyway ;)

    March 6th, 2009 @ 02:54 AM

  11. Michael Koziarski
    Michael Koziarski

    This doesn't apply cleanly any more? but yes, this looks good and I'm happy to apply it.

    March 9th, 2009 @ 08:02 AM

  12. Michael Koziarski
    Michael Koziarski

    If you can upload a rebased version that is.

    March 9th, 2009 @ 08:02 AM

  13. JasonKing
  14. JasonKing
    JasonKing

    Just nudging this ticket - I've rebased it again...

    March 11th, 2009 @ 12:19 PM

  15. Jeremy Kemper
    Jeremy Kemper
    • State changed from open to verified
    • Milestone cleared.

    Works for me. We indent with 2 spaces, not tabs, though.

    March 11th, 2009 @ 04:08 PM

  16. JasonKing
    JasonKing

    Fixed, and rebased again.

    March 11th, 2009 @ 04:29 PM

  17. Pratik
    Pratik

    The patch should also modify migration_test.rb#test_migrator_one_up_with_exception_and_rollback for testing that with sqlite adapters supporting ddl transactions.

    March 12th, 2009 @ 01:37 PM

  18. Pratik
    Pratik

    This is related to #1651. The patch should incorporate tests from the trac patch if relevant.

    March 12th, 2009 @ 05:27 PM

  19. JasonKing
    JasonKing

    Thanks. I'll have some time later today (about 8 hours from now) and will take a look and add these tests then.

    March 13th, 2009 @ 12:34 AM

  20. Pratik
    Pratik
    • State changed from verified to open

    March 13th, 2009 @ 11:16 AM

  21. JasonKing
  22. JasonKing
    JasonKing

    Pulled out the savepoint stuff and rebased (and squashed some whitespace I pulled in when I pasted the tests from #1651).

    March 14th, 2009 @ 12:35 PM

  23. Pratik
    Pratik
    • Assigned user changed from Michael Koziarski to Pratik

    You should probably open a new ticket for the savepoints.

    Thanks

    March 14th, 2009 @ 12:52 PM

  24. Repository
    Repository
    • State changed from open to resolved

    (from [ac3848201dfd7400708d3ccae0acb9388318fb99]) SQLite adapters now support DDL transactions [#2080 state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    March 14th, 2009 @ 01:02 PM