aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/adapters/postgresql/quoting_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Allow spaces in postgres table namesGannon McGibbon2018-11-281-0/+5
| | | | | Fixes issue where "user post" is misinterpreted as "\"user\".\"post\"" when quoting table names with the postgres adapter.
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Change sqlite3 boolean serialization to use 1 and 0Lisa Ugray2017-07-111-2/+2
| | | | | | | | | | | | | | | | | | | | Abstract boolean serialization has been using 't' and 'f', with MySQL overriding that to use 1 and 0. This has the advantage that SQLite natively recognizes 1 and 0 as true and false, but does not natively recognize 't' and 'f'. This change in serialization requires a migration of stored boolean data for SQLite databases, so it's implemented behind a configuration flag whose default false value is deprecated. The flag itself can be deprecated in a future version of Rails. While loaded models will give the correct result for boolean columns without migrating old data, where() clauses will interact incorrectly with old data. While working in this area, also change the abstract adapter to use `"TRUE"` and `"FALSE"` as quoted values and `true` and `false` for unquoted. These are supported by PostreSQL, and MySQL remains overriden.
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Extract `TypeCastingTest` into `test/cases/quoting_test.rb`Ryuta Kamizono2017-02-241-1/+0
|
* "Use assert_nil if expecting nil. This will fail in minitest 6."Akira Matsuda2016-12-251-1/+1
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* make it possible to run AR tests with bin/testYves Senn2015-06-111-1/+1
|
* `type_cast_for_database` -> `serialize`Sean Griffin2015-02-171-2/+2
|
* Refactor microsecond precision to be database agnosticSean Griffin2015-02-101-5/+0
| | | | | | | | | | The various databases don't actually need significantly different handling for this behavior, and they can achieve it without knowing about the type of the object. The old implementation was returning a string, which will cause problems such as breaking TZ aware attributes, and making it impossible for the adapters to supply their logic for time objects.
* Stop passing a column to `quote` in testsSean Griffin2015-01-101-4/+5
| | | | | | | I'm planning on deprecating the column argument to mirror the deprecation in [arel]. [arel]: https://github.com/rails/arel/commit/6160bfbda1d1781c3b08a33ec4955f170e95be11
* Stop depending on columns for type information in PG quoting testsSean Griffin2015-01-011-30/+4
| | | | | | | | A few of the tests weren't testing anything of value. The IP Address tests are testing the type, not behavior of the connection adapter. There are two CVE regression tests which are important, but don't have a good place to go, so I've left them alone for now, as they call `quote` and the focus right now is removing `column` from `type_cast`
* Use the type object for quoting PG RangesSean Griffin2014-07-051-1/+1
|
* Fix typoRafael Mendonça França2014-07-041-1/+1
|
* Quote range strings when quoting PG rangesSean Griffin2014-07-021-1/+1
| | | | | The test case for CVE-2014-3483 doesn't actually send the generated SQL to the database. The generated SQL is actually invalid for real inputs.
* Fix SQL injection when querying against ranges and bitstringsRafael Mendonça França2014-07-021-0/+11
| | | | Fix CVE-2014-3483 and protect against CVE-2014-3482.
* Have Postgres OID types inherit from general typesSean Griffin2014-05-201-4/+4
| | | | | Using general types where possible. Several more can go away once infinity gets figured out.
* PostgreSQL determine `Column#type` through corresponding OID. #7814Yves Senn2014-04-011-2/+2
| | | | | | | | | | | | | I ran the whole test suite and compared the old to the new types. Following is the list of types that did change with this patch: ``` DIFFERENT TYPE FOR mood: NEW: enum, BEFORE: DIFFERENT TYPE FOR floatrange: NEW: floatrange, BEFORE: float ``` The `floatrange` is a custom type. The old type `float` was simply a coincidence form the name `floatrange` and our type-guessing.
* PostgreSQL, use `PostgreSQLColumn` in PG specific tests.Yves Senn2014-03-281-8/+8
|
* Test that PostgreSQL adapter includes `usec` when quoting `DateTime`Ben Cherry2013-08-281-0/+5
|
* Stop interpreting SQL 'string' columns as :string type.Ben Woosley2013-08-171-1/+1
| | | | | | | | SQL doesn't have a string type, and interpreting 'string' as text is contrary to at least SQLite3's behavior: "Note that a declared type of 'STRING' has an affinity of NUMERIC, not TEXT." http://www.sqlite.org/datatype3.html
* Cast number to string in PostgresŁukasz Strzałkowski2013-03-121-0/+8
| | | | fixes #9170
* Fix typo in inet and cidr savingMiguel Herranz2012-10-141-0/+13
|
* postgresql adapter handles quoting of not a number (NaN) and InfinitySven Bohm2011-11-211-0/+12
|
* please use ruby -I lib:test path/to/test.rb, or export RUBY_OPTAaron Patterson2011-06-061-1/+1
|
* Refactor Active Record test connection setup. Please see the ↵Jon Leighton2011-06-041-1/+1
| | | | RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases.
* mysql type cast should return integers when typecasting true / falseAaron Patterson2011-04-141-0/+25