| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
When run with only the Mysql adapter, we get this failure: https://travis-ci.org/rails/rails/jobs/15937907#L2416
Porting the test over to only run when mysql2 is loaded
|
|
|
| |
Building on the work of #13427 this PR adds a helpful error message to the adapters: mysql, mysql2, and sqlite3
|
|
|
|
|
| |
Always pass in the column for quote_bound_value and quote using it in
case it exists there.
|
|
|
|
|
|
|
|
|
| |
Fixes #12261. Closes #12395.
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/cases/adapters/postgresql/array_test.rb
activerecord/test/cases/adapters/postgresql/json_test.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code uses these checks in several places to know what to do with a
particular column, for instance AR attribute query methods has a branch
like this:
if column.number?
!value.zero?
end
This should never be true for array columns, since it would be the same
as running [].zero?, which results in a NoMethodError exception.
Fixing this by ensuring that array columns in PostgreSQL never return
true for number?/text? checks.
Since most of the array support was based on the postgres_ext lib, it's
worth noting it does the same thing for numeric array columns too:
https://github.com/dockyard/postgres_ext/blob/v1.0.0/lib/postgres_ext/active_record/connection_adapters/postgres_adapter.rb#L72
This extended the same logic for text columns to ensure consistency.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently if you attempt to use a database that does not exist you get an error:
```
PG::ConnectionBad FATAL: database "db_error" does not exist
```
The solution is easy, create and migrate your database however new developers may not know these commands by memory. Instead of requiring the developer to search for a solution, tell them how to fix the problem in the error message:
```
ActiveRecord::NoDatabase: FATAL: database "db_error" does not exist
Run `$ bin/rake db:create db:migrate` to create your database
```
Active Record should not know about `rake db:migrate` so this additional information needs to come from the railtie. Potential alternative implementation suggestions are welcome.
|
|
|
|
| |
Closes #13444
|
| |
|
|
|
|
|
| |
Need to check if valud also respond_to :id before calling it, otherwise
things could explode.
|
|
|
|
| |
[ci skip]
|
|\
| |
| | |
modified regex for finding table_name from a multiline sql query in postgresql
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously, executing an insert SQL in PostgreSQL with a command like this:
insert into articles(
number)
values(
5152
)
would not work because the adapter was unable to extract the correct articles table name.
|
|/
|
|
| |
The changes in c4044b2 meant the tests would error on a fresh DB.
|
|
|
|
|
| |
also override drop_table in AbstractMySQLAdapter to properly drop
temporary tables without committing the transaction
|
| |
|
| |
|
| |
|
|\
| |
| | |
Support MySQL 5.7 explain
|
| | |
|
|/
|
|
| |
Since MySQL 5.7.3 m13 does now allow primary key column is null.
|
|\
| |
| | |
Remove leftover Oracle tests.
|
| | |
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
| |
This prevents the following error when a MySQL index on a foreign key
column is renamed:
```
ActiveRecord::StatementInvalid: Mysql2::Error: Cannot drop index 'index_engines_on_car_id': needed in a foreign key constraint: DROP INDEX `index_engines_on_car_id` ON `engines`
```
refs: #13038.
|
|\
| |
| |
| |
| | |
dougbarth/dont_swallow_exceptions_during_transactional_statements_in_mysql
Don't swallow exceptions in transctional statements
|
| |
| |
| |
| | |
From PR, @tenderlove would prefer to not maintain these tests.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The MySQL connection adapater swallows all StandardError exceptions,
which includes Mysql::Error and Mysql2::Error. The comment in the
exception clause claims errors thrown here indicate that transactions
aren't supported by the server but that isn't necessarily true. It's
possible the MySQL server has gone away and swallowing a failed commit
may let the application return a successful response when the data has
not been saved. Also, replication libraries like Galera require that the
application handle exceptions thrown at BEGIN/COMMIT.
I'm unable to determine what version of MySQL threw an exception for
transactional statements. I tried as far back as 3.23.49 with InnoDB
disabled but BEGIN & COMMIT statements do not throw an error. If there's
a real case for this logic to continue, we could instead push this
behavior into a configuration setting.
The exception swallowing has been there since the beginning:
db045dbbf60b53dbe013ef25554fd013baf88134
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
We can conditional define the tests depending on the adapter or
connection.
Lets keep the skip for fail tests that need to be fixed.
|
|/ |
|
| |
|
|\
| |
| | |
cast json values on write to be consistent with reading from the db.
|
| |
| |
| |
| | |
See also commit 5ac2341fab689344991b2a4817bd2bc8b3edac9d
|
|\ \
| |/
|/| |
prevent global timezone state from leaking out of test cases.
|
| | |
|
| |
| |
| |
| |
| |
| | |
This is necessary because as of 5ac2341 `hstore` columns are always stored
as `Hash` with `String` keys. `ActiveRecord::Store` expected the attribute to
be an instance of `HashWithIndifferentAccess`, which led to the bug.
|
|/ |
|
|
|
|
| |
Fixes #12489
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| | |
TypeError: superclass mismatch for class PostgreSQLAdapter
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
monkeypatching
Changing Inheritance section leads to following error on JRuby
TypeError: superclass mismatch for class PostgreSQLAdapter
After this change,
Jruby: The above error no longer appear. Tests are still failing but they do run. Progress!
MRI: No change, all green(tested by running take test_test_postgresql)
Thanks to Aditya Sanghi(@asanghi) for help
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Dump UUID default functions to schema.rb [2nd version]. Fixes #10751.
Conflicts:
activerecord/CHANGELOG.md
|
| | | |
|
|\ \ \
| |_|/
|/| |
| | |
| | |
| | |
| | | |
Fixed a bug in when using has_many association with :inverse_of option and UUID primary key.
Conflicts:
activerecord/CHANGELOG.md
|
| | |
| | |
| | |
| | | |
UUID primary key.
|
| | | |
|