Rich Cox
2007-Oct-06 00:30 UTC
Rails AR/SQLServer Unit Test: [7749] failed (but getting better)
"rick" has given AR/SQLServer some love, but it''s still
unhappy...
http://dev.rubyonrails.org/changeset/7749
------------------------------------------------------------------------
r7749 | rick | 2007-10-05 17:25:07 -0700 (Fri, 05 Oct 2007) | 1 line
Fix that ActiveRecord would create attribute methods and override custom
attribute getters if the method is also defined in Kernel.methods. [Rick]
------------------------------------------------------------------------
U activerecord\test\attribute_methods_test.rb
U activerecord\lib\active_record\attribute_methods.rb
U activerecord\lib\active_record\base.rb
U activerecord\CHANGELOG
Updated to revision 7749.
1) Error:
test_scoped_find_limit_offset_including_has_many_association(BasicsTest):
ActiveRecord::StatementInvalid: DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Ambiguous column name ''id''.
HRESULT error code:0x80020009
Exception occurred.: SELECT topics.[id] AS t0_r0, topics.[title] AS t0_r1,
topics.[author_name] AS t0_r2, topics.[author_email_address] AS t0_r3,
topics.[written_on] AS t0_r4, topics.[bonus_time] AS t0_r5, topics.[last_read]
AS t0_r6, topics.[content] AS t0_r7, topics.[approved] AS t0_r8,
topics.[replies_count] AS t0_r9, topics.[parent_id] AS t0_r10, topics.[type] AS
t0_r11, replies_topics.[id] AS t1_r0, replies_topics.[title] AS t1_r1,
replies_topics.[author_name] AS t1_r2, replies_topics.[author_email_address] AS
t1_r3, replies_topics.[written_on] AS t1_r4, replies_topics.[bonus_time] AS
t1_r5, replies_topics.[last_read] AS t1_r6, replies_topics.[content] AS t1_r7,
replies_topics.[approved] AS t1_r8, replies_topics.[replies_count] AS t1_r9,
replies_topics.[parent_id] AS t1_r10, replies_topics.[type] AS t1_r11 FROM
topics LEFT OUTER JOIN topics replies_topics ON replies_topics.parent_id =
topics.id AND replies_topics.[type] = ''Reply'' WHERE topics.id
IN (2) ORDER BY id
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:137:in
`log''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:337:in
`execute_without_counting''
./test/abstract_unit.rb:70:in `execute''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:533:in
`select''
./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
`select_all_without_query_cache''
./test/../lib/active_record/connection_adapters/abstract/query_cache.rb:55:in
`select_all''
./test/../lib/active_record/associations.rb:1233:in
`select_all_rows''
./test/../lib/active_record/associations.rb:1114:in
`find_with_associations''
./test/../lib/active_record/associations.rb:1112:in `catch''
./test/../lib/active_record/associations.rb:1112:in
`find_with_associations''
./test/../lib/active_record/base.rb:1003:in `find_every''
./test/../lib/active_record/base.rb:430:in `find''
./test/base_test.rb:1450:in
`test_scoped_find_limit_offset_including_has_many_association''
./test/../lib/active_record/base.rb:1451:in `with_scope''
./test/base_test.rb:1449:in
`test_scoped_find_limit_offset_including_has_many_association''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`__send__''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`run''
2) Error:
test_saves_both_date_and_time(DateTimeTest):
ArgumentError: argument out of range
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:106:in
`mktime''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:106:in
`cast_to_datetime''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:79:in
`type_cast''
./test/../lib/active_record/attribute_methods.rb:195:in
`read_attribute''
./test/../lib/active_record/base.rb:2171:in `send''
./test/../lib/active_record/base.rb:2171:in `clone_attribute_value''
./test/../lib/active_record/base.rb:2165:in `clone_attributes''
./test/../lib/active_record/attribute_methods.rb:137:in `inject''
./test/../lib/active_record/base.rb:2164:in `each''
./test/../lib/active_record/base.rb:2164:in `inject''
./test/../lib/active_record/base.rb:2164:in `clone_attributes''
./test/../lib/active_record/base.rb:1855:in `attributes''
./test/../lib/active_record/base.rb:2048:in
`attributes_with_quotes''
./test/../lib/active_record/base.rb:2141:in `quoted_column_names''
./test/../lib/active_record/base.rb:1988:in
`create_without_callbacks''
./test/../lib/active_record/callbacks.rb:226:in
`create_without_timestamps''
./test/../lib/active_record/timestamp.rb:29:in `create''
./test/../lib/active_record/base.rb:1964:in
`create_or_update_without_callbacks''
./test/../lib/active_record/callbacks.rb:213:in `create_or_update''
./test/../lib/active_record/base.rb:1724:in
`save_without_validation!''
./test/../lib/active_record/validations.rb:884:in
`save_without_transactions!''
./test/../lib/active_record/transactions.rb:109:in `save!''
./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:66:in
`transaction''
./test/../lib/active_record/transactions.rb:77:in `transaction''
./test/../lib/active_record/transactions.rb:97:in `transaction''
./test/../lib/active_record/transactions.rb:109:in `save!''
./test/../lib/active_record/transactions.rb:117:in
`rollback_active_record_state!''
./test/../lib/active_record/transactions.rb:109:in `save!''
./test/date_time_test.rb:11:in `test_saves_both_date_and_time''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`__send__''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`run''
3) Error:
test_eager_association_loading_with_explicit_join(EagerAssociationTest):
ActiveRecord::StatementInvalid: DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
ORDER BY items must appear in the select list if SELECT DISTINCT is
specified.
HRESULT error code:0x80020009
Exception occurred.: SELECT DISTINCT TOP 1 posts.id FROM posts LEFT OUTER
JOIN comments ON comments.post_id = posts.id INNER JOIN authors ON
posts.author_id = authors.id AND authors.name = ''Mary'' ORDER
BY author_id
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:137:in
`log''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:337:in
`execute_without_counting''
./test/abstract_unit.rb:70:in `execute''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:533:in
`select''
./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
`select_all_without_query_cache''
./test/../lib/active_record/connection_adapters/abstract/query_cache.rb:55:in
`select_all''
./test/../lib/active_record/associations.rb:1267:in
`select_limited_ids_list''
./test/../lib/active_record/associations.rb:1257:in
`add_limited_ids_condition!''
./test/../lib/active_record/associations.rb:1246:in
`construct_finder_sql_with_included_associations''
./test/../lib/active_record/associations.rb:1234:in
`select_all_rows''
./test/../lib/active_record/associations.rb:1114:in
`find_with_associations''
./test/../lib/active_record/associations.rb:1112:in `catch''
./test/../lib/active_record/associations.rb:1112:in
`find_with_associations''
./test/../lib/active_record/base.rb:1003:in `find_every''
./test/../lib/active_record/base.rb:430:in `find''
./test/associations/eager_test.rb:107:in
`test_eager_association_loading_with_explicit_join''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`__send__''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`run''
4) Error:
test_limited_eager_with_multiple_order_columns(EagerAssociationTest):
ActiveRecord::StatementInvalid: DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
ORDER BY items must appear in the select list if SELECT DISTINCT is
specified.
HRESULT error code:0x80020009
Exception occurred.: SELECT * FROM (SELECT TOP 2 * FROM (SELECT DISTINCT
TOP 3 posts.id FROM posts LEFT OUTER JOIN authors ON authors.id =
posts.author_id LEFT OUTER JOIN comments ON comments.post_id = posts.id WHERE
(authors.name = ''David'') ORDER BY UPPER(posts.title),
posts.id) AS tmp1 ORDER BY title DESC, id DESC) AS tmp2 ORDER BY title, id
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:137:in
`log''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:337:in
`execute_without_counting''
./test/abstract_unit.rb:70:in `execute''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:533:in
`select''
./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
`select_all_without_query_cache''
./test/../lib/active_record/connection_adapters/abstract/query_cache.rb:55:in
`select_all''
./test/../lib/active_record/associations.rb:1267:in
`select_limited_ids_list''
./test/../lib/active_record/associations.rb:1257:in
`add_limited_ids_condition!''
./test/../lib/active_record/associations.rb:1246:in
`construct_finder_sql_with_included_associations''
./test/../lib/active_record/associations.rb:1234:in
`select_all_rows''
./test/../lib/active_record/associations.rb:1114:in
`find_with_associations''
./test/../lib/active_record/associations.rb:1112:in `catch''
./test/../lib/active_record/associations.rb:1112:in
`find_with_associations''
./test/../lib/active_record/base.rb:1003:in `find_every''
./test/../lib/active_record/base.rb:430:in `find''
./test/associations/eager_test.rb:326:in
`test_limited_eager_with_multiple_order_columns''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`__send__''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`run''
5) Error:
test_limited_eager_with_order(EagerAssociationTest):
ActiveRecord::StatementInvalid: DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
ORDER BY items must appear in the select list if SELECT DISTINCT is
specified.
HRESULT error code:0x80020009
Exception occurred.: SELECT * FROM (SELECT TOP 2 * FROM (SELECT DISTINCT
TOP 3 posts.id FROM posts LEFT OUTER JOIN authors ON authors.id =
posts.author_id LEFT OUTER JOIN comments ON comments.post_id = posts.id WHERE
(authors.name = ''David'') ORDER BY UPPER(posts.title)) AS tmp1
ORDER BY title DESC) AS tmp2 ORDER BY title
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:137:in
`log''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:337:in
`execute_without_counting''
./test/abstract_unit.rb:70:in `execute''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:533:in
`select''
./test/../lib/active_record/connection_adapters/abstract/database_statements.rb:7:in
`select_all_without_query_cache''
./test/../lib/active_record/connection_adapters/abstract/query_cache.rb:55:in
`select_all''
./test/../lib/active_record/associations.rb:1267:in
`select_limited_ids_list''
./test/../lib/active_record/associations.rb:1257:in
`add_limited_ids_condition!''
./test/../lib/active_record/associations.rb:1246:in
`construct_finder_sql_with_included_associations''
./test/../lib/active_record/associations.rb:1234:in
`select_all_rows''
./test/../lib/active_record/associations.rb:1114:in
`find_with_associations''
./test/../lib/active_record/associations.rb:1112:in `catch''
./test/../lib/active_record/associations.rb:1112:in
`find_with_associations''
./test/../lib/active_record/base.rb:1003:in `find_every''
./test/../lib/active_record/base.rb:430:in `find''
./test/associations/eager_test.rb:321:in
`test_limited_eager_with_order''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`__send__''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`run''
6) Error:
test_select_rows(FinderTest):
ActiveRecord::StatementInvalid: DBI::DatabaseError: Execute
OLE error code:80040E14 in Microsoft OLE DB Provider for SQL Server
Line 1: Incorrect syntax near ''LIMIT''.
HRESULT error code:0x80020009
Exception occurred.: SELECT id, firm_id, client_of, name FROM companies
ORDER BY id LIMIT 3
./test/../lib/active_record/connection_adapters/abstract_adapter.rb:137:in
`log''
c:/ruby/lib/ruby/gems/1.8/gems/activerecord-sqlserver-adapter-1.0.0/lib/active_record/connection_adapters/sqlserver_adapter.rb:262:in
`select_rows''
./test/finder_test.rb:608:in `test_select_rows''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`__send__''
c:/ruby/lib/ruby/gems/1.8/gems/mocha-0.5.5/lib/mocha/test_case_adapter.rb:19:in
`run''
7) Error:
test_attributes(FixturesTest):
ActiveRecord::StatementInvalid: DBI::DatabaseError: Not enough SQL parameters:
INSERT INTO binaries ([id], [data]) VALUES (1, ''ÿØÿà%02 JFIF%02
%02H%02H%02%02ÿÛ%02C%02 %01 %00 %03 %03
$.'''' ",# (7),01444
''''9=82<.342ÿÛ%02C %00%00 2!
!22222222222222222222222222222222222222222222222222ÿÀ%02 ^ "%02
ÿÄ%02 %02%02 %02%02%02%02%02%02%02%02%02%02 ÿÄ%02E %02
%02 %02 !1A Qa"q 2¡±Á #BÑ$Rbá3rðñ C%4Scs¢D²ÒÿÄ%02%03 %02
%02%02%02%02%02%02%02%02%02%02%02 ÿÄ%02+ %02 %02%02%02%02%02 !
1 A Q"2 a¡ #B q±ÿÚ%02 %02
%02?%02÷ú(¢%01(¢%01(¢%01(¢%01(ª·ú
¦h÷W· Á%01õw8ú Sí@ ª9§Þ gT
ff8%02%01A§ø²ÓZåôýÁ`Ës Áè 8ô9ïéR |ýÄ¿Øó ámïþ$hÖÒ g¹ ÿ%02Q øOÐTpøÍõ
-lѨÇôãç
}¼ðöq ´ö0¦rZDø Ï"iú]Òý6 Çþ$ aØ{%01í{ S Í©ßMÏÚe%02õ
ýª¾fe>lÜ÷$ñøÔ«· 1ø®F IùÔ "¼É(·È`fÚ|½Ã#v8ÍA§\ [U¶k7 eÛÎrqϽ]i
Æ>¢³ ±:©¦gÃ;y \ñë[ zF¾ -¿táZ Ù NvîÎ8=hÔ|yy£4&âÍn"rAa9ô¬Å¥¬ú
«6+eCï·vïãçV<BðÜiAw þz%021È9ÁÏãC¢%01)³Ñ<Iep HZ aÑÇ ¦Èë"F §¡
× m 3±msqhåí¦t=Âó ë''''Ø® FþÎÙx¢2 _¡»Èªvÿ%02µ?Xæ
dÕÑUä%03ªiô#TwE V QE%02 QE%02 QE%02 QE%02 QE%02 QE%02 QE%02 QHµMa
h-IôiGè?½ct µ b+ Q%02oòç
ùÖaà_ O/ñ(üè¢1à ØôïÒ¢*Y[ 2{ãûÔÐÊð[ 7 ZG
ò¤ç»%03v¥§ÉàMä´y LÔ~ 1É ÁÈ
ïÔàú|«GámSísËnÜ2.[''''ç\Ó$Ö4ù r$v_ û¬:cÓýéoQ[Ãêv°
&uÁø ÆOÈÒ^ìv%03=ZI[V[iGøy`Äyä IÇáGn ÍE}<×Vð %02\E(tf : {d!
ÊciÁ;E,ÁtHPã ã éKuHõ #Ŭ õ ´ ù cëÚ @r$+ïk¦;ö2È¥ Èã9úÖhÛ
x~ÇR²7WÚ»*ªÀL''''*ß »íL¼ Ç$C.ìÂOcýén§© .×ùr|
Ù·J{áé#DXÐ"»;Û%j «Ð²z*x§FT·{T%00w @ ¯¦~|þ5Ô ÖàòÅí»^A å ½û
§5껺ÿ%02Þ² -¿&ûK± ¥wl @ÇÈæ·,U[7 "u5%00üD ýØv`¨õltÏaM·nþ òÔ
Äè ³ ç©©Ñ2©÷ ''''ý%03H XõTÖW :Tí=¡ó"s-ÇF÷
õ®72A>¡XQ<Ç-
éBtcFãNÔíµ;q5»;àúUÊËiÈ-"U$
ÏCki®ZMv,ÚeûG è}³ëí])ý%03QE QE%02 QE%02 QE%02 QE%02 QE%02 QHõ½H {X©Æ$uä aXÝ
#Õµmîmß ýn;û|© %01 mãÛ8®ð¡T 0GqT®/à ßåS*%00ÙDL ¨cø%02èxÏ®)_ñ-
}àEL´%00·x2{ YfÑwËË ²<úÖnÊA§ø¶öÁ\<W«ö
pûÃæ+BG"¤öæ°Þ''''ëIÔmuT} J ?aÄ{ô£±£Ý ¯ iåÇ ø¾*ú¸\ä
åâ¡ú U foEu ±óÆjbXä = ` ä ÊqÈç?:
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---