aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/mysql
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #21288 from yahonda/mysql_requires_passwordArthur Nogueira Neves2015-10-121-1/+1
|\ | | | | Allow mysql and mysql2 tests run by database user with password
| * Allow mysql and mysql2 tests run by database user with passwordYasuo Honda2015-08-181-1/+1
| |
* | Remove unused `pk_and_sequence_for` in AbstractMysqlAdapterRyuta Kamizono2015-10-081-24/+0
| | | | | | | | | | | | `pk_and_sequence_for` is implemented for PG and MySQL adapters (not implemented for Sqlite3 adapter). But MySQL adapters are not using `pk_and_sequence_for` already.
* | fix `bin/test -a sqlite3_mem`.Yves Senn2015-09-221-19/+13
| | | | | | | | | | | | | | | | | | | | | | | | We should not run MysqlAdapter tests when running with `sqlite3_mem`. This also moves the test-case outside the MysqlAdapter namespace. This will prevent the following error when running everything: ``` 1) Error: TestAdapterWithInvalidConnection#test_inspect_on_Model_class_does_not_raise: TypeError: superclass mismatch for class MysqlAdapter ```
* | Eliminate `test_tables_quoting` following seems to be left in #21687Ronak Jangir2015-09-211-8/+0
| |
* | :scissors: empty line at the top of filesAkira Matsuda2015-09-211-1/+0
| |
* | Merge pull request #17696 from kamipo/unsigned_integer_supportJeremy Daer2015-09-191-2/+37
|\ \ | | | | | | | | | Add `unsigned` support for numeric data types in MySQL
| * | Add `unsigned` types for numeric data types in MySQLRyuta Kamizono2015-09-181-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case of using `unsigned` as the type: create_table :foos do |t| t.unsigned_integer :unsigned_integer t.unsigned_bigint :unsigned_bigint t.unsigned_float :unsigned_float t.unsigned_decimal :unsigned_decimal, precision: 10, scale: 2 end
| * | Add `unsigned` support for numeric data types in MySQLRyuta Kamizono2015-09-181-2/+24
| |/ | | | | | | | | | | | | | | | | | | | | Example: create_table :foos do |t| t.integer :unsigned_integer, unsigned: true t.bigint :unsigned_bigint, unsigned: true t.float :unsigned_float, unsigned: true t.decimal :unsigned_decimal, unsigned: true, precision: 10, scale: 2 end
* | Merge pull request #19086 from kamipo/move_explain_into_abstract_mysql_adapterJeremy Daer2015-09-191-0/+27
|\ \ | | | | | | | | | Move `explain` into `AbstractMysqlAdapter`
| * | Move `explain` into `AbstractMysqlAdapter`Ryuta Kamizono2015-03-011-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Common methods in both mysql adapters are should be added to `AbstractMysqlAdapter`, but some methods had been added to `Mysql2Adapter`. (8744632f, 0306f82e, #14359) Some methods already moved from `Mysql2Adapter` to `AbstractMysqlAdapter`. (#17601, #17998) Common methods in both mysql adapters are remaining only the `explain` method in `Mysql2Adapter`.
* | | Merge pull request #21607 from kamipo/remove_unnecessary_display_widthJeremy Daer2015-09-192-5/+5
|\ \ \ | | | | | | | | Remove unnecessary display width
| * | | Remove unnecessary display widthRyuta Kamizono2015-09-162-5/+5
| | |/ | |/| | | | | | | | | | | | | | | | The **(11)** does not affect the storage size of the data type, which for an INT will always be 4 bytes. It affects the **display width**. http://www.tocker.ca/2015/07/02/proposal-to-deprecate-mysql-integer-display-width-and-zerofill.html
* | | Should test both mysql adaptersRyuta Kamizono2015-09-201-10/+8
| | | | | | | | | | | | | | | Some test cases are testing only mysql adapter. We should test mysql2 adapter also.
* | | Remove `@connection` in `StatementPool`Ryuta Kamizono2015-09-201-1/+1
|/ / | | | | | | | | `@connection` in `StatementPool` is only used for PG adapter. No need for abstract `StatementPool` class.
* | use `assert_not` instead of `refute` as mentioned in our guides.Yves Senn2015-08-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | As described in the "Follow Coding Conventions" section in our contribution guide (http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions) we favor `assert_not` over `refute`. While we don't usually make stylistic changes on it's own I opted to do it in this case. The reason being that test cases are usually copied as a starting point for new tests. This results in a spread of `refute` in files that have been using it already.
* | Remove ivar only when definedAkira Matsuda2015-07-241-2/+2
| | | | | | | | this fixes a failing test case
* | Ensure that microsecond precision is only used for version of mysql that ↵Jori Hardman2015-07-201-0/+14
| | | | | | | | support it. Fixes #19711
* | make it possible to run AR tests with bin/testYves Senn2015-06-1115-64/+54
| |
* | If specify `strict: :default` explicitly, do not set sql_mode.Ryuta Kamizono2015-05-261-0/+9
| | | | | | | | Related with #17370.
* | More exercise the create index sql testsRyuta Kamizono2015-05-041-0/+37
| |
* | Merge pull request #17569 from kamipo/dump_table_optionsRafael Mendonça França2015-05-031-0/+42
|\ \ | | | | | | | | | Correctly dump `:options` on `create_table` for MySQL
| * | Correctly dump `:options` on `create_table` for MySQLRyuta Kamizono2015-05-031-0/+42
| | |
* | | Remove unused requireRyuta Kamizono2015-05-031-1/+0
|/ /
* | Use `use_transactional_tests` in Active RecordPrem Sichanugrist2015-04-101-1/+1
| | | | | | | | | | | | `use_transactional_fixtures` was deprecated in favor of `use_transactional_tests` in Rails 5.0. This removes one warning while running test suite.
* | Merge pull request #17574 from kamipo/charset_collation_optionsJeremy Kemper2015-04-071-0/+54
|\ \ | | | | | | | | | Add charset and collation options support for MySQL string and text columns.
| * | Add `:charset` and `:collation` options support for MySQL string and text ↵Ryuta Kamizono2015-03-061-0/+54
| |/ | | | | | | | | | | | | | | | | | | | | columns Example: create_table :foos do |t| t.string :string_utf8_bin, charset: 'utf8', collation: 'utf8_bin' t.text :text_ascii, charset: 'ascii' end
* / Closes rails/rails#18864: Renaming transactional fixtures to transactional testsBrandon Weiss2015-03-163-3/+3
|/ | | | | | | | | | | | | | | | | | | | | | | | | I’m renaming all instances of `use_transcational_fixtures` to `use_transactional_tests` and “transactional fixtures” to “transactional tests”. I’m deprecating `use_transactional_fixtures=`. So anyone who is explicitly setting this will get a warning telling them to use `use_transactional_tests=` instead. I’m maintaining backwards compatibility—both forms will work. `use_transactional_tests` will check to see if `use_transactional_fixtures` is set and use that, otherwise it will use itself. But because `use_transactional_tests` is a class attribute (created with `class_attribute`) this requires a little bit of hoop jumping. The writer method that `class_attribute` generates defines a new reader method that return the value being set. Which means we can’t set the default of `true` using `use_transactional_tests=` as was done previously because that won’t take into account anyone using `use_transactional_fixtures`. Instead I defined the reader method manually and it checks `use_transactional_fixtures`. If it was set then it should be used, otherwise it should return the default, which is `true`. If someone uses `use_transactional_tests=` then it will overwrite the backwards-compatible method with whatever they set.
* Prefer `drop_table if_exists: true` over raw SQLRyuta Kamizono2015-02-181-1/+1
| | | | | Lowercase raw SQL has been replaced by 07b659c already. This commit replaces everything else of raw SQL.
* prefer `drop_table if_exists: true` over raw SQL.Yves Senn2015-02-182-2/+2
| | | | | | | /cc @yahonda This makes it easier for third party adapters to run our tests, even if that database does not support IF EXISTS.
* `Type#type_cast_from_database` -> `Type#deserialize`Sean Griffin2015-02-171-1/+1
|
* Extract `DateTimePrecisionTest`Ryuta Kamizono2015-02-131-87/+0
| | | | The datetime precision tests for any adapters is duplicated.
* Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-031-1/+0
| | | | onwards.
* Remove Relation#bind_paramsSean Griffin2015-01-272-6/+6
| | | | | | | | `bound_attributes` is now used universally across the board, removing the need for the conversion layer. These changes are mostly mechanical, with the exception of the log subscriber. Additional, we had to implement `hash` on the attribute objects, so they could be used as a key for query caching.
* Merge pull request #18067 from ↵Rafael Mendonça França2015-01-021-0/+87
|\ | | | | | | | | | | | | | | | | kamipo/format_datetime_string_according_to_precision Format the datetime string according to the precision of the datetime field. Conflicts: activerecord/CHANGELOG.md
| * Format the datetime string according to the precision of the datetime field.Ryuta Kamizono2015-01-021-0/+17
| | | | | | | | | | | | | | | | | | Incompatible to rounding behavior between MySQL 5.6 and earlier. In 5.5, when you insert `2014-08-17 12:30:00.999999` the fractional part is ignored. In 5.6, it's rounded to `2014-08-17 12:30:01`: http://bugs.mysql.com/bug.php?id=68760
| * Allow precision option for MySQL datetimes.Ryuta Kamizono2015-01-021-0/+70
|/
* Stop relying on columns in mysql quoting testsSean Griffin2015-01-011-6/+2
| | | | | The behavior tested by the removed lines is sufficiently covered elsewhere.
* Ensures that primary_key method will return nil when multi-pkArthur Neves2014-12-301-0/+6
| | | | | | | When table has a composite primary key, the `primary_key` method for sqlite3 and postgresql was only returning the first field of the key. Ensures that it will return nil instead, as AR dont support composite pks.
* Fix undesirable RangeError by Type::Integer. Add Type::UnsignedInteger.Ryuta Kamizono2014-12-121-0/+30
|
* Failure to rollback t.timestamps when within a change_table migrationnoam2014-12-031-1/+1
| | | | | | | | | | | | | When running the following migration: change_table(:table_name) { |t| t/timestamps } The following error was produced: wrong number of arguments (2 for 1) .... /connection_adapters/abstract/schema_statements.rb:851:in `remove_timestamps' This is due to `arguments` containing an empty hash as its second argument.
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-293-6/+4
|
* synchronize code and docs for `timestamps` and `add_timestamps`.Yves Senn2014-11-201-1/+1
| | | | | | | | This makes the following changes: * warn if `:null` is not passed to `add_timestamps` * `timestamps` method docs link to `add_timestamps` docs * explain where additional options go * adjust examples to include `null: false` (to prevent deprecation warnings)
* Remove the unused second argument to `substitute_at`Sean Griffin2014-11-171-1/+1
| | | | Oh hey, we got to remove some code because of that!
* rm `reorder_bind_params`Sean Griffin2014-11-171-1/+1
| | | | | | Arel handles this for us automatically. Updated tests, as BindParam is no longer a subclass of SqlLiteral. We should remove the second argument to substitute_at entirely, as it's no longer used
* Clear schema cache before each testAkira Matsuda2014-09-011-0/+1
|
* MySQL: set connection collation along with the charsetJeremy Kemper2014-08-301-0/+5
| | | | | | | | | | Sets the connection collation to the database collation configured in database.yml. Otherwise, `SET NAMES utf8mb4` will use the default collation for that charset (utf8mb4_general_ci) when you may have chosen a different collation, like utf8mb4_unicode_ci. This only applies to literal string comparisons, not column values, so it is unlikely to affect you.
* Merge pull request #16481 from sgrif/sg-change-default-timestampsDavid Heinemeier Hansson2014-08-171-1/+1
|\ | | | | Change the default `null` value for timestamps
| * Change the default `null` value for timestampsSean Griffin2014-08-121-1/+1
| | | | | | | | | | | | | | As per discussion, this changes the model generators to specify `null: false` for timestamp columns. A warning is now emitted if `timestamps` is called without a `null` option specified, so we can safely change the behavior when no option is specified in Rails 5.
* | [ci skip] fix spelling of overrideAkshay Vishnoi2014-08-131-1/+1
|/