I'm seeing this, reverting the fix for bug #1506079 appears to fix it - I'm seeing this on CentOS7 and Fedora 21 mariadb.
2015-12-09 15:19:36.682 ERROR oslo_db.sqlalchemy.exc_filters [-] DBAPIError exception wrapped from (pymysql.err.InternalError) (1093, u"Table 'raw_template' is specified twice, both as a target for 'DELETE' and as a separate source for data") [SQL: u'DELETE FROM raw_template WHERE raw_template.id IN (SELECT raw_template.id \nFROM raw_template LEFT OUTER JOIN stack ON stack.prev_raw_template_id = raw_template.id OR stack.raw_template_id = raw_template.id \nWHERE stack.id IS NULL)']
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters Traceback (most recent call last):
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/base.py", line 1139, in _execute_context
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters context)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib64/python2.7/site-packages/sqlalchemy/engine/default.py", line 450, in do_execute
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters cursor.execute(statement, parameters)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 146, in execute
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters result = self._query(query)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/cursors.py", line 296, in _query
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters conn.query(q)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 781, in query
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters self._affected_rows = self._read_query_result(unbuffered=unbuffered)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 942, in _read_query_result
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters result.read()
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 1138, in read
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters first_packet = self.connection._read_packet()
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 906, in _read_packet
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters packet.check_error()
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/connections.py", line 367, in check_error
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters err.raise_mysql_exception(self._data)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 120, in raise_mysql_exception
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters _check_mysql_exception(errinfo)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters File "/usr/lib/python2.7/site-packages/pymysql/err.py", line 115, in _check_mysql_exception
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters raise InternalError(errno, errorvalue)
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters InternalError: (1093, u"Table 'raw_template' is specified twice, both as a target for 'DELETE' and as a separate source for data")
2015-12-09 15:19:36.682 TRACE oslo_db.sqlalchemy.exc_filters
ERROR: (pymysql.err.InternalError) (1093, u"Table 'raw_template' is specified twice, both as a target for 'DELETE' and as a separate source for data") [SQL: u'DELETE FROM raw_template WHERE raw_template.id IN (SELECT raw_template.id \nFROM raw_template LEFT OUTER JOIN stack ON stack.prev_raw_template_id = raw_template.id OR stack.raw_template_id = raw_template.id \nWHERE stack.id IS NULL)']
It doesn't look like we've got an integration test for this, I guess adding one would be a good idea, as this has ended up broken a few times now.