lib/nose/backend.rb 1 location
|
@@ 291-298 (lines=8) @@
|
| 288 |
|
|
| 289 |
|
# Find plans for a given query |
| 290 |
|
# @return [Plans::QueryPlan] |
| 291 |
|
def find_query_plan(query) |
| 292 |
|
plan = @plans.find do |possible_plan| |
| 293 |
|
possible_plan.query == query |
| 294 |
|
end unless query.nil? |
| 295 |
|
fail PlanNotFound if plan.nil? |
| 296 |
|
|
| 297 |
|
plan |
| 298 |
|
end |
| 299 |
|
|
| 300 |
|
# Prepare all the steps for executing a given query |
| 301 |
|
# @return [Array<StatementStep>] |
lib/nose/random.rb 1 location
|
@@ 383-386 (lines=4) @@
|
| 380 |
|
private |
| 381 |
|
|
| 382 |
|
# Clamp the value to the given minimum |
| 383 |
|
def clamp(value) |
| 384 |
|
value = value.to_i if @integer |
| 385 |
|
[@min, value].max unless @min.nil? |
| 386 |
|
end |
| 387 |
|
end |
| 388 |
|
end |
| 389 |
|
|