public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Search Repo:
Fixed faulty regex in get_table_name method (SQLServerAdapter) (closes 
#2639) [Ryan Tomayko]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2910 
5ecf4fe2-1ee6-0310-87b1-e25e094e27de
dhh (author)
Mon Nov 07 01:54:28 -0800 2005
commit  5132170c727342d547c4d664ba198eb0d8e5ff1b
tree    e798f5f1756500769f2b162815b516dd28429484
parent  ea5bd8e75664e3d6e3c4bf51ba033f67ce9069f0
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Fixed faulty regex in get_table_name method (SQLServerAdapter) #2639 [Ryan Tomayko]
0
+
0
 * Added :include as an option for association declarations [DHH]. Example:
0
 
0
     has_many :posts, :include => [ :author, :comments ]
...
447
448
449
450
 
451
452
 
453
454
455
...
447
448
449
 
450
451
 
452
453
454
455
0
@@ -447,9 +447,9 @@ module ActiveRecord
0
         end
0
 
0
         def get_table_name(sql)
0
- if sql =~ /into\s*([^\(\s]+)\s*|update\s*([^\(\s]+)\s*/i
0
+ if sql =~ /^\s*insert\s+into\s+([^\(\s]+)\s*|^\s*update\s+([^\(\s]+)\s*/i
0
             $1
0
- elsif sql =~ /from\s*([^\(\s]+)\s*/i
0
+ elsif sql =~ /from\s+([^\(\s]+)\s*/i
0
             $1
0
           else
0
             nil

Comments

    No one has commented yet.