summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJamis Buck <jamis@37signals.com>2008-01-26 17:43:45 +0000
committerJamis Buck <jamis@37signals.com>2008-01-26 17:43:45 +0000
commita5fc4d4cb9d3327b2f9bd2977853ec150484086d (patch)
tree652974846e5abb5978f59a1cf35e97d4061a96d1
parentff8eb33767c36aa0fdeb1c23e0b60f58767aad7a (diff)
downloadthird_party-sqlite3-ruby-a5fc4d4cb9d3327b2f9bd2977853ec150484086d.tar.gz
third_party-sqlite3-ruby-a5fc4d4cb9d3327b2f9bd2977853ec150484086d.tar.xz
third_party-sqlite3-ruby-a5fc4d4cb9d3327b2f9bd2977853ec150484086d.zip
check for TEXT columns before NULL, on the assumption that TEXT will be more common than NULL (thanks Erik Veenstra)
-rw-r--r--lib/sqlite3/resultset.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlite3/resultset.rb b/lib/sqlite3/resultset.rb
index 0b496b6..db0f262 100644
--- a/lib/sqlite3/resultset.rb
+++ b/lib/sqlite3/resultset.rb
@@ -123,7 +123,9 @@ module SQLite3
@driver.data_count( @stmt.handle ).times do |column|
type = @driver.column_type( @stmt.handle, column )
- if type == Constants::ColumnType::NULL
+ if type == Constants::ColumnType::TEXT
+ row << @driver.column_text( @stmt.handle, column )
+ elsif type == Constants::ColumnType::NULL
row << nil
elsif type == Constants::ColumnType::BLOB
row << @driver.column_blob( @stmt.handle, column )