Skip to content

Commit debea12

Browse files
committed
Generate correct view definition if a table shares its name with the database
1 parent e618052 commit debea12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/scenic/adapters/my_sql.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def drop_materialized_view(*_)
8787
execute("SHOW CREATE VIEW #{quote_table_name(name)}")
8888
.first[1]
8989
.sub(/\A.*#{quote_table_name(name)} AS /i, '')
90-
.gsub(/#{quote_table_name(@connectable.connection.current_database)}\./, '')
90+
.gsub(/(\s|\(|,)#{quote_table_name(@connectable.connection.current_database)}\./, '\1')
9191
end
9292
end
9393
end

0 commit comments

Comments
 (0)