code: func MySQLErrorNumber(err error) uint16 {
  	if err, ok := err.(*mysql.MySQLError); ok {
  		return err.Number
  	}
  	return 0
  }
docs: // MySQLErrorNumber returns the Number field from err if it is a *mysql.Error.
  // Returns 0 for non-mysql error types.