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 adapter doesn't handle quoted table names properly

#16

As of sqlite 3.5.7 (but not with 3.4.0), the sqlite adapter does not handle quoted table names properly. On 2.0.2 this was not apparent as its quote_table_name was a no-op, but this is not the case now. In particular this caused a number of eager loading failing tests.

The fix is simple: the following regular expression is used to turn foo.id into just foo

  record[key.sub(/^\w+\./, '')] = row[key]

It should be

  record[key.sub(/^"?\w+"?\./, '')] = row[key]

to cope with the possibility that the table name might be quoted

Reported by Frederick Cheung · April 17th, 2008 @ 07:34 PM

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

Activity

  1. Frederick Cheung
    Frederick Cheung
    • Title changed from Sqlite adapter does handle quoted table names properly to Sqlite adapter doesn't handle quoted table names properly

    April 18th, 2008 @ 07:52 PM

  2. Murray Steele
    Murray Steele

    +1.

    Tested with sqlite3 (3.5.7 / 3.5.6)

    April 19th, 2008 @ 10:36 AM

  3. Michael Koziarski