Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add C-style comments test case to sqlparser test (#555)
- Loading branch information
Showing
25 changed files
with
93 additions
and
23 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
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
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ CREATE TABLE emp ( | |
salary integer, | ||
last_date timestamp, | ||
last_user text | ||
); | ||
); |
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
CREATE TRIGGER emp_stamp BEFORE INSERT OR UPDATE ON emp | ||
FOR EACH ROW EXECUTE FUNCTION emp_stamp(); | ||
FOR EACH ROW EXECUTE FUNCTION emp_stamp(); |
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
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 |
---|---|---|
|
@@ -29,4 +29,4 @@ BEGIN | |
EXECUTE a_output; | ||
END; | ||
' LANGUAGE 'plpgsql'; | ||
' LANGUAGE 'plpgsql'; |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
CREATE TABLE ssh_keys ( | ||
id integer NOT NULL, | ||
"publicKey" text | ||
); | ||
); |
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
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
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 |
---|---|---|
|
@@ -2,4 +2,4 @@ CREATE TABLE ssh_keys ( | |
id integer NOT NULL, | ||
"publicKey" text | ||
-- insert comment there | ||
); | ||
); |
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 |
---|---|---|
|
@@ -3,4 +3,4 @@ CREATE TABLE ssh_keys_backup ( | |
-- insert comment here | ||
"publicKey" text | ||
-- insert comment there | ||
); | ||
); |
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
CREATE TABLE article ( | ||
id text, | ||
content text); | ||
content text); |
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
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 |
---|---|---|
|
@@ -7,4 +7,4 @@ first paragraph | |
-- with a comment | ||
-- with an indent comment | ||
second paragraph'); | ||
second paragraph'); |
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 |
---|---|---|
|
@@ -9,4 +9,4 @@ BEGIN | |
-- technology was successful | ||
RETURN 1; | ||
END; | ||
$$ LANGUAGE plpgsql; | ||
$$ LANGUAGE plpgsql; |
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
CREATE INDEX ON public.users (user_id); | ||
CREATE INDEX ON public.users (user_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE `table_a` ( | ||
`column_1` DATETIME DEFAULT NOW(), | ||
`column_2` DATETIME DEFAULT NOW(), | ||
`column_3` DATETIME DEFAULT NOW() | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; |
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,5 @@ | ||
CREATE TABLE `table_b` ( | ||
`column_1` DATETIME DEFAULT NOW(), | ||
`column_2` DATETIME DEFAULT NOW(), | ||
`column_3` DATETIME DEFAULT NOW() | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; |
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,5 @@ | ||
CREATE TABLE `table_c` ( | ||
`column_1` DATETIME DEFAULT NOW(), | ||
`column_2` DATETIME DEFAULT NOW(), | ||
`column_3` DATETIME DEFAULT NOW() | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; |
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 @@ | ||
/*!80031 ALTER TABLE `table_a` MODIFY `column_1` TEXT NOT NULL */; |
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 @@ | ||
/*!80031 ALTER TABLE `table_b` MODIFY `column_2` TEXT NOT NULL */; |
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 @@ | ||
/*!80033 ALTER TABLE `table_c` MODIFY `column_3` TEXT NOT NULL */; |
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,23 @@ | ||
-- +goose Up | ||
|
||
CREATE TABLE `table_a` ( | ||
`column_1` DATETIME DEFAULT NOW(), | ||
`column_2` DATETIME DEFAULT NOW(), | ||
`column_3` DATETIME DEFAULT NOW() | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; | ||
|
||
CREATE TABLE `table_b` ( | ||
`column_1` DATETIME DEFAULT NOW(), | ||
`column_2` DATETIME DEFAULT NOW(), | ||
`column_3` DATETIME DEFAULT NOW() | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; | ||
|
||
CREATE TABLE `table_c` ( | ||
`column_1` DATETIME DEFAULT NOW(), | ||
`column_2` DATETIME DEFAULT NOW(), | ||
`column_3` DATETIME DEFAULT NOW() | ||
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4; | ||
|
||
/*!80031 ALTER TABLE `table_a` MODIFY `column_1` TEXT NOT NULL */; | ||
/*!80031 ALTER TABLE `table_b` MODIFY `column_2` TEXT NOT NULL */; | ||
/*!80033 ALTER TABLE `table_c` MODIFY `column_3` TEXT NOT NULL */; |