| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
`initialize_internal_metadata_table`
These internal initialize methods are no longer used internally.
|
|
|
|
|
| |
This reverts commit 39c77eb1843f79925c7195e8869afc7cb7323682, reversing
changes made to 9f6f51be78f8807e18fc6562c57af2fdbf8ccb56.
|
|
|
|
|
|
|
|
|
|
|
|
| |
`initialize_internal_metadata_table` internal public methods
These internal methods accidentally appeared in the doc, and so almost
useless. It is enough to create these internal tables directly, and
indeed do so in several places.
https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/schema.rb#L55
https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/railties/databases.rake#L6
https://github.com/rails/rails/blob/v5.0.1/activerecord/lib/active_record/tasks/database_tasks.rb#L230
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mysql2ConnectionTest#test_execute_after_disconnect was originally added to
catch a NoMethodError occuring in execute when the Mysql2Adapter has a nil
`@connection`. Pull request #26869 removed the error message check in that
test because the error message changed in the mysql2 gem, which caused the
test to fail. Now the test wouldn't catch the original bug since the
NoMethodError would get turned into a ActiveRecord::StatementInvalid
exception.
Check the cause of the StatementInvalid exception to make sure it is of the
correct type.
|
| |
|
| |
|
|\
| |
| | |
Simplify the regex for `unsigned?` method
|
| |
| |
| |
| |
| | |
It is enough to distinguish only the trailing `unsigned` and
`unsigned zerofill`.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the following warning.
```
test/caching_test.rb:986: warning: parentheses after method name is interpreted as
test/caching_test.rb:986: warning: an argument list, not a decomposed argument
test/cases/adapters/mysql2/reserved_word_test.rb:146: warning: parentheses after method name is interpreted as
test/cases/adapters/mysql2/reserved_word_test.rb:146: warning: an argument list, not a decomposed argument
```
Ref: https://github.com/ruby/ruby/commit/65e27c8b138d6959608658ffce2fa761842b8d24
|
|
|
|
| |
Raise `ActiveRecord::RangeError` when values that executed are out of range.
|
|\
| |
| | |
Fix `add_index` to normalize column names and options
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently does not work the following code.
```ruby
add_index(:people, ["last_name", "first_name"], order: { last_name: :desc, first_name: :asc })
```
Normalize column names and options to fix the issue.
|
| | |
|
| |
| |
| |
| | |
Fixes #27125.
|
| |
| |
| |
| |
| | |
If it's enabled globally, it's on regardless of how individual threads
are set.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Follow up to 99cf7558000090668b137085bfe6bcc06c4571dc.
|
| |
| |
| |
| |
| |
| |
| | |
- These tests were fixed earlier on master in https://github.com/rails/rails/commit/f13ec72664fd13d33d617103ca964a7592295854.
- They started failing in first place due to change in https://github.com/brianmario/mysql2/commit/f14023fcfee9e85e6fc1b0e568048811518f8c23.
- They will fail again when the message is changed in mysql2 so let's
not rely on the error message.
|
|/ |
|
|
|
|
|
|
| |
Test: JSON attribute value nil can be used in where(attr: nil)
Add changelog entry
|
|
|
|
|
|
| |
All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772.
But comments was still kept absolute position. This commit aligns
comments with method definitions for consistency.
|
|
|
|
| |
after `/' operator`
|
|
|
|
|
|
|
|
|
|
| |
By doing `@connection = nil` that means that we need nil checks before it
is used anywhere, but we weren't doing those checks. Instead, we get a
NoMethodError after using a connection after it fails to reconnect.
Neither of the other adapters set @connection to nil, just the mysql2
adapter. By just closing it, we avoid the need to check if we have a
connection object and it will produce an appropriate exception when used.
|
| |
|
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
| |
|
|\
| |
| |
| |
| |
| | |
Introduce new ActiveRecord transaction error classes
Closes #26018
|
| | |
|
| |
| |
| |
| | |
Fixes #25300.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Follow up of #20815.
```ruby
class CreatePeople < ActiveRecord::Migration[5.0]
def change
create_table :people do |t|
t.integer :int
t.bigint :bint
t.text :txt
t.binary :bin
end
end
end
```
Result.
In postgresql and sqlite3 adapters:
```ruby
ActiveRecord::Schema.define(version: 20160531141018) do
create_table "people", force: :cascade do |t|
t.integer "int"
t.bigint "bint"
t.text "txt"
t.binary "bin"
end
end
```
In mysql2 adapter:
```ruby
ActiveRecord::Schema.define(version: 20160531141018) do
create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
t.integer "int"
t.bigint "bint"
t.text "txt", limit: 65535
t.binary "bin", limit: 65535
end
end
```
After this patch:
```ruby
ActiveRecord::Schema.define(version: 20160531141018) do
create_table "people", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4" do |t|
t.integer "int"
t.bigint "bint"
t.text "txt"
t.binary "bin"
end
end
```
|
|
|
|
| |
or deadlocks
|
| |
|
|
|
|
| |
Fix failing tests
|
|
|
|
|
|
| |
Refactor of #22911.
Signed-off-by: Jeremy Daer <jeremydaer@gmail.com>
|
|
|
|
|
|
|
| |
in the case of sqlite.
Others adapters need to perform a check for validity.
Add coverage for mysql2 db type validation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we were assuming that the only valid types for encoding were
arrays and hashes. However, any JSON primitive is an accepted value by
both PG and MySQL.
This does involve a minor breaking change in the handling of `default`
in the schema dumper. This is easily worked around, as passing a
hash/array literal would have worked fine in previous versions of Rails.
However, because of this, I will not be backporting this to 4.2 or
earlier.
Fixes #24234
|
|
|
|
|
|
|
|
|
| |
We support microsecond datetime precision for MySQL 5.6.4+. MariaDB has
supported it since 5.3.0, but even 10.x versions return a compatible
version string like `5.5.5-10.1.8-MariaDB-log` which we parse as 5.5.5,
before MySQL supported microsecond precision.
Specialize our version check to account for MariaDB to fix.
|
|
|
|
|
|
| |
Because we define `QUOTED_TRUE` as `"1"` and `QUOTED_FALSE` as `"0"`.
And add test cases to ensure this commit does not break current
behavior even if the value of `attributes_before_type_cast` is false.
|
|
|
|
| |
For keep the default SQL mode.
|
|\
| |
| |
| |
| | |
kamipo/case_sensitive_comparison_for_non_string_column
The BINARY Operator is only needed for string columns
|
| |
| |
| |
| | |
Follow up to #13040.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before:
```ruby
create_table "big_numbers", force: :cascade do |t|
t.integer "bigint_column", limit: 8
end
```
After:
```ruby
create_table "big_numbers", force: :cascade do |t|
t.bigint "bigint_column"
end
```
|
|\ \
| | |
| | |
| | |
| | | |
kamipo/fix_tests_failure_with_prepared_statements_false
Fix tests failure with `prepared_statements: false`
|
| |/ |
|