| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
This will keep the test suite passing with older PG installations.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
existence
Also:
- updates tests by stubbing table_exists? method
- adds entry for creating indexes in CREATE TABLE to changelog
|
|
|
|
|
|
|
|
| |
This is important, because adding an index on a temporary table after
it has been created would commit the transaction
Conflicts:
activerecord/CHANGELOG.md
|
|
|
|
|
|
|
| |
Follow-Up to https://github.com/rails/rails/pull/14400
This ensures that all tables are removed after each test and thereby
allowing us to run the tests in a random order.
|
|
|
|
| |
This setups the helper method which other tests can benefit from.
|
|
|
|
|
|
|
|
|
|
|
| |
The pk_an_sequence_for query previously joined against pg_class's oid
for rows in pg_depend, but pg_depend's objid may point to other system
tables, such as pg_attrdef. If a row in one of those other tables
coincidentally has the same oid as an (unrelated) sequence, that
sequence name may be returned instead of the real one.
This ensures that only the pg_depend entries pointing to pg_class are
considered.
|
|
|
|
| |
It wasn't doing anything beyond clearing the statement cache.
|
|
|
|
|
|
|
|
| |
Follow-Up to https://github.com/rails/rails/pull/14348
Ensure that SQLCounter.clear_log is called after each test.
This is a step to prevent side effects when running tests. This will allow us to run them in random order.
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Only use BINARY for mysql case sensitive uniqueness check when column has a case insensitive collation.
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| | |
case insensitive collation.
|
| | |
|
| |
| |
| |
| | |
citext makes it possible to use AR Hash finders for case-insensitive matching as sql UPPER/LOWER functions are not needed.
|
| | |
|
| |
| |
| |
| | |
Related - https://github.com/rails/rails/commit/5c55aafd38f45ac019573f98438ffdbdc8c580f9
|
| | |
|
| |
| |
| |
| |
| | |
- unused variable in PG Adapter.
- Ambiguous argument warning from range_test for use - to + Infinity range without brackets.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This test currently outputs the following warning:
```
unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" ORDER BY "postgresql_enums"."id" ASC LIMIT 1)
unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" WHERE "postgresql_enums"."id" = $1 LIMIT 1)
```
We have an open PR to deal with this issue. It will dynamically
register the OID for enum columns. This test case is merely to exhibit
the current behavior of PostgreSQL enum columns.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The Ruby Range object does not support excluding beginnings.
We currently support excluding beginnings for some subtypes using
manually by incrementing them (now using the `#succ` method).
This is approach is flawed as it's not equal to an excluding beginning.
This commit deprecates the current support for excluding beginnings.
It also raises an `ArgumentError` for subtypes that do not implement the `succ`
method.
This is a temporary solution to get rid of the broken state. We might still
add complete support for excluding beginnings afterwards. (Probably with a
new `PGRange` object, which acts like a `Range` but has excluding beginnings.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This gets AR working with custom defined range types. It also
removes the need for subtype specific branches in `OID::Range`.
This expands the interface of all `OID` types with the `infinity` method.
It's responsible to provide a value for positive and negative infinity.
|
|\ \
| | |
| | |
| | |
| | |
| | | |
Conflicts:
actionview/CHANGELOG.md
activerecord/CHANGELOG.md
|
| | |
| | |
| | |
| | |
| | |
| | | |
Thanks Godfrey Chan for reporting this!
Fixes: CVE-2014-0080
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We didn't have enough encoding for the wire protocol to store an array
of hstore types. So, further encode any hstore that is an array member.
Whilst we're here, ensure it's an HashWithIndifferentAccess being
returned, to be consistent with other serialized forms, and add testing
for arrays of hstore.
So now the following migration:
enable_extension "hstore"
create_table :servers do |t|
t.string :name
t.hstore :interfaces, array: true
end
produces a model that can used like this, to store an array of hashes:
server = Server.create(name: "server01", interfaces: [
{ name: "bge0", ipv4: "192.0.2.2", state: "up" },
{ name: "de0", state: "disabled", by: "misha" },
{ name: "fe0", state: "up" },
])
More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
|
| | | |
|
| | |
| | |
| | |
| | |
| | | |
remove created state after test execution, not before the next test.
This prevents the leak of the `ex` table outside of a single test.
|
| | |
| | |
| | |
| | | |
This should make it harder to accidentally break this test.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
If the test is run in a timezone that is behind UTC it fails because
the time generated is ahead of 0000-01-01 00:00:00. Just increase the
time subtracted so that timezone has no effect.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
PostgreSQL implementation of SchemaStatements#index_name_exists?
Conflicts:
activerecord/CHANGELOG.md
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
activerecord/test/cases/adapters/sqlite3/sqlite3_adapter_test.rb
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
This fixes broken `rake test_sqlite3_mem` suite for Active Record.
The problem is that that the old database with the schema is lost
when establishing a new connection. Upon reconnting we are left
with a blank database and tests down the line start failing.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Earlier, change_table was creating database-agnostic object.
- After this change, it will create correct object based on current
database adapter.
- This will ensure that create_table and change_table will get same objects.
- This makes update_table_definition method public and nodoc.
- Fixes #13577 and #13503
|
| | |
| | |
| | |
| | |
| | |
| | | |
to make this grant statement described in the document works
GRANT ALL PRIVILEGES ON inexistent_activerecord_unittest.* to 'rails'@'localhost';
|
| | |
| | |
| | |
| | | |
user's system configuration
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|