aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/query_cache_test.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* | Use old typecasting method if no type casted binds are passed inAaron Patterson2016-10-201-1/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | Query cache doesn't type cast bind parameters since it isn't actually querying the database, so it can't pass those values in. Type casting in the query cache method would cause the values to be type cast twice in the case that there is a cache miss (since the methods it calls will type cast *again*). If logging is disabled, then adding the type cast code to the query cache method will needlessly typecast the values (since the only reason those values are type cast is for display in the logs). Fixes #26828.
* | Fixnum and Bignum are deprecated in Ruby trunkMatthew Draper2016-10-081-1/+1
| | | | | | | | https://bugs.ruby-lang.org/issues/12739
* | Fix "warning: assigned but unused variable - task"Ryuta Kamizono2016-08-261-1/+1
| |
* | Test that AR query cache isn't busted when types are not same objectJames Coleman2016-08-241-0/+20
| | | | | | | | | | | | | | | | | | | | This is fixed in 5.0 as an ancillary part of 574f255629a45cd67babcfb9bb8e163e091a53b8 but here I also add a test for the condition. I'd previously backported the fix (and added a test) in the below commit; this brings the fix back up to master. (cherry picked from commit fce3dbf30241f2a65c777e192a7171b0eea81453)
* | applies new string literal convention in activerecord/testXavier Noria2016-08-061-21/+21
| | | | | | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* | Fix `payload[:class_name]` to `payload[:spec_name]`Ryuta Kamizono2016-07-171-0/+2
| | | | | | | | | | | | Follow up to #20818. `retrieve_connection` is passed `spec_name` instead of `klass` since #24844.
* | Remove unused `ActiveRecord::Base.connection_id`Sean Griffin2016-06-291-12/+0
|/ | | | | | | | This method appears to have been partially used in connection pool caching, but it was introduced without much reasoning or any tests. One edge case test was added later on, but it was focused on implementation details. This method is no longer used outside of tests, and as such is removed.
* Fix postgresql query_cache testArthur Neves2016-06-141-0/+1
|
* Respect the current `connected?` method when calling `cache`Arthur Neves2016-06-141-0/+15
| | | | | | Before we enable query caching we check if the connection is connected. Before this fix we were always checking against the main connection, and not the model connection.
* Remove not needed line on testArthur Neves2016-06-141-1/+0
|
* Support for unified Integer class in Ruby 2.4+Jeremy Daer2016-05-181-3/+2
| | | | | | | | Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005 * Forward compat with new unified Integer class in Ruby 2.4+. * Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3. * Drops needless Fixnum distinction in docs, preferring Integer.
* Publish AS::Executor and AS::Reloader APIsMatthew Draper2016-03-021-43/+13
| | | | | | These should allow external code to run blocks of user code to do "work", at a similar unit size to a web request, without needing to get intimate with ActionDipatch.
* Removed mocha from Active Record Part 1Ronak Jangir2015-08-251-32/+37
|
* PostgreSQL, Fix OID based type casts in C for primitive types.Lars Kanis2015-03-251-1/+1
| | | | | | | | | | The type map was introduced in aafee23, but wasn't properly filled. This mainly adjusts many locations, that expected strings instead of integers or boolean. add_pg_decoders is moved after setup of the StatementPool, because execute_and_clear could potentially make use of it.
* Revert ":cut: remove unnecessary rescue Exceptions"Yves Senn2015-03-061-1/+1
| | | | | | | | | | | | | | | | | This reverts commit ff18049ca6f27deb7e7f955478e1464f8d756332. This broke the AR build for every adapter: 1) Error: AssociationCallbacksTest#test_dont_add_if_before_callback_raises_exception: Exception: You can't add a post 2) Failure: QueryCacheTest#test_query_cache_doesnt_leak_cached_results_of_rolled_back_queries [/Users/senny/Projects/rails/activerecord/test/cases/query_cache_test.rb:235]: Expected: 1 Actual: 0 I'm reverting to get the build green again.
* :cut: remove unnecessary rescue ExceptionsAaron Patterson2015-03-051-1/+1
|
* Restore query cache on rollbackFlorian Weingarten2014-12-011-0/+32
|
* Make select_all on query cache accept a Relation without binds.Arthur Neves2014-03-131-0/+8
| | | | | [fixes #14361] [related #13886]
* use `teardown` for cleanup, not `setup`.Yves Senn2014-01-161-5/+2
| | | | | | | | | | | | This solves order dependent issues where the last test leaked the query cache state. This resulted in the following error: ``` QueryCacheExpiryTest#test_cache_is_expired_by_habtm_delete [test/cases/query_cache_test.rb:275]: not all expectations were satisfied unsatisfied expectations: - expected exactly twice, invoked once: #<ActiveRecord::ConnectionAdapters::SQLite3Adapter:0x7f93e0c65838>.clear_query_cache(any_parameters) ```
* Currently, we clear query_cache in cache block finish, even if we may ↵Vipul A M2013-12-031-0/+9
| | | | | | already have cache true. This commit takes into account the last cache_enabled value, before clearing query_cache.
* Standardize the use of current_adapter?Rafael Mendonça França2013-01-011-1/+1
|
* Fix #6951. Use query cache/uncache, when using not only database.yml but ↵kennyj2012-10-311-0/+11
| | | | also DATABASE_URL.
* Cleanup trailing whitespacesdfens2012-10-121-1/+1
|
* Restore connection_id on error.kennyj2012-07-231-0/+12
|
* fixing tests to deal with data differences between prepared statements and ↵Aaron Patterson2012-07-131-1/+1
| | | | | | | non-prepared statements Conflicts: activerecord/test/cases/query_cache_test.rb
* Disable query cache for lock queriesDamir Zekic2012-07-061-0/+8
| | | | Fixes #867
* Remove warnings and unused codeRafael Mendonça França2012-06-111-5/+0
|
* current AR::ConnectionAdapters::SQLite3Adapter supports only SQLite3 ~> 1.3.6Akira Matsuda2012-06-121-1/+1
|
* remove calls to find(:first), find(:last) and find(:all)Jon Leighton2012-04-261-3/+3
|
* Remove IdentityMapCarlos Antonio da Silva2012-03-131-1/+1
|
* use Rack::BodyProxy in activerecord middlewaresSergey Nartimov2012-01-161-13/+6
|
* Added failing test case for changing schema in migration not clearing the ↵Joe Van Dyk2011-10-271-0/+12
| | | | prepared statement cache
* Fixed BodyProxy.new for tests! for wrong argumentArun Agrawal2011-10-081-1/+1
|
* fix test error when running with postgresql.Arun Agrawal2011-09-181-2/+4
| | | | | This Sqlite3 should be in if block. Was giving error because sqlite3 is not loaded
* Fixed test for JRuby. Arun Agrawal2011-09-181-1/+2
| | | for Sqlite3 in AR-JDBC.It's Jdbc::SQLite3::VERSION
* fixing typoAaron Patterson2011-08-281-1/+1
|
* clear and disable query cache when an exception is raised from called middlewareAaron Patterson2011-08-281-1/+27
|
* Fix inconsistencies by being polite to the wrapped body. Needed for ↵Steve Hodgkiss2011-06-181-0/+11
| | | | Rack::Sendfile to function properly. See issue #1761.
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* ensure query cache is cleared when Rack body is closed, fixes bug reported ↵Aaron Patterson2011-05-041-0/+11
| | | | on 951e18abea9c116fc5d6b330ca1dcd2890abe006
* introduce a body proxy to ensure that query cache is enabled during streamingAaron Patterson2011-05-021-0/+26
|
* more tests around cachingAaron Patterson2011-05-021-1/+10
|
* add a couple test cases surrounding query cache middlewareAaron Patterson2011-05-021-0/+18
|
* Use IM when trying to load records using ID.Emilio Tagua2011-04-041-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* use SQLite3::VERSION rather than the deprecated classAaron Patterson2011-01-101-1/+1
|
* removing many unused variablesAaron Patterson2010-11-161-1/+0
|
* fisting test nameAaron Patterson2010-10-271-1/+1
|
* making query cache work with prepared statementsAaron Patterson2010-10-271-0/+6
|
* one more mysql test left!Aaron Patterson2010-10-261-1/+1
|