Robert Brown

Results 8 comments of Robert Brown

I am having a similar problem over here: https://github.com/jruby/activerecord-jdbc-adapter/issues/736 In my case, #replace_limit_offset! is clobbering my UPDATE statement with a SELECT! Could be same for you.... Not sure why changing...

I found that if I change https://github.com/jruby/activerecord-jdbc-adapter/blob/e9366a5a25dc919e7fe7d6319410aec2e9532edb/lib/arel/visitors/sql_server/ng42.rb#L255 from ``` #def substitute_binds bvs; @delegate.substitute_binds(bvs); self end ``` to ``` def substitute_binds bvs; @delegate.substitute_binds(bvs); end ``` ...it fixes the problem. I must...

I have tracked the problem down to somewhere in `Arjdbc::MSSQL::LimitHelpers::SqlServerReplaceLimitOffset#replace_limit_offset` https://github.com/jruby/activerecord-jdbc-adapter/blob/e9366a5a25dc919e7fe7d6319410aec2e9532edb/lib/arjdbc/mssql/limit_helpers.rb#L18 The SQL going in is ``` UPDATE [cml_counterparties] SET [lft] = CASE WHEN [lft] BETWEEN N'2' AND N'2' THEN...

`replace_limit_offset!` is a nasty piece of work. It would appear it simply doesn't handle nested SELECT!?!?

I am working around the issue with this shameful hack at https://github.com/jruby/activerecord-jdbc-adapter/blob/e9366a5a25dc919e7fe7d6319410aec2e9532edb/lib/arel/visitors/sql_server/ng42.rb#L103 ``` ruby # HACK # https://github.com/jruby/activerecord-jdbc-adapter/issues/736 # Only mess with the limit if theres a "meaningful" limit if...

I see the following in https://github.com/jruby/activerecord-jdbc-adapter/blob/master/lib/arel/visitors/sql_server/ng42.rb#L28 ``` def visit_Arel_Nodes_UpdateStatement(o, a) if o.orders.any? && o.limit.nil? o.limit = Nodes::Limit.new(9_223_372_036_854_775_807) end super end ``` In other words, if the update doesn't have a...

Hi Karol, I certainly appreciate all the work you've done here - I use it every day! I'm in the process of setting up a SQL Server 2008 server so...

Also found: ``` FuzzyMatch.new(['AAI Limited', 'LITED'], :stop_words=>[/limited/]).find('AAI Limited') => "AAI Limited" ``` So the case insensitive modifier seems to be having an undesirable impact...