| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Since MariaDB 10.2.5, `information_schema` supports Virtual Columns.
Fixes #29670.
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
|
| |
`ReservedWordTest` expects that any identifiers are quoted properly.
It should be tested for all adapters.
|
| |
|
|
|
|
|
| |
Both `mysql2/json_test.rb` and `postgresql/json_test.rb` have same test
cases.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`internal_string_options_for_primary_key` is used for creating internal
tables in newly apps. But it is no longer needed after MySQL 8.0.0.
MySQL 5.7 has introduced `innodb_default_row_format` (default `DYNAMIC`)
and has deprecated `innodb_large_prefix` and `innodb_file_format`.
The purpose of the deprecated options was for compatibility with earlier
versions of InnoDB.
https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_large_prefix
> innodb_large_prefix is deprecated and will be removed in a future
release. innodb_large_prefix was introduced in MySQL 5.5 to disable
large index key prefixes for compatibility with earlier versions of
InnoDB that do not support large index key prefixes.
https://dev.mysql.com/doc/refman/5.7/en/innodb-parameters.html#sysvar_innodb_file_format
> The innodb_file_format option is deprecated and will be removed in a
future release. The purpose of the innodb_file_format option was to
allow users to downgrade to the built-in version of InnoDB in MySQL 5.1.
Now that MySQL 5.1 has reached the end of its product lifecycle,
downgrade support provided by this option is no longer necessary.
The deprecated options has removed in MySQL 8.0.0. It is no longer
needed to take care newly created internal tables as a legacy format
after MySQL 8.0.0.
Fixes #28730.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`valid_type?` is used in schema dumper to determine if a type is
supported. So if `valid_type?(:foobar)` is true, it means that schema
dumper is allowed to create `t.foobar`. But it doesn't work. I think
that `valid_type?` should accept only supported types.
https://github.com/rails/rails/blob/v5.1.0.beta1/activerecord/lib/active_record/schema_dumper.rb#L135-L142
```ruby
columns.each do |column|
raise StandardError, "Unknown type '#{column.sql_type}' for column '#{column.name}'" unless @connection.valid_type?(column.type)
next if column.name == pk
type, colspec = @connection.column_spec(column)
tbl.print " t.#{type} #{column.name.inspect}"
tbl.print ", #{format_colspec(colspec)}" if colspec.present?
tbl.puts
end
```
|
|\
| |
| | |
Deprecate AbstractAdapter#verify! with arguments
|
| | |
|
|\ \
| | |
| | | |
Use ensure block for things we cleanup in tests
|
| |/ |
|
| |
| |
| |
| | |
Fixes #26556.
|
| |
| |
| |
| |
| |
| | |
Column options are passed as an hash args then used as `options` hash in
`add_column_options!`. Converting args to attributes is inconvinient for
using options as an hash.
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Restore the behaviour of the compatibility layer for integer-like PKs
* kamipo/fix_mysql_pk_dumping_correctly:
Restore custom primary key tests lost at #26266
Restore the behaviour of the compatibility layer for integer-like PKs
Correctly dump integer-like primary key with default nil
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The PR #27384 changed migration compatibility behaviour.
```ruby
class CreateMasterData < ActiveRecord::Migration[5.0]
def change
create_table :master_data, id: :integer do |t|
t.string :name
end
end
end
```
Previously this migration created non-autoincremental primary key
expected. But after the PR, the primary key changed to autoincremental,
it is unexpected.
This change restores the behaviour of the compatibility layer.
|
|/
|
|
|
|
|
| |
```
go get -u github.com/client9/misspell/cmd/misspell
misspell -w -error -source=text .
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
MySQL generated columns: https://dev.mysql.com/doc/refman/5.7/en/create-table-generated-columns.html
MariaDB virtual columns: https://mariadb.com/kb/en/mariadb/virtual-computed-columns/
Declare virtual columns with `t.virtual name, type: …, as: "expression"`.
Pass `stored: true` to persist the generated value (false by default).
Example:
create_table :generated_columns do |t|
t.string :name
t.virtual :upper_name, type: :string, as: "UPPER(name)"
t.virtual :name_length, type: :integer, as: "LENGTH(name)", stored: true
t.index :name_length # May be indexed, too!
end
Closes #22589
|
|
|
|
|
|
| |
`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.
|
| |
|
| |
|
| |
|
| |
|