diff options
Diffstat (limited to 'test/dialect/mysql.py')
-rw-r--r-- | test/dialect/mysql.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/dialect/mysql.py b/test/dialect/mysql.py index a233c25f5..fa8a85ec4 100644 --- a/test/dialect/mysql.py +++ b/test/dialect/mysql.py @@ -982,6 +982,19 @@ class SQLTest(TestBase, AssertsCompiledSQL): for type_, expected in specs: self.assert_compile(cast(t.c.col, type_), expected) + def test_extract(self): + t = sql.table('t', sql.column('col1')) + + for field in 'year', 'month', 'day': + self.assert_compile( + select([extract(field, t.c.col1)]), + "SELECT EXTRACT(%s FROM t.col1) AS anon_1 FROM t" % field) + + # millsecondS to millisecond + self.assert_compile( + select([extract('milliseconds', t.c.col1)]), + "SELECT EXTRACT(millisecond FROM t.col1) AS anon_1 FROM t") + class RawReflectionTest(TestBase): def setUp(self): |