Title: [1003] trunk/activerecord-jdbc: JRUBY-1977, 17427: Fix information_schema select issue with MSSQL (Matt Burke)
Revision
1003
Author
nicksieger
Date
2008-06-03 23:16:26 -0400 (Tue, 03 Jun 2008)

Log Message

JRUBY-1977, 17427: Fix information_schema select issue with MSSQL (Matt Burke)

Modified Paths

Diff

Modified: trunk/activerecord-jdbc/History.txt (1002 => 1003)


--- trunk/activerecord-jdbc/History.txt	2008-05-30 16:37:39 UTC (rev 1002)
+++ trunk/activerecord-jdbc/History.txt	2008-06-04 03:16:26 UTC (rev 1003)
@@ -8,7 +8,9 @@
 - Fix missing quote_table_name function under Rails 1.2.6 and earlier
 - Small tweaks to jdbc.rake to select proper config
 - JRUBY-2011: Fix MSSQL string un-quoting issue (Silvio Fonseca)
+- JRUBY-1977, 17427: Fix information_schema select issue with MSSQL (Matt Burke)
 
+
 == 0.8
 
 - NOTE: This release is only compatible with JRuby 1.1RC3 or later.

Modified: trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mssql.rb (1002 => 1003)


--- trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mssql.rb	2008-05-30 16:37:39 UTC (rev 1002)
+++ trunk/activerecord-jdbc/lib/jdbc_adapter/jdbc_mssql.rb	2008-06-04 03:16:26 UTC (rev 1003)
@@ -185,6 +185,7 @@
         }
       end
       def change_column_default(table_name, column_name, default) #:nodoc:
+        remove_default_constraint(table_name, column_name)
         execute "ALTER TABLE #{table_name} ADD CONSTRAINT DF_#{table_name}_#{column_name} DEFAULT #{quote(default, column_name)} FOR #{column_name}"
       end
       def remove_column(table_name, column_name)
@@ -214,6 +215,7 @@
 
 
       def columns(table_name, name = nil)
+        return [] if table_name =~ /^information_schema\./i
         cc = super
         cc.each do |col|
           col.identity = true if col.sql_type =~ /identity/i

Modified: trunk/activerecord-jdbc/test/manualTestDatabase.rb (1002 => 1003)


--- trunk/activerecord-jdbc/test/manualTestDatabase.rb	2008-05-30 16:37:39 UTC (rev 1002)
+++ trunk/activerecord-jdbc/test/manualTestDatabase.rb	2008-06-04 03:16:26 UTC (rev 1003)
@@ -172,11 +172,7 @@
   pelle.female = false
   pelle.save
 
-
-
-
-
-  prods = Product.find_all
+  prods = Product.find :all
   order = Order.new(:name => "Dalai Lama", :address => "Great Road 32", :email => "[EMAIL PROTECTED]", :pay_type => "cash")
   order.line_items << LineItem.new(:product => prods[0], :quantity => 3, :total_price => (prods[0].price * 3))
   order.line_items << LineItem.new(:product => prods[2], :quantity => 1, :total_price => (prods[2].price))
_______________________________________________
Jruby-extras-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to