mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-07-12 11:14:59 +00:00
Add support for generated virtual columns with expression (#1051)
This commit is contained in:
parent
541d684fba
commit
640b9394cd
5 changed files with 76 additions and 30 deletions
|
@ -507,6 +507,18 @@ fn parse_create_table_comment_character_set() {
|
|||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_create_table_gencol() {
|
||||
let sql_default = "CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a * 2))";
|
||||
mysql_and_generic().verified_stmt(sql_default);
|
||||
|
||||
let sql_virt = "CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a * 2) VIRTUAL)";
|
||||
mysql_and_generic().verified_stmt(sql_virt);
|
||||
|
||||
let sql_stored = "CREATE TABLE t1 (a INT, b INT GENERATED ALWAYS AS (a * 2) STORED)";
|
||||
mysql_and_generic().verified_stmt(sql_stored);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn parse_quote_identifiers() {
|
||||
let sql = "CREATE TABLE `PRIMARY` (`BEGIN` INT PRIMARY KEY)";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue