-
Notifications
You must be signed in to change notification settings - Fork 620
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3850 from masatake/sql--create-view-if-not-exists
SQL: extact views in "create view if not exists VIEW ..."
- Loading branch information
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--sort=no |
1 change: 1 addition & 0 deletions
1
Units/parser-sql.r/sql-create-view-if-not-exists.d/expected.tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
messages_data input.sql /^CREATE VIEW IF NOT EXISTS messages_data AS$/;" V |
21 changes: 21 additions & 0 deletions
21
Units/parser-sql.r/sql-create-view-if-not-exists.d/input.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- Taken from leapp-0.15.1/res/schema/audit-layout.sql | ||
|
||
CREATE VIEW IF NOT EXISTS messages_data AS | ||
SELECT | ||
message.id AS id, | ||
message.context AS context, | ||
message.stamp AS stamp, | ||
message.topic AS topic, | ||
message.type AS type, | ||
data_source.actor AS actor, | ||
data_source.phase AS phase, | ||
msg_data.hash AS message_hash, | ||
msg_data.data AS message_data, | ||
host.hostname AS hostname | ||
FROM | ||
message | ||
JOIN | ||
data_source ON data_source.id = message.data_source_id, | ||
message_data AS msg_data ON message.message_data_hash = msg_data.hash, | ||
host ON host.id = data_source.host_id | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters