Skip to content

Commit f87dbd6

Browse files
committed
Parse table names with spaces correctly
1 parent 0f02058 commit f87dbd6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_record/connection_adapters/sqlserver/schema_statements.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ def get_table_name(sql)
674674
# Parses the raw table name that is used in the SQL. Table name could include database/schema/etc.
675675
def get_raw_table_name(sql)
676676
case sql
677-
when /^\s*(INSERT|EXEC sp_executesql N'INSERT)(\s+INTO)?\s+([^\(\s]+)\s*|^\s*update\s+([^\(\s]+)\s*/i
677+
when /^\s*(INSERT|EXEC sp_executesql N'INSERT)(\s+INTO)?\s+([^\(]+)\s*|^\s*update\s+([^\(\s]+)\s*/i
678678
Regexp.last_match[3] || Regexp.last_match[4]
679679
when /FROM\s+([^\(\s]+)\s*/i
680680
Regexp.last_match[1]

0 commit comments

Comments
 (0)