diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-13 09:17:40 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-09-13 09:17:40 +0000 |
commit | bdf5cc7bdd5ec93dc928d81e286f7b1e678ba19d (patch) | |
tree | 4d46f9407b792f6fd5d767d510e6865ec9640569 /tests/test_parser.py | |
parent | Releasing progress-linux version 18.3.0-1. (diff) | |
download | sqlglot-bdf5cc7bdd5ec93dc928d81e286f7b1e678ba19d.tar.xz sqlglot-bdf5cc7bdd5ec93dc928d81e286f7b1e678ba19d.zip |
Merging upstream version 18.4.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_parser.py')
-rw-r--r-- | tests/test_parser.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_parser.py b/tests/test_parser.py index 7135dd8..ad9b941 100644 --- a/tests/test_parser.py +++ b/tests/test_parser.py @@ -719,3 +719,18 @@ class TestParser(unittest.TestCase): self.assertEqual(ast.find(exp.Interval).this.sql(), "'71'") self.assertEqual(ast.find(exp.Interval).unit.assert_is(exp.Var).sql(), "days") + + def test_parse_concat_ws(self): + ast = parse_one("CONCAT_WS(' ', 'John', 'Doe')") + + self.assertEqual(ast.sql(), "CONCAT_WS(' ', 'John', 'Doe')") + self.assertEqual(ast.expressions[0].sql(), "' '") + self.assertEqual(ast.expressions[1].sql(), "'John'") + self.assertEqual(ast.expressions[2].sql(), "'Doe'") + + # Ensure we can parse without argument when error level is ignore + ast = parse( + "CONCAT_WS()", + error_level=ErrorLevel.IGNORE, + ) + self.assertEqual(ast[0].sql(), "CONCAT_WS()") |