1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

22 commits

Author SHA1 Message Date
Keenan Brock
508a6783c8 Add case sensitive match
Explicitly declare if this is case sensitive or not

most implementation assume case sensitive
postgres assumes case insensitive
2015-12-05 19:00:33 -05:00
Kazuya NUMATA
2c95c39e93 {Matches,DoesNotMatch} support the ESCAPE clause with PostgreSQL
to_SQL already has supported the ESCAPE clause in #318.
PostgreSQL can use the ESCAPE clause too.
2014-12-25 12:58:42 +09:00
Sean Griffin
590c784a30 Add order to BindParams in the ToSql collector
This removes the need for us to do the re-ordering by walking the AST in
ActiveRecord. We're using a block to communicate with the collector,
since the collector needs to be the thing which knows about the index,
while the visitor is the thing that needs to know the syntax. The
BindParam needs to know about neither of these things, so it's been
changed to stop being a subclass of SqlLiteral

I could also see an alternative implementation using format strings if
for some reason blocks cause a problem.
2014-11-17 14:52:38 -08:00
Aaron Patterson
b2fb1d3381 postgresql visitor is working 2014-04-08 17:16:21 -07:00
James Le Cuirot
6296617c15 Add Regexp and NotRegexp nodes for PostgreSQL 2014-04-08 00:39:25 +01:00
Alex Lin
c52df44784 Removed all the fiels in lib/arel/visitors/ which needs dependency on 'a' also fixed the test case for : test/visitors/test_to_sql.rb:22 which pass in the parameter attribute e.g the parameter a. 2014-03-24 23:42:27 -04:00
vanderhoorn
f3938cd77a PostgreSQL bugfix for invalid SQL in subqueries
In commit 68a95542e1 the last_column feature of ToSql was removed. The visit_Arel_Nodes_Matches and visit_Arel_Nodes_DoesNotMatch methods are overwritten in the PostgreSQL class, but were not updated appropriately. This commit fixes the issue accordingly.

This bug affects at least all update_all statements in Rails 4.0.2 that have subqueries with ILIKE statements on PostgreSQL. The bug is present in Arel 4.0.1 and later, so it probably affects most Rails 4.0.2 projects.

It would be highly appreciated if Arel 4 could get a point release as well. Thanks for your continued work.
2014-02-05 13:21:19 +01:00
Ernie Miller
68a95542e1 Make visitors threadsafe by removing @last_column
The last_column feature of the ToSql visitor and its descendants is what
enabled quoting based on the column last visited -- in other words, if
you have a standard condition like an equality with a string attribute
on the left side and an integer on the right side, then when ARel visits
the node, it'll first visit the left side attribute, setting the
column of the string attribute as the last column, and resulting in the
right side of the condition getting the appropriate quoting.

The downside is that this means that visitors can't be shared between
threads, because of the state mutation. It also makes for some really
weird behavior in the event that the visitor visits a node that happens
to contain an attribute you weren't expecting to be there, since it'll
potentially quote something based on that attribute. So, it prevents
reversing an equality condition. column = value will work, but not value
= column, since the last column wouldn't be the column you're hoping
for.

This is a first pass at fixing this by changing the signature of the
visit methods to accept the currently-relevant attribute, if any.
2013-04-28 22:20:16 -07:00
Edgars Beigarts
481ccefedd Support locking by default and disable it only for SQLite. 2011-08-26 20:01:58 +03:00
Aaron Patterson
b4d6e5debc removing the aliased orders method from the pg visitor 2011-04-28 11:03:31 -07:00
Aaron Patterson
0b9af9762a adding Distinct ON node 2011-04-21 15:46:24 -05:00
Aaron Patterson
c7eef391db refactoring custom lock logic to use sql literals 2011-02-21 15:40:38 -08:00
Aaron Patterson
8ed3ab00f1 Lock should be a unary node 2011-02-21 15:14:29 -08:00
Jesse Storimer
6c65b01762 Allow database specific locking clauses to be used 2011-01-20 00:37:05 -05:00
Aaron Patterson
f5e0979055 adding better tests surrounding limits in adapter visitors 2011-01-03 16:19:57 -08:00
Aaron Patterson
4010568595 quoting limit nodes 2010-12-07 10:48:02 -08:00
Aaron Patterson
d3625bbf8f add locking support for postgres 2010-10-13 13:23:52 -07:00
Ernie Miller
5ca0c9a457 Make PostgreSQL play nice with its friends. (matches -> ILIKE instead of LIKE) 2010-09-29 15:50:24 -04:00
Aaron Patterson
6c266b4c3f reordering order clauses :'( 2010-09-23 13:48:09 -07:00
Aaron Patterson
66fc8add90 writing code that makes me sad 2010-09-23 13:38:56 -07:00
Aaron Patterson
9e9e590675 adding a select statment visitor 2010-09-23 13:38:56 -07:00
Aaron Patterson
aa4c957fa1 adding a postgres adapter 2010-09-23 13:38:56 -07:00