func NewSQLError(number uint16, args ...interface{}) *SQLError {
	sqlErr := &SQLError{}
	err, ok := SQLErrors[number]
	if !ok {
		unknow := SQLErrors[ER_UNKNOWN_ERROR]
		sqlErr.Num = unknow.Num
		sqlErr.State = unknow.State
		err = unknow
	} else {
		sqlErr.Num = err.Num
		sqlErr.State = err.State
	}
	sqlErr.Message = fmt.Sprintf(err.Message, args...)
	return sqlErr
}
NewSQLError creates new sql error.
package sqldb
import (
	"bytes"
	"fmt"
	"regexp"
	"strconv"
)
const (
	SQLStateGeneral = "HY000"
)
type SQLError struct {
	Num     uint16
	State   string
	Message string
	Query   string
}