Skip to content

Commit

Permalink
Fix creating views with subqueries
Browse files Browse the repository at this point in the history
  • Loading branch information
syabruk committed Jun 26, 2024
1 parent b45aa8d commit 634271f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def assign_database_to_subquery!(subquery)
# If you do not specify a database explicitly, ClickHouse will use the "default" database.
return unless subquery

match = subquery.match(/(?<=from)[^.\w]+(?<database>\w+(?=\.))?(?<table_name>[.\w]+)/i)
match = subquery.match(/(?<=from)[^.\w(]+(?<database>\w+(?=\.))?(?<table_name>[.\w]+)/i)
return unless match
return if match[:database]

Expand Down

0 comments on commit 634271f

Please sign in to comment.