Permalink
Browse files

Remove some functionality from query function that is not needed there.

  • Loading branch information...
posulliv committed Dec 6, 2010
1 parent dced2c6 commit b9c70ac6ccb12a07536e7226407d1f65b3294e8b
Showing with 5 additions and 9 deletions.
  1. +5 −9 lib/drizzle/connection.rb
View
@@ -131,15 +131,8 @@ def set_db(db_name)
# execute a query and construct a result object
#
def query(query)
- if @randomize_queries == false or @rand_key.empty?
- res = LibDrizzle.drizzle_query_str(@con_ptr, nil, query, @ret_ptr)
- check_return_code
- else
- rand_query = randomize_query(query)
- res = LibDrizzle.drizzle_query_str(@con_ptr, nil, rand_query, @ret_ptr)
- check_return_code
- end
-
+ res = LibDrizzle.drizzle_query_str(@con_ptr, nil, query, @ret_ptr)
+ check_return_code
Result.new(res)
end
@@ -148,6 +141,9 @@ def query(query)
# keywords
#
def randomize_query(query)
+ if @rand_key.empty?
+ return query
+ end
toks = query.split(" ")
new_query = ""
toks.each do |token|

0 comments on commit b9c70ac

Please sign in to comment.