'Check that auto_increment fields are reset correctly by sql_flush().
Before MySQL version 5.0.13 TRUNCATE did not do auto_increment reset.
Refs #16961.'

@unittest.skipUnless((connection.vendor == u'mysql'), u'Test    valid    only    for    MySQL')
def test_autoincrement(self):

    statements = connection.ops.sql_flush(no_style(), tables=[u'test'], sequences=[{u'table': u'test', u'col': u'somecol'}])
    found_reset = False
    for sql in statements:
        found_reset = (found_reset or (u'ALTER    TABLE' in sql))
    if (connection.mysql_version < (5, 0, 13)):
        self.assertTrue(found_reset)
    else:
        self.assertFalse(found_reset)
