| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
- Fix typo: `test_opertaion_ordering` => `test_operation_ordering`
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
An equality with a string column and integer like
SELECT * FROM `users` WHERE `login_token` = 0 LIMIT 1;
will match match any string that doesn't start with a digit in certain
databases, like mysql. Make sure we quote the integer to avoid this
problem in a database independant way.
|
| |
|
|
|
|
| |
this lets our old depth first and dot visitors to work normally
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* master:
remove order_clauses since we do not use it
fix whitespace and unsupported method args
Add Regexp and NotRegexp nodes for PostgreSQL
Revert "Merge pull request #253 from corrupt952/master"
flatten object.children in visit_Arel_Node_And
Added right and full outer joins
Conflicts:
lib/arel/visitors/to_sql.rb
lib/arel/visitors/visitor.rb
|
| | |
|
| |
| |
| |
| |
| | |
This reverts commit 6d3ed6d96c4a3ac85b97d81bad95b7254b2aa2d4, reversing
changes made to a35fede61ac1a2fcff519ad052f2fcb8808922b9.
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
also fixed the test case for : test/visitors/test_to_sql.rb:22 which pass in the parameter attribute e.g the parameter a.
|
|
|
|
|
| |
If we add the casting node to the ast at build time, then we can avoid
doing the lookup at visit time.
|
|
|
|
| |
The evaluates the assignment of two unqualified columns.
|
| |
|
|
|
|
| |
using matches() or does_not_match().
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|\
| |
| | |
bugfix: some aggregations lacked DISTINCT emission
|
| | |
|
|/ |
|
|
|
|
| |
This is in response to discussion on 62207fa
|
| |
|
| |
|
| |
|
|
|
|
| |
generating SQL, rather than the TreeManager. (There is a related commit coming in Active Record.)
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is useful for dynamically created predicates e.g:
expr1 = table.create_false
expr2 = table.create_false
expr1 = create_a_predicate() if some_condition
expr2 = create_another_predicate() if some_other_condition
table.where(expr1.and(expr2))
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Because the ToSql visitor instance is shared across all threads, there is a
race condition around column types for binary nodes. It's possible, for instance,
to end up with ActiveRecord converting a string value in the final SQL to an
integer during heavy concurrent operations.
|
| |
|
| |
|
|\
| |
| |
| |
| | |
* 'master' of github.com:rails/arel:
Add an #table_name method to Table and TableAlias, which always returns the actual table name, not the alias. Then fix ToSql#column_for to use this table name when checking whether the table exists (rather than before, where it was checking whether a table with the alias name exists, which was incorrect).
|
| |
| |
| |
| | |
actual table name, not the alias. Then fix ToSql#column_for to use this table name when checking whether the table exists (rather than before, where it was checking whether a table with the alias name exists, which was incorrect).
|
|\ \
| |/
|/|
| |
| | |
* stiff/master:
implemented support for math operations in numeric attributes
|
| | |
|
|/ |
|
| |
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 2-0-stable:
updating history
Patched Arel v2.0.6 to support MSSQL SQL queries. Based on work of James Abley (https://github.com/jabley/arel).
consolidating dot visitor methods
refactoring where, fixing subselect
implementation for passing a subquery to #in and #not_in
tests for passing a subquery to #in and #not_in
limit members of the AST are visited
quoting limit nodes
Conflicts:
History.txt
lib/arel/nodes.rb
lib/arel/nodes/select_core.rb
lib/arel/select_manager.rb
lib/arel/visitors/to_sql.rb
test/visitors/test_to_sql.rb
|
| |
| |
| |
| | |
Abley (https://github.com/jabley/arel).
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | | |
* sven/in-subquery:
implementation for passing a subquery to #in and #not_in
tests for passing a subquery to #in and #not_in
|
| | | |
|
|\ \ \
| |/ /
|/| |
| | |
| | |
| | | |
* 2-0-stable:
quoting limit nodes
Make "not" apply to the whole sub-expression when generating sql.
|
| |/ |
|