docs: public SQLWarning getWarnings() throws SQLException {
      if (warningsCleared || isClosed() || !protocol.hasWarnings()) {
        return null;
      }
  
      SQLWarning last = null;
      SQLWarning first = null;
  
      try (Statement st = this.createStatement()) {
        try (ResultSet rs = st.executeQuery("show warnings")) {
          // returned result set has 'level', 'code' and 'message' columns, in this order.
          while (rs.next()) {
            int code = rs.getInt(2);
            String message = rs.getString(3);
            SQLWarning warning = new SQLWarning(message, ExceptionMapper.mapCodeToSqlState(code),
                code);
            if (first == null) {
              first = warning;
              last = warning;
            } else {
              last.setNextWarning(warning);
              last = warning;
            }
          }
        }
      }
      return first;
    }