func (s *SignalName) String() string {
	infoStr := ""
	if len(s.Signal.Info) > 0 {
		infoStr = " SET"
		i := 0
		for _, info := range s.Signal.Info {
			if i > 0 {
				infoStr += ","
			}
			infoStr += " " + info.String()
			i++
		}
	}
	return fmt.Sprintf("SIGNAL %s%s", s.Name, infoStr)
}
String implements the sql.Node interface.
package plan
import (
	"fmt"
	"strings"
	"github.com/dolthub/vitess/go/mysql"
	"github.com/dolthub/go-mysql-server/sql"
)
type SignalConditionItemName string
const (
	SignalConditionItemName_ClassOrigin       SignalConditionItemName = "class_origin"
	SignalConditionItemName_SubclassOrigin    SignalConditionItemName = "subclass_origin"
	SignalConditionItemName_MessageText       SignalConditionItemName = "message_text"
	SignalConditionItemName_MysqlErrno        SignalConditionItemName = "mysql_errno"
	SignalConditionItemName_ConstraintCatalog SignalConditionItemName = "constraint_catalog"
	SignalConditionItemName_ConstraintSchema  SignalConditionItemName = "constraint_schema"
	SignalConditionItemName_ConstraintName    SignalConditionItemName = "constraint_name"
	SignalConditionItemName_CatalogName       SignalConditionItemName = "catalog_name"
	SignalConditionItemName_SchemaName        SignalConditionItemName = "schema_name"
	SignalConditionItemName_TableName         SignalConditionItemName = "table_name"
	SignalConditionItemName_ColumnName        SignalConditionItemName = "column_name"
	SignalConditionItemName_CursorName        SignalConditionItemName = "cursor_name"
)
type SignalInfo struct {
	ConditionItemName SignalConditionItemName
	IntValue          int64
	StrValue          string
}
type Signal struct {
	SqlStateValue string  
	Info          map[SignalConditionItemName]SignalInfo
}
type SignalName struct {
	Signal *Signal
	Name   string
}
var _ sql.Node = (*Signal)(nil)
var _ sql.Node = (*SignalName)(nil)
func NewSignal(sqlstate string, info map[SignalConditionItemName]SignalInfo) *Signal {
	firstTwo := sqlstate[0:2]
	if _, ok := info[SignalConditionItemName_MessageText]; !ok {
		si := SignalInfo{
			ConditionItemName: SignalConditionItemName_MessageText,
		}
		switch firstTwo {
		case "01":
			si.StrValue = "Unhandled user-defined warning condition"
		case "02":
			si.StrValue = "Unhandled user-defined not found condition"
		default:
			si.StrValue = "Unhandled user-defined exception condition"
		}
		info[SignalConditionItemName_MessageText] = si
	}
	if _, ok := info[SignalConditionItemName_MysqlErrno]; !ok {
		si := SignalInfo{
			ConditionItemName: SignalConditionItemName_MysqlErrno,
		}
		switch firstTwo {
		case "01":
			si.IntValue = 1642
		case "02":
			si.IntValue = 1643
		default:
			si.IntValue = 1644
		}
		info[SignalConditionItemName_MysqlErrno] = si
	}
	return &Signal{
		SqlStateValue: sqlstate,
		Info:          info,
	}
}
func NewSignalName(name string, info map[SignalConditionItemName]SignalInfo) *SignalName {
	return &SignalName{
		Signal: &Signal{
			Info: info,
		},
		Name: name,
	}
}
func (s *Signal) Resolved() bool {
	return true
}
func (s *Signal) String() string {
	infoStr := ""
	if len(s.Info) > 0 {
		infoStr = " SET"
		i := 0
		for _, info := range s.Info {
			if i > 0 {
				infoStr += ","
			}
			infoStr += " " + info.String()
			i++
		}
	}
	return fmt.Sprintf("SIGNAL SQLSTATE '%s'%s", s.SqlStateValue, infoStr)
}
func (s *Signal) Schema() sql.Schema {
	return nil
}
func (s *Signal) Children() []sql.Node {
	return nil
}
func (s *Signal) WithChildren(children ...sql.Node) (sql.Node, error) {
	return NillaryWithChildren(s, children...)
}
func (s *Signal) RowIter(ctx *sql.Context, row sql.Row) (sql.RowIter, error) {
	if s.SqlStateValue[0:2] == "01" {
		return nil, fmt.Errorf("warnings not yet implemented")
	} else {
		return nil, mysql.NewSQLError(
			int(s.Info[SignalConditionItemName_MysqlErrno].IntValue),
			s.SqlStateValue,
			s.Info[SignalConditionItemName_MessageText].StrValue,
		)
	}
}
func (s *SignalName) Resolved() bool {
	return true
}