Skip to content

Commit

Permalink
Remove some functionality from query function that is not needed there.
Browse files Browse the repository at this point in the history
  • Loading branch information
posulliv committed Dec 6, 2010
1 parent dced2c6 commit b9c70ac
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/drizzle/connection.rb
Expand Up @@ -131,15 +131,8 @@ def set_db(db_name)
# execute a query and construct a result object # execute a query and construct a result object
# #
def query(query) def query(query)
if @randomize_queries == false or @rand_key.empty? res = LibDrizzle.drizzle_query_str(@con_ptr, nil, query, @ret_ptr)
res = LibDrizzle.drizzle_query_str(@con_ptr, nil, query, @ret_ptr) check_return_code
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

Result.new(res) Result.new(res)
end end


Expand All @@ -148,6 +141,9 @@ def query(query)
# keywords # keywords
# #
def randomize_query(query) def randomize_query(query)
if @rand_key.empty?
return query
end
toks = query.split(" ") toks = query.split(" ")
new_query = "" new_query = ""
toks.each do |token| toks.each do |token|
Expand Down

0 comments on commit b9c70ac

Please sign in to comment.