@property
def update_where_target_in_subquery(self):
- """Target must support UPDATE where the same table is present in a
- subquery in the WHERE clause.
+ """Target must support UPDATE (or DELETE) where the same table is
+ present in a subquery in the WHERE clause.
This is an ANSI-standard syntax that apparently MySQL can't handle,
such as:
FROM documents GROUP BY documents.user_id
)
"""
- return fails_if('mysql',
- 'MySQL error 1093 "Cant specify target table '
- 'for update in FROM clause"')
+ return fails_if(
+ self._mysql_not_mariadb_103,
+ 'MySQL error 1093 "Cant specify target table '
+ 'for update in FROM clause", resolved by MariaDB 10.3')
@property
def savepoints(self):
"""Target database must support INTERSECT or equivalent."""
return fails_if([
- "firebird", "mysql", "sybase",
- ], 'no support for INTERSECT')
+ "firebird", self._mysql_not_mariadb_103,
+ "sybase",
+ ], 'no support for INTERSECT')
@property
def except_(self):
"""Target database must support EXCEPT or equivalent (i.e. MINUS)."""
return fails_if([
- "firebird", "mysql", "sybase",
- ], 'no support for EXCEPT')
+ "firebird", self._mysql_not_mariadb_103,
+ "sybase",
+ ], 'no support for EXCEPT')
@property
def parens_in_union_contained_select_w_limit_offset(self):
config.db.dialect._mariadb_normalized_version_info < (10, 2)
)
+ def _mysql_not_mariadb_103(self, config):
+ return against(config, "mysql") and (
+ not config.db.dialect._is_mariadb or
+ config.db.dialect._mariadb_normalized_version_info < (10, 3)
+ )
+
def _has_mysql_on_windows(self, config):
return against(config, 'mysql') and \
config.db.dialect._detect_casing(config.db) == 1
found2 = self._fetchall_sorted(e.alias().select().execute())
eq_(found2, wanted)
- @testing.fails_on('sqlite', "Can't handle this style of nesting")
+ @testing.fails_on(
+ ['sqlite', 'mysql'], "Can't handle this style of nesting")
@testing.requires.except_
def test_except_style3(self):
# aaa, bbb, ccc - (aaa, bbb, ccc - (ccc)) = ccc
)
@testing.requires.intersect
- @testing.fails_on('sqlite', "sqlite can't handle leading parenthesis")
+ @testing.fails_on(['sqlite', 'mysql'],
+ "sqlite can't handle leading parenthesis")
def test_intersect_unions(self):
u = intersect(
union(