title: mysql-connector-python InterfaceError: Failed getting warnings when executing a query with multiple statements with get_warnings=True
body: <p>Using Python 3.7, I execute a query against a MySQL database, with multiple statements, with get_warnings enabled:</p>
  
  <pre class="lang-py prettyprint-override"><code>import mysql.connector
  cnx = mysql.connector.connect(host='xxx',
                                  user='xxx',
                                  password='xxx',
                                  database='xxx',
                                  use_pure=False,
                                  get_warnings=True)
  # Test 1, works:
  cur = cnx.cursor()
  cur.execute('SELECT "a"+1')
  for row in cur:
      print(row)
  print(cur.fetchwarnings())
  cur.close()
  
  # Test 2, InterfaceError:
  cur = cnx.cursor()
  for rs in cur.execute('SELECT "a"+1; SELECT 2', multi=True):
      for row in rs:
          print(row)
      print(rs.fetchwarnings())
  </code></pre>
  
  <p>The first test executes a single statement, iterates over the cursor, fetches data, and finally prints warnings. Output as expected:</p>
  
  <pre><code>(1.0,)
  [('Warning', 1292, "Truncated incorrect DOUBLE value: 'a'")]
  </code></pre>
  
  <p>The second test, (you can remove the first test altogether), will execute print(row) once, then an Exception happens. Output:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Program Files\Python37\lib\site-packages\mysql\connector\connection_cext.py", line 472, in cmd_query
      raw_as_string=raw_as_string)
  _mysql_connector.MySQLInterfaceError: Commands out of sync; you can't run this command now
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "C:\Program Files\Python37\lib\site-packages\mysql\connector\cursor_cext.py", line 138, in _fetch_warnings
      _ = self._cnx.cmd_query("SHOW WARNINGS")
    File "C:\Program Files\Python37\lib\site-packages\mysql\connector\connection_cext.py", line 475, in cmd_query
      sqlstate=exc.sqlstate)
  mysql.connector.errors.DatabaseError: 2014 (HY000): Commands out of sync; you can't run this command now
  
  During handling of the above exception, another exception occurred:
  ....etc....
  </code></pre>
  
  <p>Did anyone encounter the same problem? How did you solve it? What am I doing wrong? Could this be a bug in the connector?</p>
  
  <p>Other things I've tried:</p>
  
  <ul>
  <li>If you set get_warnings to False, no error happens and
  fetchwarnings() returns None</li>
  <li>If you remove the problem from the SQL code, no error happens and fetchwarnings() returns None</li>
  <li>use_pure can be True or False, the only difference is a slightly different traceback</li>
  <li>Using fetchall() instead of for row in rs gives the same result</li>
  <li>Many other variations give the same error.</li>
  </ul>
  
  <p>System:</p>
  
  <ul>
  <li>Connector version is mysql-connector-python-8.0.17 but 8.0.16 has the same issue.</li>
  <li>Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32</li>
  <li>MySQL 5.7</li>
  </ul>