aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* introduce `connection.supports_views?` and basic view tests.Yves Senn2014-09-091-4/+4
| | | | | | | `AbstractAdapter#supports_views?` defaults to `false` so we have to turn it on in adapter subclasses. Currently the flag only controls test execution. /cc @yahonda
* Freeze ADAPTER_NAME in adaptersAbdelkader Boudih2014-09-051-4/+0
|
* Add and Remove string/strip requireArthur Neves2014-09-021-0/+1
| | | | | | | Method .strip_heredoc is defined in active_support/core_ext/string/strip.rb so we need to require it. [fixes #16677]
* MySQL: set connection collation along with the charsetJeremy Kemper2014-08-301-1/+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.
* Change the default `null` value for timestampsSean Griffin2014-08-121-2/+2
| | | | | | | 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.
* Predicate methods don't need to return `true` / `false`Rafael Mendonça França2014-07-151-1/+1
|
* Fix version detection for RENAME INDEX support. Fixes #15931.Jeff Browning2014-07-151-1/+13
|
* If our connection is explicitly non-strict, tell MySQLMatthew Draper2014-07-061-2/+2
| | | | | | | | | | We default to making the connection strict, but have historically relied on the MySQL default when we want it to be non-strict. On some (recent?) versions of MySQL, new connections default to being strict, so if we've been told 'strict:false', we're obliged to pass that on. This fixes a test failure that we've seen turn up on relatively-new development machines, so we do already have a test covering it.
* Change method visibilityRafael Mendonça França2014-06-261-2/+2
|
* fk: review corrections: indent, visibility, syntax, wording.Yves Senn2014-06-261-11/+11
|
* fk: support for on_updateYves Senn2014-06-261-6/+11
|
* fk: rename `dependent` to `on_delete`Yves Senn2014-06-261-2/+2
|
* fk: support dependent option (:delete, :nullify and :restrict).Yves Senn2014-06-261-1/+13
|
* fk: generalize using `AlterTable` and `SchemaCreation`.Yves Senn2014-06-261-20/+4
|
* fk: `foreign_keys`, `add_foreign_key` and `remove_foreign_key` for MySQLYves Senn2014-06-261-0/+44
|
* Move writing unknown column exception to null attributeSean Griffin2014-06-261-1/+1
| | | | | | Making this change revealed several subtle bugs related to models with no primary key, and anonymous classes. These have been fixed as well, with regression tests added.
* Don't type cast the default on the columnSean Griffin2014-06-171-7/+6
| | | | | | | If we want to have type decorators mess with the attribute, but not the column, we need to stop type casting on the column. Where possible, we changed the tests to test the value of `column_defaults`, which is public API. `Column#default` is not.
* /mysql/i -> MySQL, Spell correct in continuation to #15555Akshay Vishnoi2014-06-141-2/+2
|
* Don't query the database schema when calling `serialize`Sean Griffin2014-06-071-8/+11
| | | | | | We need to decorate the types lazily. This is extracted to a separate API, as there are other refactorings that will be able to make use of it, and to allow unit testing the finer points more granularly.
* Refactor quoting of binary data to not be based on the column typeSean Griffin2014-06-031-4/+3
|
* Ensure we always use instances of the adapter specific column classSean Griffin2014-05-281-3/+4
| | | | | | - Create a consistent API across adapters for building new columns - Use it for custom properties so we don't get `UndefinedMethodError`s in stuff I'm implementing elsewhere.
* Remove unnecessary branch from quoting in MysqlSean Griffin2014-05-261-2/+0
| | | | This is already the behavior for `BigDecimal` in the abstract adapter.
* Refactor the type casting of booleans in MySQLSean Griffin2014-05-261-11/+8
|
* Push limit to type objectsSean Griffin2014-05-221-34/+21
| | | | | Columns and injected types no longer have any conditionals based on the format of SQL type strings! Hooray!
* Replace `type_cast` case statement with delegationSean Griffin2014-05-201-2/+1
| | | | | | | | All subclasses of column were now delegating `type_cast` to their injected type object. We can remove the overriding methods, and generalize it on the `Column` class itself. This also enabled us to remove several column classes completely, as they no longer had any meaningful behavior of their own.
* Remove :timestamp column typeSean Griffin2014-05-191-1/+0
| | | | | | | | | | | | The `:timestamp` type for columns is unused. All database adapters treat them as the same database type. All code in `ActiveRecord` which changes its behavior based on the column's type acts the same in both cases. However, when the type is passed to code that checks for the `:datetime` type, but not `:timestamp` (such as XML serialization), the result is unexpected behavior. Existing schema definitions will continue to work, and the `timestamp` type is transparently aliased to `datetime`.
* Delegate `Column#type` to the injected type objectSean Griffin2014-05-191-12/+14
| | | | | | | | | | | | | | | | The decision to wrap type registrations in a proc was made for two reasons. 1. Some cases need to make an additional decision based on the type (e.g. a `Decimal` with a 0 scale) 2. Aliased types are automatically updated if they type they point to is updated later. If a user or another adapter decides to change the object used for `decimal` columns, `numeric`, and `number` will automatically point to the new type, without having to track what types are aliased explicitly. Everything else here should be pretty straightforward. PostgreSQL ranges had to change slightly, since the `simplified_type` method is gone.
* Add a type object to Column constructorSean Griffin2014-05-171-4/+5
| | | | | | Part of #15134. In order to perform typecasting polymorphically, we need to add another argument to the constructor. The order was chosen to match the `oid_type` on `PostgreSQLColumn`.
* Changed extract_limit in class Column to return correct mysql float and ↵Aaron Nelson2014-05-161-0/+2
| | | | double limits
* Simplify building options hash in rename column method for mysqlCarlos Antonio da Silva2014-05-041-5/+6
|
* Get rid of conditional since column_for handles raising nowCarlos Antonio da Silva2014-05-041-7/+4
| | | | | column_for will raise in case column is not found for the given table, so there is no need to handle that here.
* refactor, move `column_for` to `AbstractAdapter` for better reuse.Yves Senn2014-05-041-8/+1
|
* Stringify variables names for mysql connectionsPaul Nikitochkin2014-04-301-5/+5
| | | | | | | For mysql2/mysql adapters, `sql_mode` variable name set in `database.yml` as string, was ignored and `sql_mode` was set to use strict mode. Fixes #14895
* push the collectors up to the abstract adapterAaron Patterson2014-04-091-20/+0
|
* mysql tests are passing againAaron Patterson2014-04-091-1/+7
|
* all tests passing on mysql2Aaron Patterson2014-04-091-1/+0
|
* working against arel/collector branchAaron Patterson2014-04-091-12/+4
|
* fix bind collecting for mysqlAaron Patterson2014-04-091-2/+22
|
* wrap the literal value before handing it to arelAaron Patterson2014-04-071-1/+2
| | | | this lets arel know how to correctly quote the value
* fix mysql buildsLuke Steensen2014-03-301-1/+1
|
* No need to gsub the stringRafael Mendonça França2014-03-261-1/+1
|
* Don't use send when we own the methodRafael Mendonça França2014-03-261-1/+1
|
* Make method privateRafael Mendonça França2014-03-261-5/+6
|
* Improve the methodRafael Mendonça França2014-03-261-5/+6
| | | | | | * cache `o.name` value * Avoid extra `concat` call * Avoid extra `<<` call
* Fixes bugs for using indexes in CREATE TABLE by adding checks for table ↵Steve Rice2014-03-251-1/+1
| | | | | | | | existence Also: - updates tests by stubbing table_exists? method - adds entry for creating indexes in CREATE TABLE to changelog
* create indexes inline in CREATE TABLE for MySQLCody Cutrer2014-03-251-0/+20
| | | | | | | | This is important, because adding an index on a temporary table after it has been created would commit the transaction Conflicts: activerecord/CHANGELOG.md
* Merge pull request #13040 from kamipo/case_sensitive_comparisonRafael Mendonça França2014-03-121-0/+8
|\ | | | | | | | | | | | | Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation. Conflicts: activerecord/CHANGELOG.md
| * Only use BINARY for mysql case sensitive uniqueness check when column has a ↵Ryuta Kamizono2013-11-261-0/+8
| | | | | | | | case insensitive collation.
* | Replace map.flatten with flat_map in activerecordErik Michaels-Ober2014-03-031-2/+2
| |
* | `execute` is a hotspot, so let's reduce branchesAaron Patterson2014-02-121-6/+2
| |