aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | tests are responsible to clean up afterwards.Yves Senn2014-02-131-82/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | remove created state after test execution, not before the next test. This prevents the leak of the `ex` table outside of a single test.
| * | | | | Terminate the backend ourselves on PG 9.2+Matthew Draper2014-02-121-19/+29
| | | | | | | | | | | | | | | | | | | | | | | | This should make it harder to accidentally break this test.
| * | | | | test case to illustrate current PostgreSQL composite behavior.Yves Senn2014-02-111-0/+42
| | | | | |
| * | | | | Adjust test value so that timezone has no effectAndrew White2014-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the test is run in a timezone that is behind UTC it fails because the time generated is ahead of 0000-01-01 00:00:00. Just increase the time subtracted so that timezone has no effect.
| * | | | | Merge pull request #13688 from jbaudanza/psql-index-existsRafael Mendonça França2014-02-011-0/+12
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PostgreSQL implementation of SchemaStatements#index_name_exists? Conflicts: activerecord/CHANGELOG.md
| | * | | | | psql implementation of #index_name_exists?Jonathan Baudanza2014-01-161-0/+12
| | | | | | |
| * | | | | | Fixes issue with parsing whitespace content back from database - fixes #13907Mauricio Linhares2014-02-011-0/+12
| | | | | | |
* | | | | | | Merge branch 'master' into adequaterecordAaron Patterson2014-01-171-0/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: fix exception translation translate exceptions on prepared statement failure test to ensure bad prepared statements raise a StatementInvalid exception
| * | | | | | test to ensure bad prepared statements raise a StatementInvalid exceptionAaron Patterson2014-01-171-0/+6
| | | | | | |
* | | | | | | fixing explain tests for sqlite3Aaron Patterson2014-01-171-13/+13
| | | | | | |
* | | | | | | Merge branch 'master' into adequaterecordAaron Patterson2014-01-163-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Make AR::Base#touch fire the after_commit and after_rollback callbacks Fix test for cache_key + touched Revert "methods are defined right after the module_eval, so we don't need to do" Revert "Don't remove trailing slash from PATH_INFO for mounted apps" Add failing test for #13369 reset column information after fiddling with `Encoding.default_internal` we have `with_env_tz` as global test helper. Remove duplicate. isolate class attribute assignment in `migration_test.rb` use `teardown` for cleanup, not `setup`. tests without transactional fixtures need to cleanup afterwards. no need to `return skip` in tests. `skip` is enough. methods are defined right after the module_eval, so we don't need to do any line number maths Get rid of unused TransactionError constant Avoid converting :on option to array twice when defining commit/rollback callbacks Unify changelog entries about single quotes [ci skip] Use single quotes in generated files
| * | | | | | no need to `return skip` in tests. `skip` is enough.Yves Senn2014-01-163-3/+3
| | |_|_|/ / | |/| | | |
| * | | | | "string" isn't a valid column type for ActiveRecordAaron Patterson2014-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
* | | | | | match against bind valuesAaron Patterson2014-01-141-2/+2
| | | | | |
* | | | | | drop the dual encodings tableAaron Patterson2014-01-141-2/+2
| | | | | |
* | | | | | Merge branch 'master' into set_bindsAaron Patterson2014-01-141-15/+21
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: don't establish a new connection when testing with `sqlite3_mem`. sqlite >= 3.8.0 supports partial indexes Don't try to get the subclass if the inheritance column doesn't exist Enum mappings are now exposed via class methods instead of constants. Fix fields_for documentation with index option [ci skip] quick pass through Active Record CHANGELOG. [ci skip] [ci skip] Grammar correction single quotes for controller generated routes [ci skip] Added alias to CSRF Set NameError#name
| * | | | | don't establish a new connection when testing with `sqlite3_mem`.Yves Senn2014-01-141-15/+21
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes broken `rake test_sqlite3_mem` suite for Active Record. The problem is that that the old database with the schema is lost when establishing a new connection. Upon reconnting we are left with a blank database and tests down the line start failing.
* | | | | Merge branch 'master' into set_bindsAaron Patterson2014-01-1132-884/+1119
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (2794 commits) doc, API example on how to use `Model#exists?` with multiple IDs. [ci skip] Restore DATABASE_URL even if it's nil in connection_handler test [ci skip] - error_messages_for has been deprecated since 2.3.8 - lets reduce any confusion for users Ensure Active Record connection consistency Revert "ask the fixture set for the sql statements" Check `respond_to` before delegation due to: https://github.com/ruby/ruby/commit/d781caaf313b8649948c107bba277e5ad7307314 Adding Hash#compact and Hash#compact! methods MySQL version 4.1 was EOL on December 31, 2009 We should at least recommend modern versions of MySQL to users. clear cache on body close so that cache remains during rendering add a more restricted codepath for templates fixes #13390 refactor generator tests to use block form of Tempfile Fix typo [ci skip] Move finish_template as the last public method in the generator Minor typos fix [ci skip] make `change_column_null` reversible. Closes #13576. create/drop test and development databases only if RAILS_ENV is nil Revert "Speedup String#to" typo fix in test name. [ci skip]. `core_ext/string/access.rb` test what we are documenting. Fix typo in image_tag documentation ... Conflicts: activerecord/lib/active_record/associations/join_dependency/join_association.rb activerecord/lib/active_record/relation/query_methods.rb
| * | | | Make change_table use object of current database adapterNishant Modak2014-01-071-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Earlier, change_table was creating database-agnostic object. - After this change, it will create correct object based on current database adapter. - This will ensure that create_table and change_table will get same objects. - This makes update_table_definition method public and nodoc. - Fixes #13577 and #13503
| * | | | Change the inexistent database name to inexistent_activerecord_unittestYasuo Honda2014-01-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to make this grant statement described in the document works GRANT ALL PRIVILEGES ON inexistent_activerecord_unittest.* to 'rails'@'localhost';
| * | | | used user-defined configurations for running tests that might depend on ↵Kuldeep Aggarwal2013-12-293-3/+6
| | | | | | | | | | | | | | | | | | | | user's system configuration
| * | | | Move mysql2 test for when adapter will be loadedschneems2013-12-242-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When run with only the Mysql adapter, we get this failure: https://travis-ci.org/rails/rails/jobs/15937907#L2416 Porting the test over to only run when mysql2 is loaded
| * | | | Raise NoDatabaseError when db does not existschneems2013-12-242-0/+21
| | | | | | | | | | | | | | | Building on the work of #13427 this PR adds a helpful error message to the adapters: mysql, mysql2, and sqlite3
| * | | | Tidy up fix for PG extensions quotingCarlos Antonio da Silva2013-12-233-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Always pass in the column for quote_bound_value and quote using it in case it exists there.
| * | | | Serialize postgres' hstore, json and array types correctly in AR update methods.Tadas Tamosauskas2013-12-233-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #12261. Closes #12395. Conflicts: activerecord/CHANGELOG.md activerecord/test/cases/adapters/postgresql/array_test.rb activerecord/test/cases/adapters/postgresql/json_test.rb
| * | | | Do not consider PG array columns as number or text columnsCarlos Antonio da Silva2013-12-231-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code uses these checks in several places to know what to do with a particular column, for instance AR attribute query methods has a branch like this: if column.number? !value.zero? end This should never be true for array columns, since it would be the same as running [].zero?, which results in a NoMethodError exception. Fixing this by ensuring that array columns in PostgreSQL never return true for number?/text? checks. Since most of the array support was based on the postgres_ext lib, it's worth noting it does the same thing for numeric array columns too: https://github.com/dockyard/postgres_ext/blob/v1.0.0/lib/postgres_ext/active_record/connection_adapters/postgres_adapter.rb#L72 This extended the same logic for text columns to ensure consistency.
| * | | | Tell how to Create a Database in Error Messageschneems2013-12-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently if you attempt to use a database that does not exist you get an error: ``` PG::ConnectionBad FATAL: database "db_error" does not exist ``` The solution is easy, create and migrate your database however new developers may not know these commands by memory. Instead of requiring the developer to search for a solution, tell them how to fix the problem in the error message: ``` ActiveRecord::NoDatabase: FATAL: database "db_error" does not exist Run `$ bin/rake db:create db:migrate` to create your database ``` Active Record should not know about `rake db:migrate` so this additional information needs to come from the railtie. Potential alternative implementation suggestions are welcome.
| * | | | fix quoting non-stringsDamien Mathieu2013-12-221-0/+6
| | | | | | | | | | | | | | | | | | | | Closes #13444
| * | | | fix url connections for sqlite3Aaron Patterson2013-12-201-0/+22
| | | | |
| * | | | quoting: Check if id is a valid method before using itArthur Neves2013-12-191-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | Need to check if valud also respond_to :id before calling it, otherwise things could explode.
| * | | | Fix indent in PG array testsCarlos Antonio da Silva2013-12-191-5/+5
| | | | | | | | | | | | | | | | | | | | [ci skip]
| * | | | Merge pull request #13395 from kuldeepaggarwal/postgres-table-ref-regexCarlos Antonio da Silva2013-12-191-0/+12
| |\ \ \ \ | | | | | | | | | | | | modified regex for finding table_name from a multiline sql query in postgresql
| | * | | | Fix PostgreSQL insert to properly extract table name from multiline string SQL.Kuldeep Aggarwal2013-12-191-0/+12
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, executing an insert SQL in PostgreSQL with a command like this: insert into articles( number) values( 5152 ) would not work because the adapter was unable to extract the correct articles table name.
| * / / / Fix PostgreSQL range testsMatthew Draper2013-12-191-11/+11
| |/ / / | | | | | | | | | | | | The changes in c4044b2 meant the tests would error on a fresh DB.
| * | | support creating temporary tables from queriesCody Cutrer2013-12-141-0/+9
| | | | | | | | | | | | | | | | | | | | also override drop_table in AbstractMySQLAdapter to properly drop temporary tables without committing the transaction
| * | | refactor, reuse assertions in range_test.rb.Yves Senn2013-12-131-186/+111
| | | |
| * | | extract PG range tests from datatype_test.rb into range_test.rbYves Senn2013-12-132-282/+320
| | | |
| * | | Fix warnings on mysql2 explain testCarlos Antonio da Silva2013-12-101-3/+3
| | | |
| * | | Merge pull request #13248 from yahonda/support_mysql573_explainJeremy Kemper2013-12-091-3/+3
| |\ \ \ | | | | | | | | | | Support MySQL 5.7 explain
| | * | | Support MySQL 5.7 explainYasuo Honda2013-12-101-3/+3
| | | | |
| * | | | Remove `DEFAULT NULL` for primary key column to support MySQL 5.7.3Yasuo Honda2013-12-102-6/+6
| |/ / / | | | | | | | | | | | | Since MySQL 5.7.3 m13 does now allow primary key column is null.
| * | | Merge pull request #13054 from senny/remove_oracle_testsYves Senn2013-11-271-17/+0
| |\ \ \ | | | | | | | | | | Remove leftover Oracle tests.
| | * | | the oracle adapter lives in a gem. Tests should live there as well.Yves Senn2013-11-261-17/+0
| | | | |
| * | | | remove leftover firebird adapter tests.Yves Senn2013-11-263-148/+0
| |/ / /
| * / / `rename_index`: add the new index before removing the old one.Yves Senn2013-11-261-6/+19
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This prevents the following error when a MySQL index on a foreign key column is renamed: ``` ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_engines_on_car_id': needed in a foreign key constraint: DROP INDEX `index_engines_on_car_id` ON `engines` ``` refs: #13038.
| * | Merge pull request #12779 from ↵Aaron Patterson2013-11-152-0/+10
| |\ \ | | | | | | | | | | | | | | | | dougbarth/dont_swallow_exceptions_during_transactional_statements_in_mysql Don't swallow exceptions in transctional statements
| | * | Remove tests for not swallowing exceptions.Doug Barth2013-11-152-42/+0
| | | | | | | | | | | | | | | | From PR, @tenderlove would prefer to not maintain these tests.
| | * | Don't swallow exceptions in transctional statementsDoug Barth2013-11-052-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MySQL connection adapater swallows all StandardError exceptions, which includes Mysql::Error and Mysql2::Error. The comment in the exception clause claims errors thrown here indicate that transactions aren't supported by the server but that isn't necessarily true. It's possible the MySQL server has gone away and swallowing a failed commit may let the application return a successful response when the data has not been saved. Also, replication libraries like Galera require that the application handle exceptions thrown at BEGIN/COMMIT. I'm unable to determine what version of MySQL threw an exception for transactional statements. I tried as far back as 3.23.49 with InnoDB disabled but BEGIN & COMMIT statements do not throw an error. If there's a real case for this logic to continue, we could instead push this behavior into a configuration setting. The exception swallowing has been there since the beginning: db045dbbf60b53dbe013ef25554fd013baf88134
| * | | Unifies mysql and mysql2 casting of booleans.Yves Senn2013-11-111-3/+3
| | | |
| * | | test cases to describe the MySQL boolean behavior.Yves Senn2013-11-111-0/+91
| | | |