This project is archived and is in readonly mode.

#16 ✓resolved
Frederick Cheung

Sqlite adapter doesn't handle quoted table names properly

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

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

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Referenced by

Pages