diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-19 14:50:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-19 14:50:39 +0000 |
commit | f2981e8e4d28233864f1ca06ecec45ab80bf9eae (patch) | |
tree | b70cb633916830138ce3424aa361f0bbaff02be2 /tests/test_expressions.py | |
parent | Releasing debian version 10.0.1-1. (diff) | |
download | sqlglot-f2981e8e4d28233864f1ca06ecec45ab80bf9eae.tar.xz sqlglot-f2981e8e4d28233864f1ca06ecec45ab80bf9eae.zip |
Merging upstream version 10.0.8.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_expressions.py')
-rw-r--r-- | tests/test_expressions.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/test_expressions.py b/tests/test_expressions.py index 63371d8..c0927ad 100644 --- a/tests/test_expressions.py +++ b/tests/test_expressions.py @@ -441,6 +441,9 @@ class TestExpressions(unittest.TestCase): self.assertIsInstance(parse_one("VARIANCE(a)"), exp.Variance) self.assertIsInstance(parse_one("VARIANCE_POP(a)"), exp.VariancePop) self.assertIsInstance(parse_one("YEAR(a)"), exp.Year) + self.assertIsInstance(parse_one("BEGIN DEFERRED TRANSACTION"), exp.Transaction) + self.assertIsInstance(parse_one("COMMIT"), exp.Commit) + self.assertIsInstance(parse_one("ROLLBACK"), exp.Rollback) def test_column(self): dot = parse_one("a.b.c") @@ -479,9 +482,9 @@ class TestExpressions(unittest.TestCase): self.assertEqual(column.text("expression"), "c") self.assertEqual(column.text("y"), "") self.assertEqual(parse_one("select * from x.y").find(exp.Table).text("db"), "x") - self.assertEqual(parse_one("select *").text("this"), "") - self.assertEqual(parse_one("1 + 1").text("this"), "1") - self.assertEqual(parse_one("'a'").text("this"), "a") + self.assertEqual(parse_one("select *").name, "") + self.assertEqual(parse_one("1 + 1").name, "1") + self.assertEqual(parse_one("'a'").name, "a") def test_alias(self): self.assertEqual(alias("foo", "bar").sql(), "foo AS bar") @@ -538,8 +541,8 @@ class TestExpressions(unittest.TestCase): this=exp.Literal.string("TABLE_FORMAT"), value=exp.to_identifier("test_format"), ), - exp.EngineProperty(this=exp.Literal.string("ENGINE"), value=exp.NULL), - exp.CollateProperty(this=exp.Literal.string("COLLATE"), value=exp.TRUE), + exp.EngineProperty(this=exp.Literal.string("ENGINE"), value=exp.null()), + exp.CollateProperty(this=exp.Literal.string("COLLATE"), value=exp.true()), ] ), ) |