diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-07 12:35:01 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-04-07 12:35:01 +0000 |
commit | 58c11f70074708344e433080e47621091a6dcd84 (patch) | |
tree | 2589166e0e58be4947e07a956d26efa497bccaf2 /tests/dialects/test_mysql.py | |
parent | Adding upstream version 11.4.5. (diff) | |
download | sqlglot-58c11f70074708344e433080e47621091a6dcd84.tar.xz sqlglot-58c11f70074708344e433080e47621091a6dcd84.zip |
Adding upstream version 11.5.2.upstream/11.5.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/dialects/test_mysql.py')
-rw-r--r-- | tests/dialects/test_mysql.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/dialects/test_mysql.py b/tests/dialects/test_mysql.py index 5059d05..f618728 100644 --- a/tests/dialects/test_mysql.py +++ b/tests/dialects/test_mysql.py @@ -204,6 +204,41 @@ class TestMySQL(Validator): }, ) + def test_match_against(self): + self.validate_all( + "MATCH(col1, col2, col3) AGAINST('abc')", + read={ + "": "MATCH(col1, col2, col3) AGAINST('abc')", + "mysql": "MATCH(col1, col2, col3) AGAINST('abc')", + }, + write={ + "": "MATCH(col1, col2, col3) AGAINST('abc')", + "mysql": "MATCH(col1, col2, col3) AGAINST('abc')", + }, + ) + self.validate_all( + "MATCH(col1, col2) AGAINST('abc' IN NATURAL LANGUAGE MODE)", + write={"mysql": "MATCH(col1, col2) AGAINST('abc' IN NATURAL LANGUAGE MODE)"}, + ) + self.validate_all( + "MATCH(col1, col2) AGAINST('abc' IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION)", + write={ + "mysql": "MATCH(col1, col2) AGAINST('abc' IN NATURAL LANGUAGE MODE WITH QUERY EXPANSION)" + }, + ) + self.validate_all( + "MATCH(col1, col2) AGAINST('abc' IN BOOLEAN MODE)", + write={"mysql": "MATCH(col1, col2) AGAINST('abc' IN BOOLEAN MODE)"}, + ) + self.validate_all( + "MATCH(col1, col2) AGAINST('abc' WITH QUERY EXPANSION)", + write={"mysql": "MATCH(col1, col2) AGAINST('abc' WITH QUERY EXPANSION)"}, + ) + self.validate_all( + "MATCH(a.b) AGAINST('abc')", + write={"mysql": "MATCH(a.b) AGAINST('abc')"}, + ) + def test_mysql(self): self.validate_all( "SELECT a FROM tbl FOR UPDATE", |