From noreply at rubyforge.org Mon Sep 1 02:20:53 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 1 Sep 2008 02:20:53 -0400 (EDT) Subject: [Jruby-extras-devel] [ jruby-extras-Bugs-20503 ] Derby adapter does not quote dates properly Message-ID: <20080901062053.4E55F18581A8@rubyforge.org> Bugs item #20503, was opened at 2008-06-04 09:55 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=20503&group_id=2014 Category: AR-JDBC Group: None Status: Open Resolution: None Priority: 3 Submitted By: David Koontz (dkoontz) Assigned to: Nobody (None) Summary: Derby adapter does not quote dates properly Initial Comment: The derby adapter is creating dates such as '2008-06-02' but derby won't accept dates in that format, '2008-06-02 00.00.00' or '2008-06-02-00.00.00' is required. As a workaround, you can pass in a pre-formatted string (or a string range even for between clauses). ---------------------------------------------------------------------- Comment By: Daniel Sheppard (danshep) Date: 2008-09-01 16:20 Message: Patch here should fix issue: http://rubyforge.org/tracker/index.php?func=detail&aid=21760&group_id=2014&atid=7859 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=20503&group_id=2014 From noreply at rubyforge.org Mon Sep 1 02:21:22 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Mon, 1 Sep 2008 02:21:22 -0400 (EDT) Subject: [Jruby-extras-devel] [ jruby-extras-Bugs-21720 ] Derby adapter quotes rails 2.1 times as yaml Message-ID: <20080901062122.4781118581A8@rubyforge.org> Bugs item #21720, was opened at 2008-08-29 17:57 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=21720&group_id=2014 Category: AR-JDBC Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: Derby adapter quotes rails 2.1 times as yaml Initial Comment: Using jruby 1.1.3. Activerecord-jdbc 0.8.2. Rails 2.1.0 >> t = Time.now => Fri Aug 29 17:44:59 +1000 2008 >> ActiveRecord::Base.connection.quote t => "'2008-08-29 17:44:59'" >> ActiveRecord::Base.connection.quote t.in_time_zone => "'--- 2008-08-29 07:44:59.661700 Z\n'" >> Time === t.in_time_zone => true >> ActiveRecord::Base.connection.quoted_date t.in_time_zone => "2008-08-29 07:44:59" >> t.in_time_zone.kind_of? Time => true >> t.in_time_zone.class => ActiveSupport::TimeWithZone For some reason, it appears that the check in JdbcDerbySpec isn't seeing the ActiveSupport::TimeWithZone objects as a kind of time. Relevant java code: } else if (rubyApi.isKindOf(value, runtime.getModule("Date"))) { return quote_string_with_surround(runtime, "'", RubyString.objAsString(context, value), "'"); } else if (rubyApi.isKindOf(value, runtime.getModule("Time")) || rubyApi.isKindOf(value, runtime.getModule("DateTime"))) { return quote_string_with_surround(runtime, "'", (RubyString)(rubyApi.callMethod(recv, "quoted_date", value)), "'"); Also quite puzzling is this behaviour: >> ActiveRecord::Base.connection.quoted_date t.in_time_zone => "2008-08-29 07:44:59" >> ActiveRecord::Base.connection.quoted_date t.in_time_zone.to_datetime => "2008-08-29 07:44:59" >> ActiveRecord::Base.connection.quote t.in_time_zone.to_datetime => "'2008-08-29T07:44:59+00:00'" The check for DateTime comes after the check for Date, so when a DateTime is passed to quote, it's just getting objAsString called instead of quoted_date. ---------------------------------------------------------------------- Comment By: Daniel Sheppard (danshep) Date: 2008-09-01 16:21 Message: Patch here fixes issues: http://rubyforge.org/tracker/index.php?func=detail&aid=21760&group_id=2014&atid=7859 ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=21720&group_id=2014 From noreply at rubyforge.org Thu Sep 4 17:28:43 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Thu, 4 Sep 2008 17:28:43 -0400 (EDT) Subject: [Jruby-extras-devel] [ jruby-extras-Bugs-21816 ] JRuby 1.1.4 with rcov-0.8.1.2.0-java.gem Message-ID: <20080904212843.910E23C8033@rubyforge.org> Bugs item #21816, was opened at 2008-09-04 21:28 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=21816&group_id=2014 Category: None Group: None Status: Open Resolution: None Priority: 3 Submitted By: Suraj Kurapati (snk) Assigned to: Nobody (None) Summary: JRuby 1.1.4 with rcov-0.8.1.2.0-java.gem Initial Comment: Hello, When using Rcov with JRuby on Windows, Rcov crashes when trying to open the following filename for writing: "coverage/file:-C:-Program Files-jruby-1_1_4-lib-jruby_jar!-jruby-path_helper_rb.html" This is because Windows is interpreting the ':' colon symbols in the filename. To fix this, change the following code in lib/rcov/report.rb from: @mangle_filename = Hash.new{|h,base| h[base] = Pathname.new(base).cleanpath.to_s.gsub(%r{^\w:[/\]}, "").tr(".", "_").gsub(/[\\/:]/, "-") + ".html" } To: @mangle_filename = Hash.new{|h,base| h[base] = Pathname.new(base).cleanpath.to_s.gsub(%r{^\w:[/\]}, "").gsub(/\./, "_").gsub(/[\\/]/, "-") + ".html" } Another problem that occurs is Rcov crashes when coercing a NIL into a Fixnum in lib/rcov/rcov.rb:654 in the aggregate_data() method. Change that line from: cov_arr.each_with_index{|x,i| dest[i] += x} to: cov_arr.each_with_index{|x,i| dest[i] += x.to_i} Thanks. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=21816&group_id=2014 From noreply at rubyforge.org Fri Sep 19 01:00:43 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 19 Sep 2008 01:00:43 -0400 (EDT) Subject: [Jruby-extras-devel] [ jruby-extras-Bugs-22018 ] db:test:clone_structure task sends illegal character to Oracle Message-ID: <20080919050043.44BD61858289@rubyforge.org> Bugs item #22018, was opened at 2008-09-19 17:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22018&group_id=2014 Category: AR-JDBC Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nigel Ramsay (nigelramsay) Assigned to: Nobody (None) Summary: db:test:clone_structure task sends illegal character to Oracle Initial Comment: When running "rake db:test:clone_structure", I get the following error: ActiveRecord::ActiveRecordError: ORA-00911: invalid character: INSERT INTO schema_migrations (version) VALUES ('20080915031553'); The illegal character that Oracle is complaining about is the trailing semi-colon. The log file shows the preceding statements executing successfully. Note there do not have a tailing semi-colon: [...snip] INSERT INTO schema_migrations (version) VALUES ('20080724033916') INSERT INTO schema_migrations (version) VALUES ('20080901223816') INSERT INTO schema_migrations (version) VALUES ('20080903231452') INSERT INTO schema_migrations (version) VALUES ('20080909235955') ActiveRecord::ActiveRecordError: ORA-00911: invalid character: INSERT INTO schema_migrations (version) VALUES ('20080915031553'); The bug appears to originate in the "lib/jdbc_adapter/jdbc.rake" file. The db:test:clone_structure task reads in the development_struture.sql file, and performs a split(";\n\n"). This results in an array of statements, where each statement does not have a trailing semi-colon - EXCEPT for the last statement. So the last statement is executed, including the trailing semi-colon. And this final statement is the cause of the "ORA-00911: invalid character" error. This bug can be fixed by ensuring that the final semi-colon is removed before "execute" is called. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22018&group_id=2014 From nobody at rubyforge.org Fri Sep 19 08:34:15 2008 From: nobody at rubyforge.org (nobody at rubyforge.org) Date: Fri, 19 Sep 2008 08:34:15 -0400 (EDT) Subject: [Jruby-extras-devel] [1131] trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc.rake: Rubyforge #22018 : chomp final trailing semicolon for oracle Message-ID: <20080919123415.C81AE18585A2@rubyforge.org> An HTML attachment was scrubbed... URL: From noreply at rubyforge.org Fri Sep 19 08:34:48 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 19 Sep 2008 08:34:48 -0400 (EDT) Subject: [Jruby-extras-devel] [ jruby-extras-Bugs-22018 ] db:test:clone_structure task sends illegal character to Oracle Message-ID: <20080919123448.EB4C718585A0@rubyforge.org> Bugs item #22018, was opened at 2008-09-19 00:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22018&group_id=2014 Category: AR-JDBC Group: None Status: Open Resolution: None Priority: 3 Submitted By: Nigel Ramsay (nigelramsay) Assigned to: Nobody (None) Summary: db:test:clone_structure task sends illegal character to Oracle Initial Comment: When running "rake db:test:clone_structure", I get the following error: ActiveRecord::ActiveRecordError: ORA-00911: invalid character: INSERT INTO schema_migrations (version) VALUES ('20080915031553'); The illegal character that Oracle is complaining about is the trailing semi-colon. The log file shows the preceding statements executing successfully. Note there do not have a tailing semi-colon: [...snip] INSERT INTO schema_migrations (version) VALUES ('20080724033916') INSERT INTO schema_migrations (version) VALUES ('20080901223816') INSERT INTO schema_migrations (version) VALUES ('20080903231452') INSERT INTO schema_migrations (version) VALUES ('20080909235955') ActiveRecord::ActiveRecordError: ORA-00911: invalid character: INSERT INTO schema_migrations (version) VALUES ('20080915031553'); The bug appears to originate in the "lib/jdbc_adapter/jdbc.rake" file. The db:test:clone_structure task reads in the development_struture.sql file, and performs a split(";\n\n"). This results in an array of statements, where each statement does not have a trailing semi-colon - EXCEPT for the last statement. So the last statement is executed, including the trailing semi-colon. And this final statement is the cause of the "ORA-00911: invalid character" error. This bug can be fixed by ensuring that the final semi-colon is removed before "execute" is called. ---------------------------------------------------------------------- >Comment By: Nick Sieger (nicksieger) Date: 2008-09-19 07:34 Message: Thanks for the report, fixed in trunk. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22018&group_id=2014 From noreply at rubyforge.org Fri Sep 19 08:37:37 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Fri, 19 Sep 2008 08:37:37 -0400 (EDT) Subject: [Jruby-extras-devel] [ jruby-extras-Bugs-22018 ] db:test:clone_structure task sends illegal character to Oracle Message-ID: <20080919123737.4F4AB18585A0@rubyforge.org> Bugs item #22018, was opened at 2008-09-19 00:00 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22018&group_id=2014 Category: AR-JDBC Group: None >Status: Closed Resolution: None Priority: 3 Submitted By: Nigel Ramsay (nigelramsay) Assigned to: Nobody (None) Summary: db:test:clone_structure task sends illegal character to Oracle Initial Comment: When running "rake db:test:clone_structure", I get the following error: ActiveRecord::ActiveRecordError: ORA-00911: invalid character: INSERT INTO schema_migrations (version) VALUES ('20080915031553'); The illegal character that Oracle is complaining about is the trailing semi-colon. The log file shows the preceding statements executing successfully. Note there do not have a tailing semi-colon: [...snip] INSERT INTO schema_migrations (version) VALUES ('20080724033916') INSERT INTO schema_migrations (version) VALUES ('20080901223816') INSERT INTO schema_migrations (version) VALUES ('20080903231452') INSERT INTO schema_migrations (version) VALUES ('20080909235955') ActiveRecord::ActiveRecordError: ORA-00911: invalid character: INSERT INTO schema_migrations (version) VALUES ('20080915031553'); The bug appears to originate in the "lib/jdbc_adapter/jdbc.rake" file. The db:test:clone_structure task reads in the development_struture.sql file, and performs a split(";\n\n"). This results in an array of statements, where each statement does not have a trailing semi-colon - EXCEPT for the last statement. So the last statement is executed, including the trailing semi-colon. And this final statement is the cause of the "ORA-00911: invalid character" error. This bug can be fixed by ensuring that the final semi-colon is removed before "execute" is called. ---------------------------------------------------------------------- Comment By: Nick Sieger (nicksieger) Date: 2008-09-19 07:34 Message: Thanks for the report, fixed in trunk. ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22018&group_id=2014 From noreply at rubyforge.org Sat Sep 20 13:56:14 2008 From: noreply at rubyforge.org (noreply at rubyforge.org) Date: Sat, 20 Sep 2008 13:56:14 -0400 (EDT) Subject: [Jruby-extras-devel] [ jruby-extras-Bugs-22080 ] vNJhVdGfPPbKZROv Message-ID: <20080920175615.1BF4B185859F@rubyforge.org> Bugs item #22080, was opened at 2008-09-20 13:56 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22080&group_id=2014 Category: Interface (example) Group: 0.2.3 Status: Open Resolution: None Priority: 3 Submitted By: Nobody (None) Assigned to: Nobody (None) Summary: vNJhVdGfPPbKZROv Initial Comment: N1Tzv3 nrqjlatmhrdq, [url=http://egdponyxrpls.com/]egdponyxrpls[/url], [link=http://fzhnecbjmdzu.com/]fzhnecbjmdzu[/link], http://grynaqmgawdd.com/ ---------------------------------------------------------------------- You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7857&aid=22080&group_id=2014 From Antoni.Mylka at travelocity.com Wed Sep 24 10:14:30 2008 From: Antoni.Mylka at travelocity.com (Mylka, Antoni) Date: Wed, 24 Sep 2008 09:14:30 -0500 Subject: [Jruby-extras-devel] Working without getGeneratedKeys() Message-ID: I'm forced to work with a database that doesn't support getGeneratedKeys() (Teradata 6.0). This method is called in JdbcAdapterInternalService.java in the execute_insert method. I wanted to squeeze my insert statement through the execute_query, but I also wanted to keep the rails validations and to keep the rails value quoting. My question: Is there any civilized workaround? The only way I've been able to do this is: in the controller: oldmanager = @manager oldmanager.public_validate if (oldmanager.valid?) Manager.connection.raw_connection.execute_query( "INSERT INTO #{@manager.public_quoted_table_name} " + "(#{@manager.public_quoted_column_names.join(', ')}) " + "VALUES(#{@manager.public_quoted_attribute_values.join(', ')})") @manager = Manager.find(:first, :conditions => { :Mgr_Type => @manager.Mgr_Type, :First_name => @manager.First_name, :Last_name => @manager.Last_name, :Supervisor_Mgr_id => @manager.Supervisor_Mgr_id, :Email => @manager.Email, :Phone_nbr => @manager.Phone_nbr, :Organization_cd => @manager.Organization_cd}) end and some public_... methods in the Manager model def public_quoted_attribute_values attributes_with_quotes.values end def public_quoted_column_names quoted_column_names end def public_quoted_table_name self.class.quoted_table_name end def public_validate validate end Do you have a better idea? Antoni Mylka Antoni.Mylka at travelocity.com From nicksieger at gmail.com Thu Sep 25 13:04:21 2008 From: nicksieger at gmail.com (Nick Sieger) Date: Thu, 25 Sep 2008 10:04:21 -0700 Subject: [Jruby-extras-devel] Working without getGeneratedKeys() In-Reply-To: References: Message-ID: On Wed, Sep 24, 2008 at 7:14 AM, Mylka, Antoni wrote: > I'm forced to work with a database that doesn't support > getGeneratedKeys() (Teradata 6.0). This method is called in > JdbcAdapterInternalService.java in the execute_insert method. I wanted > to squeeze my insert statement through the execute_query, but I also > wanted to keep the rails validations and to keep the rails value > quoting. My question: Is there any civilized workaround? > > Do you have a better idea? Have you considered monkey-patching #execute_insert to fit the semantics of your database? The methods are only written in Java for a little extra speed, so you can replace them with ruby code if you want. class ActiveRecord::ConnectionAdapters::JdbcConnection def execute_insert(...) end end /Nick