| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Passing `name` to `tables` is already deprecated at #21601.
Passing `name` to `indexes` is also unused.
|
|\
| |
| | |
Active Record supports MySQL >= 5.1.10
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Follow up to #25307 and #23458. Related with #27422.
We are using `information_schema.referential_constraints` since #25307.
The table was introduced in MySQL 5.1.10. MySQL 5.0 is too old. It is
enough to support >= 5.1.10 at least.
MySQL 5.0 GA was released in Dec 2005 and already EOL in Dec 2011.
MySQL 5.1 GA was released in Dec 2008 and already EOL in Dec 2013.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As pointed out by @matthewd this change makes ImmutableString aware
of MysqlString's existence whereas previously MysqlString was only
overriding public API.
cc @kamipo
This reverts commit e632c2fa4cb60072a778ce95c952a0fa95e5b074, reversing
changes made to 334a7dcf107cd3ff1697163d331d289d6d65dcd7.
|
| |
| |
| |
| |
| |
| | |
The only difference between `Type::ImmutableString` and its subclasses
is the representation of the casted booleans. Prefer extracting
`casted_true`/`casted_false` and override these by subclasses.
|
| | |
|
| | |
|
|\ \
| | |
| | | |
Use `#execute` instead of `@connection.query`
|
| |/
| |
| |
| |
| | |
`@connection.query` bypasses instrumenting "sql.active_record".
This behavior preventing us from debugging SQLs which Rails generates.
|
| |
| |
| |
| |
| |
| | |
Some methods were added to public API in
5b14129d8d4ad302b4e11df6bd5c7891b75f393c and they should be not part of
the public API.
|
|/ |
|
|\
| |
| | |
Translate numeric value out of range to the specific exception
|
| |
| |
| |
| | |
Raise `ActiveRecord::RangeError` when values that executed are out of range.
|
|\ \
| |/
|/| |
Should be sync the `primary_key` definition with actually created
|
| |
| |
| |
| |
| |
| |
| |
| | |
Actually the `primary_key` definition is not used but the inconsistency
is confusing. Actual definition is `bigint auto_increment PRIMARY KEY`
so `UNSIGNED` and `(8)` is unnecessary.
See also #21607.
|
| |
| |
| |
| |
| | |
Raise `ActiveRecord::NotNullViolation` when a record cannot be inserted
or updated because it would violate a not null constraint.
|
|\ \
| |/
|/| |
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.
|
| |
| |
| |
| | |
that accepts results of SHOW FIELDS
|
| | |
|
| |
| |
| |
| |
| | |
A query may wait on a database-level lock, which could lead to a
deadlock between threads.
|
|\ \
| | |
| | | |
Use Regexp#match? rather than Regexp#===
|
| | |
| | |
| | |
| | | |
Follow up to 99cf7558000090668b137085bfe6bcc06c4571dc.
|
|/ /
| |
| |
| |
| |
| | |
Regexp#match? should be considered to be part of the Ruby core library. We are
emulating it for < 2.4, but not having to require the extension is part of the
illusion of the emulation.
|
| |
| |
| |
| |
| |
| |
| | |
MySQL 8.0.0-dmr `SUB_PART` column of `information_schema.statistics`
changed to varbinary(12), which is bigint(3) in MySQL 5.6.
Addresses #26774
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
```ruby
# Before
t.index ["firm_id", "type", "rating"], name: "company_index", order: {"rating"=>:desc}, using: :btree
# After
t.index ["firm_id", "type", "rating"], name: "company_index", order: { rating: :desc }, using: :btree
```
|
|/
|
|
|
| |
Currently blank comment does not dump to `db/schema.rb`. But created it
even if specified blank.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
Recently, the Rails team made an effort to keep the source code consistent, using Ruboco
(bb1ecdcc677bf6e68e0252505509c089619b5b90 and below). Some of the case
statements were missed.
This changes the case statements' formatting and is consistent with changes
in 810dff7c9fa9b2a38eb1560ce0378d760529ee6b and db63406cb007ab3756d2a96d2e0b5d4e777f8231.
|
|
|
|
|
|
|
|
|
| |
This reverts commit 3a1f6fe7b4a70bf0698b0684dd48ac712c6883b6.
This commit takes the code in a direction that I am looking to avoid.
The predicate builder should be purely concerned with AST construction
as it matters to methods like `where`. Things like case sensitivity
should continue to be handled elsewhere.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Strict mode controls how MySQL handles invalid or missing values in
data-change statements such as INSERT or UPDATE. If strict mode is not
in effect, MySQL inserts adjusted values for invalid or missing values
and produces warnings.
```ruby
def test_mysql_not_null_defaults_non_strict
using_strict(false) do
with_mysql_not_null_table do |klass|
record = klass.new
assert_nil record.non_null_integer
assert_nil record.non_null_string
assert_nil record.non_null_text
assert_nil record.non_null_blob
record.save!
record.reload
assert_equal 0, record.non_null_integer
assert_equal "", record.non_null_string
assert_equal "", record.non_null_text
assert_equal "", record.non_null_blob
end
end
end
```
It is inconsistent with other types that only text/blob defaults treated
as an empty string. This commit fixes the inconsistency.
|
|\
| |
| |
| |
| | |
kamipo/fix_error_message_for_out_of_range_integer_value
Fix error message for out of range byte size integer value for consistency
|
| |
| |
| |
| | |
Related f27a932, #25391.
|
| |
| |
| |
| |
| |
| | |
Currently uniqueness validator is coupled with building Arel ASTs.
This commit extracts `PredicateBuilder::CaseSensitiveHandler` for
decouple the building Arel ASTs.
|
|\ \
| | |
| | |
| | | |
Refactor `quoted_columns_for_index` by extracted `add_options_for_index_columns`
|
| |/ |
|
|/
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
|\
| |
| | |
Revert passing arel node with splat binds for `where`
|
| |
| |
| |
| |
| | |
A `value` is only used for checking `value.nil?`. It is unnecessary if
immediately return when `value.nil?`.
|
| | |
|
| | |
|
| | |
|
|/
|
|
|
| |
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
|
| | |
|