Exemplo n.º 1
0
        public virtual List <MySqlError> ReportWarnings(MySqlConnection connection)
        {
            List <MySqlError> warnings = new List <MySqlError>();

            MySqlCommand cmd = new MySqlCommand("SHOW WARNINGS", connection);

            cmd.InternallyCreated = true;
            using (MySqlDataReader reader = cmd.ExecuteReader())
            {
                while (reader.Read())
                {
                    warnings.Add(new MySqlError(reader.GetString(0),
                                                reader.GetInt32(1), reader.GetString(2)));
                }
            }

            MySqlInfoMessageEventArgs args = new MySqlInfoMessageEventArgs();

            args.errors = warnings.ToArray();
            if (connection != null)
            {
                connection.OnInfoMessage(args);
            }
            return(warnings);
        }
Exemplo n.º 2
0
 internal void OnInfoMessage(MySqlInfoMessageEventArgs args)
 {
     if (InfoMessage != null)
     {
         InfoMessage(this, args);
     }
 }