- 18 11月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
Use whatever adapter-provided means we have available to ensure forked children don't send quit/shutdown/goodbye messages to the server on connections that belonged to their parent.
-
- 13 11月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Add new error class `StatementTimeout` which will be raised when statement timeout exceeded (#31129) We are sometimes using The MAX_EXECUTION_TIME hint for MySQL depending on the situation. It will prevent catastrophic performance down by wrong performing queries. The new error class `StatementTimeout` will make to be easier to handle that case. https://dev.mysql.com/doc/refman/5.7/en/optimizer-hints.html#optimizer-hints-execution-time
-
- 11 11月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #30360.
-
由 Ryuta Kamizono 提交于
Attribute modules (`Attribute`, `Attributes`, `AttributeSet`) uses `Type`, but referencing `Type` before the modules still fail. ``` % ./bin/test -w test/cases/attribute_test.rb -n test_with_value_from_user_validates_the_value Run options: -n test_with_value_from_user_validates_the_value --seed 31876 E Error: ActiveModel::AttributeTest#test_with_value_from_user_validates_the_value: NameError: uninitialized constant ActiveModel::AttributeTest::Type /Users/kamipo/src/github.com/rails/rails/activemodel/test/cases/attribute_test.rb:233:in `block in <class:AttributeTest>' bin/test test/cases/attribute_test.rb:232 Finished in 0.002985s, 335.0479 runs/s, 335.0479 assertions/s. 1 runs, 1 assertions, 0 failures, 1 errors, 0 skips ``` Probably we need more autoloading at least `Type`.
-
- 09 11月, 2017 1 次提交
-
-
由 Brent Wheeldon 提交于
This fixes an issue where competing threads deadlock each other. - Thread A holds the load interlock but is blocked on getting the DB lock - Thread B holds the DB lock but is blocked on getting the load interlock (for example when there is a `Model.transaction` block that needs to autoload) This solution allows for dependency loading in other threads while a thread is waiting to acquire the DB lock. Fixes #31019
-
- 07 11月, 2017 1 次提交
-
-
由 Keenan Brock 提交于
``` [NoMethodError]: undefined method `state' for nil:NilClass Method:[rescue in block in refresh] ``` In `within_new_transaction`, there is the possibility that `begin_transaction` returns a `nil`. (i.e.: so `transaction = nil`) So this method is checking `transaction` for nil in 2 spots. Unfortunately, there is one line that is not checking `transaction` for `nil` That line, `commit_transaction`, throws an exception for us in AR 5.0.0.1 The problem with the method is finally realized in the error checking itself. it calls `transaction.state` (i.e.: nil.state) and that is the final exception raised. The actual underlying (user) issue is hidden by this line. Solution is test transaction for nil.
-
- 28 10月, 2017 1 次提交
-
-
由 suginoy 提交于
Replace the primary key type `integer` in docs with `bigint`. ref #26266
-
- 25 10月, 2017 4 次提交
-
-
由 Yasuo Honda 提交于
and abstract `SchemaDumper#extensions` is now an empty method. Since #30337, every database adapter has its own `SchemaDumper`. `extensions` are only supported by PostgreSQL database and postgresql database adapter.
-
由 Paul Kuruvilla 提交于
-
由 Yasuo Honda 提交于
since the minimum version of PostgreSQL currently Rails supports is 9.1, there is no need to handle if `supports_extensions?` Refer https://www.postgresql.org/docs/9.1/static/sql-createextension.html "CREATE EXTENSION"
-
由 Paul Kuruvilla 提交于
Although the sqlite adapter supports index sort orders, they weren't being written to db/schema.rb.
-
- 24 10月, 2017 8 次提交
-
-
由 Yasuo Honda 提交于
`supports_disable_referential_integrity?` used to handle if PostgreSQL database supports `ALTER TABLE <table name> DISABLE/ENABLE TRIGGER` statements. Refer https://github.com/rails/rails/commit/9a947af0e79cfb8692eb7e5ae94c1b8c40756f49 These statements have been documented since 8.1. https://www.postgresql.org/docs/8.1/static/sql-altertable.html > DISABLE/ENABLE TRIGGER Now Rails supports PostgreSQL 9.1 or higher only. No need to handle `supports_disable_referential_integrity?` anymore. Also, this method does not exist in any other adapters including AbstractAdapter.
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
Remove deprecated methods `initialize_schema_migrations_table` and `initialize_internal_metadata_table`
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
- 21 10月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
This basically reverts 9d4f79d3
-
- 15 10月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
We already found the longer sequence name, but we could not consider whether it was the sequence name created by serial type due to missed a max identifier length limitation. I've addressed the sequence name consideration to respect the max identifier length. Fixes #28332.
-
由 Ryuta Kamizono 提交于
Currently `AUTO_INCREMENT` is implicitly used in the default primary key definition. But `AUTO_INCREMENT` is not only used for single column primary key, but also for composite primary key. In that case, `auto_increment: true` should be dumped explicitly in the `db/schema.rb`. Fixes #30894.
-
- 09 10月, 2017 2 次提交
-
-
由 yuuji.yaginuma 提交于
s/Action Record/Active Record/
-
由 Jeremy Daer 提交于
* When the adapter is missing, raise an exception that points out config typos and missing Gemfile entries. (We can assume that a non-builtin adapter was used since these are always available.) * When loading an adapter raises a LoadError, prefix its error message to indicate that the adapter is likely missing an optional dependency.
-
- 05 10月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
-
- 04 10月, 2017 2 次提交
-
-
由 bogdanvlviv 提交于
Implemented by #22911 Related to #30677
-
由 Ryuta Kamizono 提交于
-
- 27 9月, 2017 1 次提交
-
-
由 Thomas Cannon 提交于
PostgreSQL 9.1+ introduced range types, and Rails added support for using this datatype in ActiveRecord. However, the serialization of `PostgreSQL::OID::Range` was incomplete, because it did not properly quote the bounds that make up the range. A clear example of this is a `tsrange`. Normally, ActiveRecord quotes Date/Time objects to include the milliseconds. However, the way `PostgreSQL::OID::Range` serialized its bounds, the milliseconds were dropped. This meant that the value was incomplete and not equal to the submitted value. An example of normal timestamps vs. a `tsrange`. Note how the bounds for the range do not include their milliseconds (they were present in the ruby Range): UPDATE "iterations" SET "updated_at" = $1, "range" = $2 WHERE "iterations"."id" = $3 [["updated_at", "2017-09-23 17:07:01.304864"], ["range", "[2017-09-23 00:00:00 UTC,2017-09-23 23:59:59 UTC]"], ["id", 1234]] `PostgreSQL::OID::Range` serialized the range by interpolating a string for the range, which works for most cases, but does not work for timestamps: def serialize(value) if value.is_a?(::Range) from = type_cast_single_for_database(value.begin) to = type_cast_single_for_database(value.end) "[#{from},#{to}#{value.exclude_end? ? ')' : ']'}" else super end end (byebug) from = type_cast_single_for_database(value.begin) 2010-01-01 13:30:00 UTC (byebug) to = type_cast_single_for_database(value.end) 2011-02-02 19:30:00 UTC (byebug) "[#{from},#{to}#{value.exclude_end? ? ')' : ']'}" "[2010-01-01 13:30:00 UTC,2011-02-02 19:30:00 UTC)" @sgrif (the original implementer for Postgres Range support) provided some feedback about where the quoting should occur: Yeah, quoting at all is definitely wrong here. I'm not sure what I was thinking in 02579b56, but what this is doing is definitely in the wrong place. It should probably just be returning a range of subtype.serialize(value.begin) and subtype.serialize(value.end), and letting the adapter handle the rest. `Postgres::OID::Range` now returns a `Range` object, and `ActiveRecord::ConnectionAdapters::PostgreSQL::Quoting` can now encode and quote a `Range`: def encode_range(range) "[#{type_cast(range.first)},#{type_cast(range.last)}#{range.exclude_end? ? ')' : ']'}" end ... encode_range(range) #=> "['2010-01-01 13:30:00.670277','2011-02-02 19:30:00.745125')" This commit includes tests to make sure the milliseconds are preserved in `tsrange` and `tstzrange` columns
-
- 25 9月, 2017 2 次提交
-
-
由 Francesco Rodriguez 提交于
I got this error in production using Puma in multi-threaded mode: ``` RuntimeError: Digest::Base cannot be directly inherited in Ruby from active_support/security_utils.rb:23:in `variable_size_secure_compare' from active_support/security_utils.rb:23:in `hexdigest' from active_support/security_utils.rb:23:in `digest' ``` Looks like Digest uses const_missing to load Digest::SHA256 (https://github.com/ruby/ruby/blob/trunk/ext/digest/lib/digest.rb#L8) - https://bugs.ruby-lang.org/issues/9494 - https://github.com/ruby/ruby/commit/c02fa39463a0c6bf698b01bc610135604aca2ff4
-
由 Ryuta Kamizono 提交于
-
- 23 9月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
Currently the normalization only exists in `primary_key` shorthand. It should be moved to `new_column_definition` to also affect to `add_column` with primary key.
-
由 Ryuta Kamizono 提交于
`change_column_{default,null,comment}` in mysql2 adapter are passing `column.sql_type` as `type` to `change_column` to intend keeping previous type. But `column_for` requires extra query, so use passing `nil` to `type` explicitly in the internal for the purpose.
-
- 22 9月, 2017 3 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
-
由 Alecs Popa 提交于
-
- 19 9月, 2017 1 次提交
-
-
由 Yoshiyuki Kinjo 提交于
-
- 18 9月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
If collided named sequence already exists, newly created serial column will generate alternative sequence name. Fix sequence name detection to allow the alternative names.
-
- 14 9月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Because `quoted_table_name` doesn't respect table alias. We should use `arel_attribute` for that, so I added `column_name_from_arel_node` to generate column name from an arel node.
-
- 08 9月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Fixes #30539.
-
- 04 9月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Otherwise using reserved words as composite primary key names will be failed as an invalid SQL. Fixes #30518.
-