This project is archived and is in readonly mode.
SQLiteAdapter::select_rows misses columns when column names are ambiguous
-
Neeraj Singh
- Tag set to rails3, sqlite
I have confirmed that it is indeed an issue with SQLite database. It works fine with MySQL.
Will be looking into the difference between how MySQL handles it and how SQLite handles the query.
I did my check on rails3 edge.
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
-
Richard Bunch
- State changed from stale to open
- Tag changed from rails3, sqlite to bug sqlite
I have tested and this bug is still present with rails 3.0.3, ruby-1.9.2-p136, sqlite 3.7.5, Windows XP. Looking at the latest code on the git browser, it looks like the bug is still in there.
I notice my "monkey patch" is nothing but a copy of the original code with debug printing. I clearly copied the wrong code. It should be:
module ActiveRecord module ConnectionAdapters
class SQLiteAdapter def select_rows(sql, name = nil) execute(sql, name).map do |row| new_row = [] for i in (0...row.size) if row[i] then new_row << row[i] else break end end new_row end end end
end endI think making this change in the original sqlite_adapter.rb should solve the problem. I will try to make a patch, if I have time.
[state:open]
-
Richard Bunch
- Tag changed from bug sqlite to rails3 sqlite bug
-
Richard Bunch
- Tag changed from rails3 sqlite bug to rails3, rails3.0.3, sqlite_adapter
Sorry, my script blocker messed up the tags.
-
rails
- Tag changed from rails3, rails3.0.3, sqlite_adapter to rails3, rails303, sqlite_adapter
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale