[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Bug that eats sql

Tom Bak

7/31/2007 3:33:00 PM

Hi,
I might have found bug that eats sql.

I can manualy execute this code on "Company$NCustomers" view:

UPDATE "Company$NCustomers" SET name = 'test' WHERE no_ = '100087'

But then i do that in rails, the attribute is not set:


n = User.find_by_username('ncustomer2').n_customer; n.name = 'test
chagne'; n.save

ActiveRecord::StatementInvalid: DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Incorrect syntax near the keyword 'WHERE'.
HRESULT error code:0x80020009
WystÄ?piÅ? wyjÄ?tek.: UPDATE "Company$NCustomers" SET WHERE no_ =
'100087'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract_adapter.rb:128:in
`log'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/sqlserver_adapter.rb:318:in
`execute'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/sqlserver_adapter.rb:301:in
`update'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1797:in
`update_without_lock'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/locking/optimistic.rb:60:in
`update_without_callbacks'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/callbacks.rb:267:in
`update_without_timestamps'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/timestamp.rb:48:in
`update'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1790:in
`create_or_update_without_callbacks'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/callbacks.rb:242:in
`create_or_update'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/base.rb:1546:in
`save_without_validation'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/validations.rb:752:in
`save_without_transactions'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/transactions.rb:129:in
`save'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/connection_adapters/abstract/database_statements.rb:59:in
`transaction'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/transactions.rb:95:in
`transaction'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/transactions.rb:121:in
`transaction'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/transactions.rb:129:in
`save'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/associations/association_proxy.rb:123:in
`send'
from
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.2/lib/active_record/associations/association_proxy.rb:123:in
`method_missing'
from (irb):3>>


Any ideas why it rails might produce wrong sql statement here?
--
Posted via http://www.ruby-....

2 Answers

Dan Zwell

8/1/2007 1:29:00 AM

0

Tom Bak wrote:
> Hi,
> I might have found bug that eats sql.
>
> I can manualy execute this code on "Company$NCustomers" view:
>
> UPDATE "Company$NCustomers" SET name = 'test' WHERE no_ = '100087'
>
> But then i do that in rails, the attribute is not set:
>
>
> n = User.find_by_username('ncustomer2').n_customer; n.name = 'test
> chagne'; n.save
>

You'll have better luck with your question in the Rails forum/mailing
list. I don't know the URL, but google can probably help with that.

Dan

Tom Bak

8/1/2007 7:23:00 AM

0

I submited it as bug http://dev.rubyonrails.org/t...

Thanks,
Tom
--
Posted via http://www.ruby-....