partition the where values so we can access the removed ones
In batches test @total was assigned but not used. Use it in tests instead of Post.count
Merge pull request #10702 from divineforest/use-total-in-batches-test

Use @total variable created in the setup of batches tests instead of counting again.
the rake task `db:test:prepare` needs to load the configuration

Without loading the configuration the task will not perform any work.
Merge pull request #10711 from senny/10660_rake_db_test_prepare_needs_config

the rake task `db:test:prepare` needs to load the configuration
push partion logic down and initialization logic up
push partitioning up so bind elimination can get the removed wheres
remove bind values for where clauses that were removed
avoid creating a set if no where values are removed
Merge branch 'bindwhere'

* bindwhere:
  avoid creating a set if no where values are removed
  remove bind values for where clauses that were removed
  push partitioning up so bind elimination can get the removed wheres
  push partion logic down and initialization logic up
  partition the where values so we can access the removed ones
use drop rather than calculate the array length