sqlparser

package
Version: v0.11.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 9, 2021 License: Apache-2.0 Imports: 21 Imported by: 123

Documentation

Index

Constants

View Source
const (
	StrVal = ValType(iota)
	IntVal
	FloatVal
	HexNum
	HexVal
	BitVal
)

These are the possible Valtype values. HexNum represents a 0x... value. It cannot be treated as a simple value because it can be interpreted differently depending on the context.

View Source
const (
	//LastInsertIDName is a reserved bind var name for last_insert_id()
	LastInsertIDName = "__lastInsertId"

	//DBVarName is a reserved bind var name for database()
	DBVarName = "__vtdbname"

	//FoundRowsName is a reserved bind var name for found_rows()
	FoundRowsName = "__vtfrows"

	//RowCountName is a reserved bind var name for row_count()
	RowCountName = "__vtrcount"

	//UserDefinedVariableName is what we prepend bind var names for user defined variables
	UserDefinedVariableName = "__vtudv"
)
View Source
const (
	// DirectiveMultiShardAutocommit is the query comment directive to allow
	// single round trip autocommit with a multi-shard statement.
	DirectiveMultiShardAutocommit = "MULTI_SHARD_AUTOCOMMIT"
	// DirectiveSkipQueryPlanCache skips query plan cache when set.
	DirectiveSkipQueryPlanCache = "SKIP_QUERY_PLAN_CACHE"
	// DirectiveQueryTimeout sets a query timeout in vtgate. Only supported for SELECTS.
	DirectiveQueryTimeout = "QUERY_TIMEOUT_MS"
	// DirectiveScatterErrorsAsWarnings enables partial success scatter select queries
	DirectiveScatterErrorsAsWarnings = "SCATTER_ERRORS_AS_WARNINGS"
	// DirectiveIgnoreMaxPayloadSize skips payload size validation when set.
	DirectiveIgnoreMaxPayloadSize = "IGNORE_MAX_PAYLOAD_SIZE"
	// DirectiveIgnoreMaxMemoryRows skips memory row validation when set.
	DirectiveIgnoreMaxMemoryRows = "IGNORE_MAX_MEMORY_ROWS"
)
View Source
const (
	// Select.Distinct
	AllStr              = "all "
	DistinctStr         = "distinct "
	StraightJoinHint    = "straight_join "
	SQLCalcFoundRowsStr = "sql_calc_found_rows "

	// Select.Lock
	NoLockStr    = ""
	ForUpdateStr = " for update"
	ShareModeStr = " lock in share mode"

	// Select.Cache
	SQLCacheStr   = "sql_cache "
	SQLNoCacheStr = "sql_no_cache "

	// Union.Type
	UnionStr         = "union"
	UnionAllStr      = "union all"
	UnionDistinctStr = "union distinct"

	// DDL strings.
	InsertStr  = "insert"
	ReplaceStr = "replace"

	// Set.Scope or Show.Scope
	SessionStr        = "session"
	GlobalStr         = "global"
	VitessMetadataStr = "vitess_metadata"
	VariableStr       = "variable"
	LocalStr          = "local"
	ImplicitStr       = ""

	// DDL strings.
	CreateStr           = "create"
	AlterStr            = "alter"
	DropStr             = "drop"
	RenameStr           = "rename"
	TruncateStr         = "truncate"
	FlushStr            = "flush"
	CreateVindexStr     = "create vindex"
	DropVindexStr       = "drop vindex"
	AddVschemaTableStr  = "add vschema table"
	DropVschemaTableStr = "drop vschema table"
	AddColVindexStr     = "on table add vindex"
	DropColVindexStr    = "on table drop vindex"
	AddSequenceStr      = "add sequence"
	AddAutoIncStr       = "add auto_increment"

	// Online DDL hint
	OnlineStr = "online"

	// Vindex DDL param to specify the owner of a vindex
	VindexOwnerStr = "owner"

	// Partition strings
	ReorganizeStr        = "reorganize partition"
	AddStr               = "add partition"
	DiscardStr           = "discard partition"
	DropPartitionStr     = "drop partition"
	ImportStr            = "import partition"
	TruncatePartitionStr = "truncate partition"
	CoalesceStr          = "coalesce partition"
	ExchangeStr          = "exchange partition"
	AnalyzePartitionStr  = "analyze partition"
	CheckStr             = "check partition"
	OptimizeStr          = "optimize partition"
	RebuildStr           = "rebuild partition"
	RepairStr            = "repair partition"
	RemoveStr            = "remove partitioning"
	UpgradeStr           = "upgrade partitioning"

	// JoinTableExpr.Join
	JoinStr             = "join"
	StraightJoinStr     = "straight_join"
	LeftJoinStr         = "left join"
	RightJoinStr        = "right join"
	NaturalJoinStr      = "natural join"
	NaturalLeftJoinStr  = "natural left join"
	NaturalRightJoinStr = "natural right join"

	// Index hints.
	UseStr    = "use "
	IgnoreStr = "ignore "
	ForceStr  = "force "

	// Where.Type
	WhereStr  = "where"
	HavingStr = "having"

	// ComparisonExpr.Operator
	EqualStr         = "="
	LessThanStr      = "<"
	GreaterThanStr   = ">"
	LessEqualStr     = "<="
	GreaterEqualStr  = ">="
	NotEqualStr      = "!="
	NullSafeEqualStr = "<=>"
	InStr            = "in"
	NotInStr         = "not in"
	LikeStr          = "like"
	NotLikeStr       = "not like"
	RegexpStr        = "regexp"
	NotRegexpStr     = "not regexp"

	// RangeCond.Operator
	BetweenStr    = "between"
	NotBetweenStr = "not between"

	// IsExpr.Operator
	IsNullStr     = "is null"
	IsNotNullStr  = "is not null"
	IsTrueStr     = "is true"
	IsNotTrueStr  = "is not true"
	IsFalseStr    = "is false"
	IsNotFalseStr = "is not false"

	// BinaryExpr.Operator
	BitAndStr               = "&"
	BitOrStr                = "|"
	BitXorStr               = "^"
	PlusStr                 = "+"
	MinusStr                = "-"
	MultStr                 = "*"
	DivStr                  = "/"
	IntDivStr               = "div"
	ModStr                  = "%"
	ShiftLeftStr            = "<<"
	ShiftRightStr           = ">>"
	JSONExtractOpStr        = "->"
	JSONUnquoteExtractOpStr = "->>"

	// UnaryExpr.Operator
	UPlusStr   = "+"
	UMinusStr  = "-"
	TildaStr   = "~"
	BangStr    = "!"
	BinaryStr  = "binary "
	UBinaryStr = "_binary "
	Utf8mb4Str = "_utf8mb4 "
	Utf8Str    = "_utf8 "
	Latin1Str  = "_latin1 "

	// ConvertType.Operator
	CharacterSetStr = " character set"
	NoOperatorStr   = ""

	// CollateAndCharset.Type
	CollateStr = " collate"

	// MatchExpr.Option
	NoOptionStr                              = ""
	BooleanModeStr                           = " in boolean mode"
	NaturalLanguageModeStr                   = " in natural language mode"
	NaturalLanguageModeWithQueryExpansionStr = " in natural language mode with query expansion"
	QueryExpansionStr                        = " with query expansion"

	// INTO OUTFILE
	IntoOutfileStr   = " into outfile "
	IntoOutfileS3Str = " into outfile s3 "
	IntoDumpfileStr  = " into dumpfile "

	// Order.Direction
	AscScr  = "asc"
	DescScr = "desc"

	// SetExpr.Expr, for SET TRANSACTION ... or START TRANSACTION
	// TransactionStr is the Name for a SET TRANSACTION statement
	TransactionStr = "transaction"

	// Transaction isolation levels
	ReadUncommittedStr = "read uncommitted"
	ReadCommittedStr   = "read committed"
	RepeatableReadStr  = "repeatable read"
	SerializableStr    = "serializable"

	TxReadOnly  = "read only"
	TxReadWrite = "read write"

	// Explain formats
	EmptyStr       = ""
	TreeStr        = "tree"
	JSONStr        = "json"
	VitessStr      = "vitess"
	TraditionalStr = "traditional"
	AnalyzeStr     = "analyze"

	// Lock Types
	ReadStr             = "read"
	ReadLocalStr        = "read local"
	WriteStr            = "write"
	LowPriorityWriteStr = "low_priority write"

	// ShowCommand Types
	CharsetStr          = " charset"
	CollationStr        = " collation"
	ColumnStr           = " columns"
	CreateDbStr         = " create database"
	CreateEStr          = " create event"
	CreateFStr          = " create function"
	CreateProcStr       = " create procedure"
	CreateTblStr        = " create table"
	CreateTrStr         = " create trigger"
	CreateVStr          = " create view"
	DatabaseStr         = " databases"
	FunctionCStr        = " function code"
	FunctionStr         = " function status"
	GtidExecGlobalStr   = " global gtid_executed"
	IndexStr            = " indexes"
	OpenTableStr        = " open tables"
	PrivilegeStr        = " privileges"
	ProcedureCStr       = " procedure code"
	ProcedureStr        = " procedure status"
	StatusGlobalStr     = " global status"
	StatusSessionStr    = " status"
	TableStr            = " tables"
	TableStatusStr      = " table status"
	TriggerStr          = " triggers"
	VariableGlobalStr   = " global variables"
	VariableSessionStr  = " variables"
	VGtidExecGlobalStr  = " global vgtid_executed"
	KeyspaceStr         = " keyspaces"
	VitessMigrationsStr = " vitess_migrations"
	WarningsStr         = " warnings"

	// DropKeyType strings
	PrimaryKeyTypeStr = "primary key"
	ForeignKeyTypeStr = "foreign key"
	NormalKeyTypeStr  = "key"

	// LockOptionType strings
	NoneTypeStr      = "none"
	SharedTypeStr    = "shared"
	DefaultTypeStr   = "default"
	ExclusiveTypeStr = "exclusive"
)

String constants to be used in ast.

View Source
const ACTION = 57509
View Source
const ACTIVE = 57710
View Source
const ADD = 57490
View Source
const ADMIN = 57711
View Source
const AFTER = 57556
View Source
const AGAINST = 57676
View Source
const ALGORITHM = 57420
View Source
const ALL = 57363
View Source
const ALTER = 57486
View Source
const ALWAYS = 57381
View Source
const ANALYZE = 57489
View Source
const AND = 57455
View Source
const APPROXNUM = 57613
View Source
const ARRAY = 57685
View Source
const AS = 57365
View Source
const ASC = 57367
View Source
const AT_AT_ID = 57426
View Source
const AT_ID = 57425
View Source
const AUTO_INCREMENT = 57612
View Source
const AVG_ROW_LENGTH = 57783
View Source
const BEGIN = 57562
View Source
const BETWEEN = 57457
View Source
const BIGINT = 57576
View Source
const BINARY = 57477
View Source
const BIT = 57570
View Source
const BIT_LITERAL = 57436
View Source
const BLOB = 57597
View Source
const BOOL = 57589
View Source
const BOOLEAN = 57677
View Source
const BUCKETS = 57712
View Source
const BY = 57359
View Source
const CALL = 57377
View Source
const CANCEL = 57559
View Source
const CASCADE = 57510
View Source
const CASCADED = 57544
View Source
const CASE = 57458
View Source
const CAST = 57668
View Source
const CHANGE = 57492
View Source
const CHANNEL = 57780
View Source
const CHAR = 57587
View Source
const CHARACTER = 57590
View Source
const CHARSET = 57450
View Source
const CHECK = 57507
View Source
const CHECKSUM = 57785
View Source
const CLONE = 57713
View Source
const COALESCE = 57524
View Source
const CODE = 57617
View Source
const COLLATE = 57476
View Source
const COLLATION = 57618
View Source
const COLUMN = 57503
View Source
const COLUMNS = 57619
View Source
const COMMENT = 57434
View Source
const COMMENT_KEYWORD = 57435
View Source
const COMMIT = 57565
View Source
const COMMITTED = 57653
View Source
const COMPACT = 57798
View Source
const COMPLETE = 57561
View Source
const COMPONENT = 57714
View Source
const COMPRESSED = 57796
View Source
const COMPRESSION = 57437
View Source
const CONNECTION = 57784
View Source
const CONSTRAINT = 57511
View Source
const CONVERT = 57667
View Source
const COPY = 57419
View Source
const CREATE = 57485
View Source
const CROSS = 57412
View Source
const CSV = 57391
View Source
const CUME_DIST = 57686
View Source
const CURRENT_DATE = 57658
View Source
const CURRENT_TIME = 57659
View Source
const CURRENT_TIMESTAMP = 57656
View Source
const CURRENT_USER = 57662
View Source
const DATA = 57384
View Source
const DATABASE = 57657
View Source
const DATABASES = 57620
View Source
const DATE = 57519
View Source
const DATETIME = 57585
View Source
const DECIMAL = 57581
View Source
const DEFAULT = 57371
View Source
const DEFINER = 57545
View Source
const DEFINITION = 57715
View Source
const DELAY_KEY_WRITE = 57786
View Source
const DELETE = 57353
View Source
const DENSE_RANK = 57688
View Source
const DESC = 57368
View Source
const DESCRIBE = 57517
View Source
const DESCRIPTION = 57687
View Source
const DIRECTORY = 57538
View Source
const DISABLE = 57445
View Source
const DISCARD = 57442
View Source
const DISK = 57805
View Source
const DISTINCT = 57364
View Source
const DISTINCTROW = 57378
View Source
const DIV = 57473
View Source
const DO = 57376
View Source
const DOUBLE = 57579
View Source
const DROP = 57487
View Source
const DUMPFILE = 57390
View Source
const DUPLICATE = 57370
View Source
const DYNAMIC = 57795
View Source
const ELSE = 57461
View Source
const EMPTY = 57689
View Source
const ENABLE = 57444
View Source
const ENCLOSED = 57389
View Source
const ENCRYPTION = 57787
View Source
const END = 57462
View Source
const ENFORCED = 57716
View Source
const ENGINE = 57788
View Source
const ENGINES = 57621
View Source
const ENUM = 57602
View Source
const ERROR = 57774
View Source
const ESCAPE = 57520
View Source
const ESCAPED = 57388
View Source
const EVENT = 57622
View Source
const EXCEPT = 57690
View Source
const EXCHANGE = 57525
View Source
const EXCLUDE = 57717
View Source
const EXCLUSIVE = 57423
View Source
const EXISTS = 57366
View Source
const EXPANSION = 57681
View Source
const EXPLAIN = 57518
View Source
const EXPORT = 57782
View Source
const EXTENDED = 57623
View Source
const FALSE = 57440
View Source
const FIELDS = 57624
View Source
const FIRST = 57555
View Source
const FIRST_VALUE = 57691
View Source
const FIXED = 57794
View Source
const FLOAT = 57430
View Source
const FLOAT_TYPE = 57580
View Source
const FLUSH = 57491
View Source
const FOLLOWING = 57718
View Source
const FOR = 57362
View Source
const FORCE = 57415
View Source
const FOREIGN = 57512
View Source
const FORMAT = 57766
View Source
const FROM = 57354
View Source
const FULL = 57625
View Source
const FULLTEXT = 57505
View Source
const FUNCTION = 57626
View Source
const GE = 57464
View Source
const GENERAL = 57775
View Source
const GENERATED = 57380
View Source
const GEOMCOLLECTION = 57719
View Source
const GEOMETRY = 57603
View Source
const GEOMETRYCOLLECTION = 57607
View Source
const GET_MASTER_PUBLIC_KEY = 57720
View Source
const GLOBAL = 57645
View Source
const GROUP = 57356
View Source
const GROUPING = 57692
View Source
const GROUPS = 57693
View Source
const GROUP_CONCAT = 57671
View Source
const GTID_EXECUTED = 57627
View Source
const HAVING = 57357
View Source
const HEADER = 57392
View Source
const HEX = 57427
View Source
const HEXNUM = 57431
View Source
const HISTOGRAM = 57721
View Source
const HISTORY = 57722
View Source
const HOSTS = 57776
View Source
const ID = 57424
View Source
const IF = 57501
View Source
const IGNORE = 57500
View Source
const IMPORT = 57443
View Source
const IN = 57470
View Source
const INACTIVE = 57723
View Source
const INDEX = 57497
View Source
const INDEXES = 57508
View Source
const INNER = 57410
View Source
const INPLACE = 57418
View Source
const INSERT = 57351
View Source
const INSERT_METHOD = 57789
View Source
const INT = 57574
View Source
const INTEGER = 57575
View Source
const INTEGRAL = 57429
View Source
const INTERVAL = 57482
View Source
const INTNUM = 57577
View Source
const INTO = 57369
View Source
const INVISIBLE = 57724
View Source
const INVOKER = 57553
View Source
const IS = 57467
View Source
const ISOLATION = 57647
View Source
const JOIN = 57406
View Source
const JSON = 57601
View Source
const JSON_EXTRACT_OP = 57483
View Source
const JSON_TABLE = 57694
View Source
const JSON_UNQUOTE_EXTRACT_OP = 57484
View Source
const KEY = 57452
View Source
const KEYS = 57375
View Source
const KEYSPACES = 57628
View Source
const KEY_BLOCK_SIZE = 57506
View Source
const LAG = 57695
View Source
const LANGUAGE = 57678
View Source
const LAST = 57557
View Source
const LAST_INSERT_ID = 57398
View Source
const LAST_VALUE = 57696
View Source
const LATERAL = 57697
View Source
const LE = 57463
View Source
const LEAD = 57698
View Source
const LEFT = 57408
View Source
const LESS = 57532
View Source
const LEVEL = 57648
View Source
const LEX_ERROR = 57346
View Source
const LIKE = 57468
View Source
const LIMIT = 57360
View Source
const LINES = 57386
View Source
const LINESTRING = 57605
View Source
const LIST_ARG = 57433
View Source
const LOAD = 57385
View Source
const LOCAL = 57770
View Source
const LOCALTIME = 57660
View Source
const LOCALTIMESTAMP = 57661
View Source
const LOCK = 57373
View Source
const LOCKED = 57725
View Source
const LOGS = 57773
View Source
const LONGBLOB = 57600
View Source
const LONGTEXT = 57596
View Source
const LOWER_THAN_CHARSET = 57449
View Source
const LOW_PRIORITY = 57771
View Source
const MANIFEST = 57393
View Source
const MASTER_COMPRESSION_ALGORITHMS = 57726
View Source
const MASTER_PUBLIC_KEY_PATH = 57727
View Source
const MASTER_TLS_CIPHERSUITES = 57728
View Source
const MASTER_ZSTD_COMPRESSION_LEVEL = 57729
View Source
const MATCH = 57675
View Source
const MAXVALUE = 57529
View Source
const MAX_ROWS = 57790
View Source
const MEDIUMBLOB = 57599
View Source
const MEDIUMINT = 57573
View Source
const MEDIUMTEXT = 57595
View Source
const MEMBER = 57699
View Source
const MEMORY = 57804
View Source
const MERGE = 57550
View Source
const MIN_ROWS = 57791
View Source
const MOD = 57474
View Source
const MODE = 57402
View Source
const MODIFY = 57493
View Source
const MULTILINESTRING = 57609
View Source
const MULTIPOINT = 57608
View Source
const MULTIPOLYGON = 57610
View Source
const NAME = 57539
View Source
const NAMES = 57644
View Source
const NATURAL = 57413
View Source
const NCHAR = 57592
View Source
const NE = 57465
View Source
const NESTED = 57730
View Source
const NETWORK_NAMESPACE = 57731
View Source
const NEXT = 57399
View Source
const NO = 57513
View Source
const NONE = 57421
View Source
const NOT = 57456
View Source
const NOWAIT = 57732
View Source
const NO_WRITE_TO_BINLOG = 57772
View Source
const NTH_VALUE = 57700
View Source
const NTILE = 57701
View Source
const NULL = 57438
View Source
const NULLS = 57733
View Source
const NULLX = 57611
View Source
const NULL_SAFE_EQUAL = 57466
View Source
const NUMERIC = 57582
View Source
const OF = 57702
View Source
const OFF = 57441
View Source
const OFFSET = 57361
View Source
const OJ = 57734
View Source
const OLD = 57735
View Source
const ON = 57416
View Source
const ONLY = 57651
View Source
const OPEN = 57629
View Source
const OPTIMIZE = 57522
View Source
const OPTIMIZER_COSTS = 57777
View Source
const OPTION = 57546
View Source
const OPTIONAL = 57736
View Source
const OPTIONALLY = 57396
View Source
const OR = 57453
View Source
const ORDER = 57358
View Source
const ORDINALITY = 57737
View Source
const ORGANIZATION = 57738
View Source
const OTHERS = 57739
View Source
const OUTER = 57411
View Source
const OUTFILE = 57382
View Source
const OVER = 57703
View Source
const OVERWRITE = 57394
View Source
const PACK_KEYS = 57792
View Source
const PARSER = 57379
View Source
const PARTITION = 57530
View Source
const PARTITIONING = 57527
View Source
const PASSWORD = 57793
View Source
const PATH = 57740
View Source
const PERCENT_RANK = 57704
View Source
const PERSIST = 57741
View Source
const PERSIST_ONLY = 57742
View Source
const PLUGINS = 57630
View Source
const POINT = 57604
View Source
const POLYGON = 57606
View Source
const PRECEDING = 57743
View Source
const PRIMARY = 57502
View Source
const PRIVILEGES = 57631
View Source
const PRIVILEGE_CHECKS_USER = 57744
View Source
const PROCEDURE = 57534
View Source
const PROCESS = 57745
View Source
const PROCESSLIST = 57632
View Source
const QUERY = 57680
View Source
const RANDOM = 57746
View Source
const RANK = 57705
View Source
const READ = 57649
View Source
const REAL = 57578
View Source
const REBUILD = 57526
View Source
const RECURSIVE = 57706
View Source
const REDUNDANT = 57797
View Source
const REFERENCE = 57747
View Source
const REFERENCES = 57514
View Source
const REGEXP = 57469
View Source
const RELAY = 57781
View Source
const RELEASE = 57568
View Source
const REMOVE = 57528
View Source
const RENAME = 57488
View Source
const REORGANIZE = 57531
View Source
const REPAIR = 57521
View Source
const REPEATABLE = 57652
View Source
const REPLACE = 57666
View Source
const REQUIRE_ROW_FORMAT = 57748
View Source
const RESOURCE = 57749
View Source
const RESPECT = 57750
View Source
const RESTART = 57751
View Source
const RESTRICT = 57515
View Source
const RETAIN = 57752
View Source
const RETRY = 57560
View Source
const REUSE = 57753
View Source
const REVERT = 57494
View Source
const RIGHT = 57409
View Source
const ROLE = 57754
View Source
const ROLLBACK = 57566
View Source
const ROW_FORMAT = 57799
View Source
const ROW_NUMBER = 57707
View Source
const S3 = 57383
View Source
const SAVEPOINT = 57567
View Source
const SCHEMA = 57495
View Source
const SCHEMAS = 57633
View Source
const SECONDARY = 57755
View Source
const SECONDARY_ENGINE = 57756
View Source
const SECONDARY_LOAD = 57757
View Source
const SECONDARY_UNLOAD = 57758
View Source
const SECURITY = 57554
View Source
const SELECT = 57348
View Source
const SEPARATOR = 57672
View Source
const SEQUENCE = 57549
View Source
const SERIALIZABLE = 57655
View Source
const SESSION = 57646
View Source
const SET = 57372
View Source
const SHARE = 57401
View Source
const SHARED = 57422
View Source
const SHIFT_LEFT = 57471
View Source
const SHIFT_RIGHT = 57472
View Source
const SHOW = 57516
View Source
const SIGNED = 57614
View Source
const SKIP = 57759
View Source
const SLOW = 57779
View Source
const SMALLINT = 57572
View Source
const SPATIAL = 57504
View Source
const SQL = 57547
View Source
const SQL_CACHE = 57404
View Source
const SQL_CALC_FOUND_ROWS = 57405
View Source
const SQL_NO_CACHE = 57403
View Source
const SRID = 57760
View Source
const START = 57563
View Source
const STARTING = 57395
View Source
const STATS_AUTO_RECALC = 57800
View Source
const STATS_PERSISTENT = 57801
View Source
const STATS_SAMPLE_PAGES = 57802
View Source
const STATUS = 57541
View Source
const STORAGE = 57803
View Source
const STORED = 57448
View Source
const STRAIGHT_JOIN = 57407
View Source
const STREAM = 57349
View Source
const STRING = 57428
View Source
const SUBSTR = 57669
View Source
const SUBSTRING = 57670
View Source
const SYSTEM = 57708
View Source
const TABLE = 57496
View Source
const TABLES = 57634
View Source
const TABLESPACE = 57446
View Source
const TEMPORARY = 57551
View Source
const TEMPTABLE = 57552
View Source
const TERMINATED = 57387
View Source
const TEXT = 57593
View Source
const THAN = 57533
View Source
const THEN = 57460
View Source
const THREAD_PRIORITY = 57761
View Source
const TIES = 57762
View Source
const TIME = 57583
View Source
const TIMESTAMP = 57584
View Source
const TIMESTAMPADD = 57673
View Source
const TIMESTAMPDIFF = 57674
View Source
const TINYBLOB = 57598
View Source
const TINYINT = 57571
View Source
const TINYTEXT = 57594
View Source
const TO = 57499
View Source
const TRADITIONAL = 57769
View Source
const TRANSACTION = 57564
View Source
const TREE = 57767
View Source
const TRIGGER = 57535
View Source
const TRIGGERS = 57635
View Source
const TRUE = 57439
View Source
const TRUNCATE = 57523
View Source
const UNARY = 57475
View Source
const UNBOUNDED = 57763
View Source
const UNCOMMITTED = 57654
View Source
const UNDEFINED = 57548
View Source
const UNDERSCORE_BINARY = 57478
View Source
const UNDERSCORE_LATIN1 = 57481
View Source
const UNDERSCORE_UTF8 = 57480
View Source
const UNDERSCORE_UTF8MB4 = 57479
View Source
const UNION = 57347
View Source
const UNIQUE = 57451
View Source
const UNLOCK = 57374
View Source
const UNSIGNED = 57615
View Source
const UNUSED = 57684
View Source
const UPDATE = 57352
View Source
const UPGRADE = 57540
View Source
const USE = 57414
View Source
const USER = 57636
View Source
const USER_RESOURCES = 57778
View Source
const USING = 57417
View Source
const UTC_DATE = 57663
View Source
const UTC_TIME = 57664
View Source
const UTC_TIMESTAMP = 57665
View Source
const VALIDATION = 57683
View Source
const VALUE = 57400
View Source
const VALUES = 57397
View Source
const VALUE_ARG = 57432
View Source
const VARBINARY = 57591
View Source
const VARCHAR = 57588
View Source
const VARIABLES = 57542
View Source
const VCPU = 57764
View Source
const VGTID_EXECUTED = 57637
View Source
const VIEW = 57498
View Source
const VINDEX = 57536
View Source
const VINDEXES = 57537
View Source
const VIRTUAL = 57447
View Source
const VISIBLE = 57765
View Source
const VITESS = 57768
View Source
const VITESS_KEYSPACES = 57638
View Source
const VITESS_METADATA = 57639
View Source
const VITESS_MIGRATION = 57558
View Source
const VITESS_MIGRATIONS = 57640
View Source
const VITESS_SHARDS = 57641
View Source
const VITESS_TABLETS = 57642
View Source
const VSCHEMA = 57643
View Source
const VSTREAM = 57350
View Source
const WARNINGS = 57543
View Source
const WHEN = 57459
View Source
const WHERE = 57355
View Source
const WINDOW = 57709
View Source
const WITH = 57679
View Source
const WITHOUT = 57682
View Source
const WORK = 57569
View Source
const WRITE = 57650
View Source
const XOR = 57454
View Source
const YEAR = 57586
View Source
const ZEROFILL = 57616

Variables

View Source
var (
	// TruncateUILen truncate queries in debug UIs to the given length. 0 means unlimited.
	TruncateUILen = flag.Int("sql-max-length-ui", 512, "truncate queries in debug UIs to the given length (default 512)")

	// TruncateErrLen truncate queries in error logs to the given length. 0 means unlimited.
	TruncateErrLen = flag.Int("sql-max-length-errors", 0, "truncate queries in error logs to the given length (default unlimited)")
)
View Source
var Aggregates = map[string]bool{
	"avg":          true,
	"bit_and":      true,
	"bit_or":       true,
	"bit_xor":      true,
	"count":        true,
	"group_concat": true,
	"max":          true,
	"min":          true,
	"std":          true,
	"stddev_pop":   true,
	"stddev_samp":  true,
	"stddev":       true,
	"sum":          true,
	"var_pop":      true,
	"var_samp":     true,
	"variance":     true,
}

Aggregates is a map of all aggregate functions.

ErrEmpty is a sentinel error returned when parsing empty statements.

View Source
var ErrExprNotSupported = fmt.Errorf("Expr Not Supported")

ErrExprNotSupported signals that the expression cannot be handled by expression evaluation engine.

View Source
var MySQLVersion string = "50709"

MySQLVersion is the version of MySQL that the parser would emulate

Functions

func Append

func Append(buf *strings.Builder, node SQLNode)

Append appends the SQLNode to the buffer.

func CachePlan added in v0.9.0

func CachePlan(stmt Statement) bool

CachePlan takes Statement and returns true if the query plan should be cached

func CanNormalize

func CanNormalize(stmt Statement) bool

CanNormalize takes Statement and returns if the statement can be normalized.

func CloneRefOfBool added in v0.10.0

func CloneRefOfBool(n *bool) *bool

CloneRefOfBool creates a deep clone of the input.

func CloneSliceOfString added in v0.10.0

func CloneSliceOfString(n []string) []string

CloneSliceOfString creates a deep clone of the input.

func Convert

func Convert(e Expr) (evalengine.Expr, error)

Convert converts between AST expressions and executable expressions

func EncodeValue

func EncodeValue(buf *strings.Builder, value *querypb.BindVariable)

EncodeValue encodes one bind variable value into the query.

func EqualsAlterOption added in v0.10.0

func EqualsAlterOption(inA, inB AlterOption) bool

EqualsAlterOption does deep equals between the two objects.

func EqualsCharacteristic added in v0.10.0

func EqualsCharacteristic(inA, inB Characteristic) bool

EqualsCharacteristic does deep equals between the two objects.

func EqualsColIdent added in v0.10.0

func EqualsColIdent(a, b ColIdent) bool

EqualsColIdent does deep equals between the two objects.

func EqualsColTuple added in v0.10.0

func EqualsColTuple(inA, inB ColTuple) bool

EqualsColTuple does deep equals between the two objects.

func EqualsCollateAndCharset added in v0.10.0

func EqualsCollateAndCharset(a, b CollateAndCharset) bool

EqualsCollateAndCharset does deep equals between the two objects.

func EqualsColumnType added in v0.10.0

func EqualsColumnType(a, b ColumnType) bool

EqualsColumnType does deep equals between the two objects.

func EqualsColumns added in v0.10.0

func EqualsColumns(a, b Columns) bool

EqualsColumns does deep equals between the two objects.

func EqualsComments added in v0.10.0

func EqualsComments(a, b Comments) bool

EqualsComments does deep equals between the two objects.

func EqualsConstraintInfo added in v0.10.0

func EqualsConstraintInfo(inA, inB ConstraintInfo) bool

EqualsConstraintInfo does deep equals between the two objects.

func EqualsDBDDLStatement added in v0.10.0

func EqualsDBDDLStatement(inA, inB DBDDLStatement) bool

EqualsDBDDLStatement does deep equals between the two objects.

func EqualsDDLStatement added in v0.10.0

func EqualsDDLStatement(inA, inB DDLStatement) bool

EqualsDDLStatement does deep equals between the two objects.

func EqualsExplain added in v0.10.0

func EqualsExplain(inA, inB Explain) bool

EqualsExplain does deep equals between the two objects.

func EqualsExpr added in v0.10.0

func EqualsExpr(inA, inB Expr) bool

EqualsExpr does deep equals between the two objects.

func EqualsExprs added in v0.10.0

func EqualsExprs(a, b Exprs) bool

EqualsExprs does deep equals between the two objects.

func EqualsGroupBy added in v0.10.0

func EqualsGroupBy(a, b GroupBy) bool

EqualsGroupBy does deep equals between the two objects.

func EqualsInsertRows added in v0.10.0

func EqualsInsertRows(inA, inB InsertRows) bool

EqualsInsertRows does deep equals between the two objects.

func EqualsJoinCondition added in v0.10.0

func EqualsJoinCondition(a, b JoinCondition) bool

EqualsJoinCondition does deep equals between the two objects.

func EqualsOnDup added in v0.10.0

func EqualsOnDup(a, b OnDup) bool

EqualsOnDup does deep equals between the two objects.

func EqualsOrderBy added in v0.10.0

func EqualsOrderBy(a, b OrderBy) bool

EqualsOrderBy does deep equals between the two objects.

func EqualsPartitions added in v0.10.0

func EqualsPartitions(a, b Partitions) bool

EqualsPartitions does deep equals between the two objects.

func EqualsRefOfAddColumns added in v0.10.0

func EqualsRefOfAddColumns(a, b *AddColumns) bool

EqualsRefOfAddColumns does deep equals between the two objects.

func EqualsRefOfAddConstraintDefinition added in v0.10.0

func EqualsRefOfAddConstraintDefinition(a, b *AddConstraintDefinition) bool

EqualsRefOfAddConstraintDefinition does deep equals between the two objects.

func EqualsRefOfAddIndexDefinition added in v0.10.0

func EqualsRefOfAddIndexDefinition(a, b *AddIndexDefinition) bool

EqualsRefOfAddIndexDefinition does deep equals between the two objects.

func EqualsRefOfAliasedExpr added in v0.10.0

func EqualsRefOfAliasedExpr(a, b *AliasedExpr) bool

EqualsRefOfAliasedExpr does deep equals between the two objects.

func EqualsRefOfAliasedTableExpr added in v0.10.0

func EqualsRefOfAliasedTableExpr(a, b *AliasedTableExpr) bool

EqualsRefOfAliasedTableExpr does deep equals between the two objects.

func EqualsRefOfAlterCharset added in v0.10.0

func EqualsRefOfAlterCharset(a, b *AlterCharset) bool

EqualsRefOfAlterCharset does deep equals between the two objects.

func EqualsRefOfAlterColumn added in v0.10.0

func EqualsRefOfAlterColumn(a, b *AlterColumn) bool

EqualsRefOfAlterColumn does deep equals between the two objects.

func EqualsRefOfAlterDatabase added in v0.10.0

func EqualsRefOfAlterDatabase(a, b *AlterDatabase) bool

EqualsRefOfAlterDatabase does deep equals between the two objects.

func EqualsRefOfAlterMigration added in v0.10.0

func EqualsRefOfAlterMigration(a, b *AlterMigration) bool

EqualsRefOfAlterMigration does deep equals between the two objects.

func EqualsRefOfAlterTable added in v0.10.0

func EqualsRefOfAlterTable(a, b *AlterTable) bool

EqualsRefOfAlterTable does deep equals between the two objects.

func EqualsRefOfAlterView added in v0.10.0

func EqualsRefOfAlterView(a, b *AlterView) bool

EqualsRefOfAlterView does deep equals between the two objects.

func EqualsRefOfAlterVschema added in v0.10.0

func EqualsRefOfAlterVschema(a, b *AlterVschema) bool

EqualsRefOfAlterVschema does deep equals between the two objects.

func EqualsRefOfAndExpr added in v0.10.0

func EqualsRefOfAndExpr(a, b *AndExpr) bool

EqualsRefOfAndExpr does deep equals between the two objects.

func EqualsRefOfAutoIncSpec added in v0.10.0

func EqualsRefOfAutoIncSpec(a, b *AutoIncSpec) bool

EqualsRefOfAutoIncSpec does deep equals between the two objects.

func EqualsRefOfBegin added in v0.10.0

func EqualsRefOfBegin(a, b *Begin) bool

EqualsRefOfBegin does deep equals between the two objects.

func EqualsRefOfBinaryExpr added in v0.10.0

func EqualsRefOfBinaryExpr(a, b *BinaryExpr) bool

EqualsRefOfBinaryExpr does deep equals between the two objects.

func EqualsRefOfBool added in v0.10.0

func EqualsRefOfBool(a, b *bool) bool

EqualsRefOfBool does deep equals between the two objects.

func EqualsRefOfCallProc added in v0.10.0

func EqualsRefOfCallProc(a, b *CallProc) bool

EqualsRefOfCallProc does deep equals between the two objects.

func EqualsRefOfCaseExpr added in v0.10.0

func EqualsRefOfCaseExpr(a, b *CaseExpr) bool

EqualsRefOfCaseExpr does deep equals between the two objects.

func EqualsRefOfChangeColumn added in v0.10.0

func EqualsRefOfChangeColumn(a, b *ChangeColumn) bool

EqualsRefOfChangeColumn does deep equals between the two objects.

func EqualsRefOfCheckConstraintDefinition added in v0.10.0

func EqualsRefOfCheckConstraintDefinition(a, b *CheckConstraintDefinition) bool

EqualsRefOfCheckConstraintDefinition does deep equals between the two objects.

func EqualsRefOfColIdent added in v0.10.0

func EqualsRefOfColIdent(a, b *ColIdent) bool

EqualsRefOfColIdent does deep equals between the two objects.

func EqualsRefOfColName added in v0.10.0

func EqualsRefOfColName(a, b *ColName) bool

EqualsRefOfColName does deep equals between the two objects.

func EqualsRefOfCollateAndCharset added in v0.10.0

func EqualsRefOfCollateAndCharset(a, b *CollateAndCharset) bool

EqualsRefOfCollateAndCharset does deep equals between the two objects.

func EqualsRefOfCollateExpr added in v0.10.0

func EqualsRefOfCollateExpr(a, b *CollateExpr) bool

EqualsRefOfCollateExpr does deep equals between the two objects.

func EqualsRefOfColumnDefinition added in v0.10.0

func EqualsRefOfColumnDefinition(a, b *ColumnDefinition) bool

EqualsRefOfColumnDefinition does deep equals between the two objects.

func EqualsRefOfColumnType added in v0.10.0

func EqualsRefOfColumnType(a, b *ColumnType) bool

EqualsRefOfColumnType does deep equals between the two objects.

func EqualsRefOfColumnTypeOptions added in v0.10.0

func EqualsRefOfColumnTypeOptions(a, b *ColumnTypeOptions) bool

EqualsRefOfColumnTypeOptions does deep equals between the two objects.

func EqualsRefOfCommit added in v0.10.0

func EqualsRefOfCommit(a, b *Commit) bool

EqualsRefOfCommit does deep equals between the two objects.

func EqualsRefOfComparisonExpr added in v0.10.0

func EqualsRefOfComparisonExpr(a, b *ComparisonExpr) bool

EqualsRefOfComparisonExpr does deep equals between the two objects.

func EqualsRefOfConstraintDefinition added in v0.10.0

func EqualsRefOfConstraintDefinition(a, b *ConstraintDefinition) bool

EqualsRefOfConstraintDefinition does deep equals between the two objects.

func EqualsRefOfConvertExpr added in v0.10.0

func EqualsRefOfConvertExpr(a, b *ConvertExpr) bool

EqualsRefOfConvertExpr does deep equals between the two objects.

func EqualsRefOfConvertType added in v0.10.0

func EqualsRefOfConvertType(a, b *ConvertType) bool

EqualsRefOfConvertType does deep equals between the two objects.

func EqualsRefOfConvertUsingExpr added in v0.10.0

func EqualsRefOfConvertUsingExpr(a, b *ConvertUsingExpr) bool

EqualsRefOfConvertUsingExpr does deep equals between the two objects.

func EqualsRefOfCreateDatabase added in v0.10.0

func EqualsRefOfCreateDatabase(a, b *CreateDatabase) bool

EqualsRefOfCreateDatabase does deep equals between the two objects.

func EqualsRefOfCreateTable added in v0.10.0

func EqualsRefOfCreateTable(a, b *CreateTable) bool

EqualsRefOfCreateTable does deep equals between the two objects.

func EqualsRefOfCreateView added in v0.10.0

func EqualsRefOfCreateView(a, b *CreateView) bool

EqualsRefOfCreateView does deep equals between the two objects.

func EqualsRefOfCurTimeFuncExpr added in v0.10.0

func EqualsRefOfCurTimeFuncExpr(a, b *CurTimeFuncExpr) bool

EqualsRefOfCurTimeFuncExpr does deep equals between the two objects.

func EqualsRefOfDefault added in v0.10.0

func EqualsRefOfDefault(a, b *Default) bool

EqualsRefOfDefault does deep equals between the two objects.

func EqualsRefOfDelete added in v0.10.0

func EqualsRefOfDelete(a, b *Delete) bool

EqualsRefOfDelete does deep equals between the two objects.

func EqualsRefOfDerivedTable added in v0.10.0

func EqualsRefOfDerivedTable(a, b *DerivedTable) bool

EqualsRefOfDerivedTable does deep equals between the two objects.

func EqualsRefOfDropColumn added in v0.10.0

func EqualsRefOfDropColumn(a, b *DropColumn) bool

EqualsRefOfDropColumn does deep equals between the two objects.

func EqualsRefOfDropDatabase added in v0.10.0

func EqualsRefOfDropDatabase(a, b *DropDatabase) bool

EqualsRefOfDropDatabase does deep equals between the two objects.

func EqualsRefOfDropKey added in v0.10.0

func EqualsRefOfDropKey(a, b *DropKey) bool

EqualsRefOfDropKey does deep equals between the two objects.

func EqualsRefOfDropTable added in v0.10.0

func EqualsRefOfDropTable(a, b *DropTable) bool

EqualsRefOfDropTable does deep equals between the two objects.

func EqualsRefOfDropView added in v0.10.0

func EqualsRefOfDropView(a, b *DropView) bool

EqualsRefOfDropView does deep equals between the two objects.

func EqualsRefOfExistsExpr added in v0.10.0

func EqualsRefOfExistsExpr(a, b *ExistsExpr) bool

EqualsRefOfExistsExpr does deep equals between the two objects.

func EqualsRefOfExplainStmt added in v0.10.0

func EqualsRefOfExplainStmt(a, b *ExplainStmt) bool

EqualsRefOfExplainStmt does deep equals between the two objects.

func EqualsRefOfExplainTab added in v0.10.0

func EqualsRefOfExplainTab(a, b *ExplainTab) bool

EqualsRefOfExplainTab does deep equals between the two objects.

func EqualsRefOfFlush added in v0.10.0

func EqualsRefOfFlush(a, b *Flush) bool

EqualsRefOfFlush does deep equals between the two objects.

func EqualsRefOfForce added in v0.10.0

func EqualsRefOfForce(a, b *Force) bool

EqualsRefOfForce does deep equals between the two objects.

func EqualsRefOfForeignKeyDefinition added in v0.10.0

func EqualsRefOfForeignKeyDefinition(a, b *ForeignKeyDefinition) bool

EqualsRefOfForeignKeyDefinition does deep equals between the two objects.

func EqualsRefOfFuncExpr added in v0.10.0

func EqualsRefOfFuncExpr(a, b *FuncExpr) bool

EqualsRefOfFuncExpr does deep equals between the two objects.

func EqualsRefOfGroupConcatExpr added in v0.10.0

func EqualsRefOfGroupConcatExpr(a, b *GroupConcatExpr) bool

EqualsRefOfGroupConcatExpr does deep equals between the two objects.

func EqualsRefOfIndexColumn added in v0.10.0

func EqualsRefOfIndexColumn(a, b *IndexColumn) bool

EqualsRefOfIndexColumn does deep equals between the two objects.

func EqualsRefOfIndexDefinition added in v0.10.0

func EqualsRefOfIndexDefinition(a, b *IndexDefinition) bool

EqualsRefOfIndexDefinition does deep equals between the two objects.

func EqualsRefOfIndexHints added in v0.10.0

func EqualsRefOfIndexHints(a, b *IndexHints) bool

EqualsRefOfIndexHints does deep equals between the two objects.

func EqualsRefOfIndexInfo added in v0.10.0

func EqualsRefOfIndexInfo(a, b *IndexInfo) bool

EqualsRefOfIndexInfo does deep equals between the two objects.

func EqualsRefOfIndexOption added in v0.10.0

func EqualsRefOfIndexOption(a, b *IndexOption) bool

EqualsRefOfIndexOption does deep equals between the two objects.

func EqualsRefOfInsert added in v0.10.0

func EqualsRefOfInsert(a, b *Insert) bool

EqualsRefOfInsert does deep equals between the two objects.

func EqualsRefOfIntervalExpr added in v0.10.0

func EqualsRefOfIntervalExpr(a, b *IntervalExpr) bool

EqualsRefOfIntervalExpr does deep equals between the two objects.

func EqualsRefOfIsExpr added in v0.10.0

func EqualsRefOfIsExpr(a, b *IsExpr) bool

EqualsRefOfIsExpr does deep equals between the two objects.

func EqualsRefOfJoinCondition added in v0.10.0

func EqualsRefOfJoinCondition(a, b *JoinCondition) bool

EqualsRefOfJoinCondition does deep equals between the two objects.

func EqualsRefOfJoinTableExpr added in v0.10.0

func EqualsRefOfJoinTableExpr(a, b *JoinTableExpr) bool

EqualsRefOfJoinTableExpr does deep equals between the two objects.

func EqualsRefOfKeyState added in v0.10.0

func EqualsRefOfKeyState(a, b *KeyState) bool

EqualsRefOfKeyState does deep equals between the two objects.

func EqualsRefOfLimit added in v0.10.0

func EqualsRefOfLimit(a, b *Limit) bool

EqualsRefOfLimit does deep equals between the two objects.

func EqualsRefOfLiteral added in v0.10.0

func EqualsRefOfLiteral(a, b *Literal) bool

EqualsRefOfLiteral does deep equals between the two objects.

func EqualsRefOfLoad added in v0.10.0

func EqualsRefOfLoad(a, b *Load) bool

EqualsRefOfLoad does deep equals between the two objects.

func EqualsRefOfLockOption added in v0.10.0

func EqualsRefOfLockOption(a, b *LockOption) bool

EqualsRefOfLockOption does deep equals between the two objects.

func EqualsRefOfLockTables added in v0.10.0

func EqualsRefOfLockTables(a, b *LockTables) bool

EqualsRefOfLockTables does deep equals between the two objects.

func EqualsRefOfMatchExpr added in v0.10.0

func EqualsRefOfMatchExpr(a, b *MatchExpr) bool

EqualsRefOfMatchExpr does deep equals between the two objects.

func EqualsRefOfModifyColumn added in v0.10.0

func EqualsRefOfModifyColumn(a, b *ModifyColumn) bool

EqualsRefOfModifyColumn does deep equals between the two objects.

func EqualsRefOfNextval added in v0.10.0

func EqualsRefOfNextval(a, b *Nextval) bool

EqualsRefOfNextval does deep equals between the two objects.

func EqualsRefOfNotExpr added in v0.10.0

func EqualsRefOfNotExpr(a, b *NotExpr) bool

EqualsRefOfNotExpr does deep equals between the two objects.

func EqualsRefOfNullVal added in v0.10.0

func EqualsRefOfNullVal(a, b *NullVal) bool

EqualsRefOfNullVal does deep equals between the two objects.

func EqualsRefOfOptLike added in v0.10.0

func EqualsRefOfOptLike(a, b *OptLike) bool

EqualsRefOfOptLike does deep equals between the two objects.

func EqualsRefOfOrExpr added in v0.10.0

func EqualsRefOfOrExpr(a, b *OrExpr) bool

EqualsRefOfOrExpr does deep equals between the two objects.

func EqualsRefOfOrder added in v0.10.0

func EqualsRefOfOrder(a, b *Order) bool

EqualsRefOfOrder does deep equals between the two objects.

func EqualsRefOfOrderByOption added in v0.10.0

func EqualsRefOfOrderByOption(a, b *OrderByOption) bool

EqualsRefOfOrderByOption does deep equals between the two objects.

func EqualsRefOfOtherAdmin added in v0.10.0

func EqualsRefOfOtherAdmin(a, b *OtherAdmin) bool

EqualsRefOfOtherAdmin does deep equals between the two objects.

func EqualsRefOfOtherRead added in v0.10.0

func EqualsRefOfOtherRead(a, b *OtherRead) bool

EqualsRefOfOtherRead does deep equals between the two objects.

func EqualsRefOfParenSelect added in v0.10.0

func EqualsRefOfParenSelect(a, b *ParenSelect) bool

EqualsRefOfParenSelect does deep equals between the two objects.

func EqualsRefOfParenTableExpr added in v0.10.0

func EqualsRefOfParenTableExpr(a, b *ParenTableExpr) bool

EqualsRefOfParenTableExpr does deep equals between the two objects.

func EqualsRefOfPartitionDefinition added in v0.10.0

func EqualsRefOfPartitionDefinition(a, b *PartitionDefinition) bool

EqualsRefOfPartitionDefinition does deep equals between the two objects.

func EqualsRefOfPartitionSpec added in v0.10.0

func EqualsRefOfPartitionSpec(a, b *PartitionSpec) bool

EqualsRefOfPartitionSpec does deep equals between the two objects.

func EqualsRefOfRangeCond added in v0.10.0

func EqualsRefOfRangeCond(a, b *RangeCond) bool

EqualsRefOfRangeCond does deep equals between the two objects.

func EqualsRefOfReferenceDefinition added in v0.11.0

func EqualsRefOfReferenceDefinition(a, b *ReferenceDefinition) bool

EqualsRefOfReferenceDefinition does deep equals between the two objects.

func EqualsRefOfRelease added in v0.10.0

func EqualsRefOfRelease(a, b *Release) bool

EqualsRefOfRelease does deep equals between the two objects.

func EqualsRefOfRenameIndex added in v0.10.0

func EqualsRefOfRenameIndex(a, b *RenameIndex) bool

EqualsRefOfRenameIndex does deep equals between the two objects.

func EqualsRefOfRenameTable added in v0.10.0

func EqualsRefOfRenameTable(a, b *RenameTable) bool

EqualsRefOfRenameTable does deep equals between the two objects.

func EqualsRefOfRenameTableName added in v0.10.0

func EqualsRefOfRenameTableName(a, b *RenameTableName) bool

EqualsRefOfRenameTableName does deep equals between the two objects.

func EqualsRefOfRenameTablePair added in v0.10.0

func EqualsRefOfRenameTablePair(a, b *RenameTablePair) bool

EqualsRefOfRenameTablePair does deep equals between the two objects.

func EqualsRefOfRevertMigration added in v0.10.0

func EqualsRefOfRevertMigration(a, b *RevertMigration) bool

EqualsRefOfRevertMigration does deep equals between the two objects.

func EqualsRefOfRollback added in v0.10.0

func EqualsRefOfRollback(a, b *Rollback) bool

EqualsRefOfRollback does deep equals between the two objects.

func EqualsRefOfSRollback added in v0.10.0

func EqualsRefOfSRollback(a, b *SRollback) bool

EqualsRefOfSRollback does deep equals between the two objects.

func EqualsRefOfSavepoint added in v0.10.0

func EqualsRefOfSavepoint(a, b *Savepoint) bool

EqualsRefOfSavepoint does deep equals between the two objects.

func EqualsRefOfSelect added in v0.10.0

func EqualsRefOfSelect(a, b *Select) bool

EqualsRefOfSelect does deep equals between the two objects.

func EqualsRefOfSelectInto added in v0.10.0

func EqualsRefOfSelectInto(a, b *SelectInto) bool

EqualsRefOfSelectInto does deep equals between the two objects.

func EqualsRefOfSet added in v0.10.0

func EqualsRefOfSet(a, b *Set) bool

EqualsRefOfSet does deep equals between the two objects.

func EqualsRefOfSetExpr added in v0.10.0

func EqualsRefOfSetExpr(a, b *SetExpr) bool

EqualsRefOfSetExpr does deep equals between the two objects.

func EqualsRefOfSetTransaction added in v0.10.0

func EqualsRefOfSetTransaction(a, b *SetTransaction) bool

EqualsRefOfSetTransaction does deep equals between the two objects.

func EqualsRefOfShow added in v0.10.0

func EqualsRefOfShow(a, b *Show) bool

EqualsRefOfShow does deep equals between the two objects.

func EqualsRefOfShowBasic added in v0.10.0

func EqualsRefOfShowBasic(a, b *ShowBasic) bool

EqualsRefOfShowBasic does deep equals between the two objects.

func EqualsRefOfShowCreate added in v0.10.0

func EqualsRefOfShowCreate(a, b *ShowCreate) bool

EqualsRefOfShowCreate does deep equals between the two objects.

func EqualsRefOfShowFilter added in v0.10.0

func EqualsRefOfShowFilter(a, b *ShowFilter) bool

EqualsRefOfShowFilter does deep equals between the two objects.

func EqualsRefOfShowLegacy added in v0.10.0

func EqualsRefOfShowLegacy(a, b *ShowLegacy) bool

EqualsRefOfShowLegacy does deep equals between the two objects.

func EqualsRefOfShowMigrationLogs added in v0.11.0

func EqualsRefOfShowMigrationLogs(a, b *ShowMigrationLogs) bool

EqualsRefOfShowMigrationLogs does deep equals between the two objects.

func EqualsRefOfShowTablesOpt added in v0.10.0

func EqualsRefOfShowTablesOpt(a, b *ShowTablesOpt) bool

EqualsRefOfShowTablesOpt does deep equals between the two objects.

func EqualsRefOfStarExpr added in v0.10.0

func EqualsRefOfStarExpr(a, b *StarExpr) bool

EqualsRefOfStarExpr does deep equals between the two objects.

func EqualsRefOfStream added in v0.10.0

func EqualsRefOfStream(a, b *Stream) bool

EqualsRefOfStream does deep equals between the two objects.

func EqualsRefOfSubquery added in v0.10.0

func EqualsRefOfSubquery(a, b *Subquery) bool

EqualsRefOfSubquery does deep equals between the two objects.

func EqualsRefOfSubstrExpr added in v0.10.0

func EqualsRefOfSubstrExpr(a, b *SubstrExpr) bool

EqualsRefOfSubstrExpr does deep equals between the two objects.

func EqualsRefOfTableAndLockType added in v0.10.0

func EqualsRefOfTableAndLockType(a, b *TableAndLockType) bool

EqualsRefOfTableAndLockType does deep equals between the two objects.

func EqualsRefOfTableIdent added in v0.10.0

func EqualsRefOfTableIdent(a, b *TableIdent) bool

EqualsRefOfTableIdent does deep equals between the two objects.

func EqualsRefOfTableName added in v0.10.0

func EqualsRefOfTableName(a, b *TableName) bool

EqualsRefOfTableName does deep equals between the two objects.

func EqualsRefOfTableOption added in v0.10.0

func EqualsRefOfTableOption(a, b *TableOption) bool

EqualsRefOfTableOption does deep equals between the two objects.

func EqualsRefOfTableSpec added in v0.10.0

func EqualsRefOfTableSpec(a, b *TableSpec) bool

EqualsRefOfTableSpec does deep equals between the two objects.

func EqualsRefOfTablespaceOperation added in v0.10.0

func EqualsRefOfTablespaceOperation(a, b *TablespaceOperation) bool

EqualsRefOfTablespaceOperation does deep equals between the two objects.

func EqualsRefOfTimestampFuncExpr added in v0.10.0

func EqualsRefOfTimestampFuncExpr(a, b *TimestampFuncExpr) bool

EqualsRefOfTimestampFuncExpr does deep equals between the two objects.

func EqualsRefOfTruncateTable added in v0.10.0

func EqualsRefOfTruncateTable(a, b *TruncateTable) bool

EqualsRefOfTruncateTable does deep equals between the two objects.

func EqualsRefOfUnaryExpr added in v0.10.0

func EqualsRefOfUnaryExpr(a, b *UnaryExpr) bool

EqualsRefOfUnaryExpr does deep equals between the two objects.

func EqualsRefOfUnion added in v0.10.0

func EqualsRefOfUnion(a, b *Union) bool

EqualsRefOfUnion does deep equals between the two objects.

func EqualsRefOfUnionSelect added in v0.10.0

func EqualsRefOfUnionSelect(a, b *UnionSelect) bool

EqualsRefOfUnionSelect does deep equals between the two objects.

func EqualsRefOfUnlockTables added in v0.10.0

func EqualsRefOfUnlockTables(a, b *UnlockTables) bool

EqualsRefOfUnlockTables does deep equals between the two objects.

func EqualsRefOfUpdate added in v0.10.0

func EqualsRefOfUpdate(a, b *Update) bool

EqualsRefOfUpdate does deep equals between the two objects.

func EqualsRefOfUpdateExpr added in v0.10.0

func EqualsRefOfUpdateExpr(a, b *UpdateExpr) bool

EqualsRefOfUpdateExpr does deep equals between the two objects.

func EqualsRefOfUse added in v0.10.0

func EqualsRefOfUse(a, b *Use) bool

EqualsRefOfUse does deep equals between the two objects.

func EqualsRefOfVStream added in v0.10.0

func EqualsRefOfVStream(a, b *VStream) bool

EqualsRefOfVStream does deep equals between the two objects.

func EqualsRefOfValidation added in v0.10.0

func EqualsRefOfValidation(a, b *Validation) bool

EqualsRefOfValidation does deep equals between the two objects.

func EqualsRefOfValuesFuncExpr added in v0.10.0

func EqualsRefOfValuesFuncExpr(a, b *ValuesFuncExpr) bool

EqualsRefOfValuesFuncExpr does deep equals between the two objects.

func EqualsRefOfVindexParam added in v0.10.0

func EqualsRefOfVindexParam(a, b *VindexParam) bool

EqualsRefOfVindexParam does deep equals between the two objects.

func EqualsRefOfVindexSpec added in v0.10.0

func EqualsRefOfVindexSpec(a, b *VindexSpec) bool

EqualsRefOfVindexSpec does deep equals between the two objects.

func EqualsRefOfWhen added in v0.10.0

func EqualsRefOfWhen(a, b *When) bool

EqualsRefOfWhen does deep equals between the two objects.

func EqualsRefOfWhere added in v0.10.0

func EqualsRefOfWhere(a, b *Where) bool

EqualsRefOfWhere does deep equals between the two objects.

func EqualsRefOfXorExpr added in v0.10.0

func EqualsRefOfXorExpr(a, b *XorExpr) bool

EqualsRefOfXorExpr does deep equals between the two objects.

func EqualsSQLNode added in v0.10.0

func EqualsSQLNode(inA, inB SQLNode) bool

EqualsSQLNode does deep equals between the two objects.

func EqualsSelectExpr added in v0.10.0

func EqualsSelectExpr(inA, inB SelectExpr) bool

EqualsSelectExpr does deep equals between the two objects.

func EqualsSelectExprs added in v0.10.0

func EqualsSelectExprs(a, b SelectExprs) bool

EqualsSelectExprs does deep equals between the two objects.

func EqualsSelectStatement added in v0.10.0

func EqualsSelectStatement(inA, inB SelectStatement) bool

EqualsSelectStatement does deep equals between the two objects.

func EqualsSetExprs added in v0.10.0

func EqualsSetExprs(a, b SetExprs) bool

EqualsSetExprs does deep equals between the two objects.

func EqualsShowInternal added in v0.10.0

func EqualsShowInternal(inA, inB ShowInternal) bool

EqualsShowInternal does deep equals between the two objects.

func EqualsSimpleTableExpr added in v0.10.0

func EqualsSimpleTableExpr(inA, inB SimpleTableExpr) bool

EqualsSimpleTableExpr does deep equals between the two objects.

func EqualsSliceOfAlterOption added in v0.10.0

func EqualsSliceOfAlterOption(a, b []AlterOption) bool

EqualsSliceOfAlterOption does deep equals between the two objects.

func EqualsSliceOfCharacteristic added in v0.10.0

func EqualsSliceOfCharacteristic(a, b []Characteristic) bool

EqualsSliceOfCharacteristic does deep equals between the two objects.

func EqualsSliceOfColIdent added in v0.10.0

func EqualsSliceOfColIdent(a, b []ColIdent) bool

EqualsSliceOfColIdent does deep equals between the two objects.

func EqualsSliceOfCollateAndCharset added in v0.10.0

func EqualsSliceOfCollateAndCharset(a, b []CollateAndCharset) bool

EqualsSliceOfCollateAndCharset does deep equals between the two objects.

func EqualsSliceOfRefOfColumnDefinition added in v0.10.0

func EqualsSliceOfRefOfColumnDefinition(a, b []*ColumnDefinition) bool

EqualsSliceOfRefOfColumnDefinition does deep equals between the two objects.

func EqualsSliceOfRefOfConstraintDefinition added in v0.10.0

func EqualsSliceOfRefOfConstraintDefinition(a, b []*ConstraintDefinition) bool

EqualsSliceOfRefOfConstraintDefinition does deep equals between the two objects.

func EqualsSliceOfRefOfIndexColumn added in v0.10.0

func EqualsSliceOfRefOfIndexColumn(a, b []*IndexColumn) bool

EqualsSliceOfRefOfIndexColumn does deep equals between the two objects.

func EqualsSliceOfRefOfIndexDefinition added in v0.10.0

func EqualsSliceOfRefOfIndexDefinition(a, b []*IndexDefinition) bool

EqualsSliceOfRefOfIndexDefinition does deep equals between the two objects.

func EqualsSliceOfRefOfIndexOption added in v0.10.0

func EqualsSliceOfRefOfIndexOption(a, b []*IndexOption) bool

EqualsSliceOfRefOfIndexOption does deep equals between the two objects.

func EqualsSliceOfRefOfPartitionDefinition added in v0.10.0

func EqualsSliceOfRefOfPartitionDefinition(a, b []*PartitionDefinition) bool

EqualsSliceOfRefOfPartitionDefinition does deep equals between the two objects.

func EqualsSliceOfRefOfRenameTablePair added in v0.10.0

func EqualsSliceOfRefOfRenameTablePair(a, b []*RenameTablePair) bool

EqualsSliceOfRefOfRenameTablePair does deep equals between the two objects.

func EqualsSliceOfRefOfUnionSelect added in v0.10.0

func EqualsSliceOfRefOfUnionSelect(a, b []*UnionSelect) bool

EqualsSliceOfRefOfUnionSelect does deep equals between the two objects.

func EqualsSliceOfRefOfWhen added in v0.10.0

func EqualsSliceOfRefOfWhen(a, b []*When) bool

EqualsSliceOfRefOfWhen does deep equals between the two objects.

func EqualsSliceOfString added in v0.10.0

func EqualsSliceOfString(a, b []string) bool

EqualsSliceOfString does deep equals between the two objects.

func EqualsSliceOfTableExpr added in v0.11.0

func EqualsSliceOfTableExpr(a, b []TableExpr) bool

EqualsSliceOfTableExpr does deep equals between the two objects.

func EqualsSliceOfVindexParam added in v0.10.0

func EqualsSliceOfVindexParam(a, b []VindexParam) bool

EqualsSliceOfVindexParam does deep equals between the two objects.

func EqualsStatement added in v0.10.0

func EqualsStatement(inA, inB Statement) bool

EqualsStatement does deep equals between the two objects.

func EqualsTableAndLockTypes added in v0.10.0

func EqualsTableAndLockTypes(a, b TableAndLockTypes) bool

EqualsTableAndLockTypes does deep equals between the two objects.

func EqualsTableExpr added in v0.10.0

func EqualsTableExpr(inA, inB TableExpr) bool

EqualsTableExpr does deep equals between the two objects.

func EqualsTableExprs added in v0.10.0

func EqualsTableExprs(a, b TableExprs) bool

EqualsTableExprs does deep equals between the two objects.

func EqualsTableIdent added in v0.10.0

func EqualsTableIdent(a, b TableIdent) bool

EqualsTableIdent does deep equals between the two objects.

func EqualsTableName added in v0.10.0

func EqualsTableName(a, b TableName) bool

EqualsTableName does deep equals between the two objects.

func EqualsTableNames added in v0.10.0

func EqualsTableNames(a, b TableNames) bool

EqualsTableNames does deep equals between the two objects.

func EqualsTableOptions added in v0.10.0

func EqualsTableOptions(a, b TableOptions) bool

EqualsTableOptions does deep equals between the two objects.

func EqualsUpdateExprs added in v0.10.0

func EqualsUpdateExprs(a, b UpdateExprs) bool

EqualsUpdateExprs does deep equals between the two objects.

func EqualsValTuple added in v0.10.0

func EqualsValTuple(a, b ValTuple) bool

EqualsValTuple does deep equals between the two objects.

func EqualsValues added in v0.10.0

func EqualsValues(a, b Values) bool

EqualsValues does deep equals between the two objects.

func EqualsVindexParam added in v0.10.0

func EqualsVindexParam(a, b VindexParam) bool

EqualsVindexParam does deep equals between the two objects.

func ExtractMysqlComment

func ExtractMysqlComment(sql string) (string, string)

ExtractMysqlComment extracts the version and SQL from a comment-only query such as /*!50708 sql here */

func FetchBindVar

func FetchBindVar(name string, bindVariables map[string]*querypb.BindVariable) (val *querypb.BindVariable, isList bool, err error)

FetchBindVar resolves the bind variable by fetching it from bindVariables.

func FormatImpossibleQuery

func FormatImpossibleQuery(buf *TrackedBuffer, node SQLNode)

FormatImpossibleQuery creates an impossible query in a TrackedBuffer. An impossible query is a modified version of a query where all selects have where clauses that are impossible for mysql to resolve. This is used in the vtgate and vttablet:

- In the vtgate it's used for joins: if the first query returns no result, then vtgate uses the impossible query just to fetch field info from vttablet - In the vttablet, it's just an optimization: the field info is fetched once form MySQL, cached and reused for subsequent queries

func GetBindvars

func GetBindvars(stmt Statement) map[string]struct{}

GetBindvars returns a map of the bind vars referenced in the statement.

func IgnoreMaxMaxMemoryRowsDirective

func IgnoreMaxMaxMemoryRowsDirective(stmt Statement) bool

IgnoreMaxMaxMemoryRowsDirective returns true if the max memory rows override directive is set to true.

func IgnoreMaxPayloadSizeDirective

func IgnoreMaxPayloadSizeDirective(stmt Statement) bool

IgnoreMaxPayloadSizeDirective returns true if the max payload size override directive is set to true.

func IsColName

func IsColName(node Expr) bool

IsColName returns true if the Expr is a *ColName.

func IsDML

func IsDML(sql string) bool

IsDML returns true if the query is an INSERT, UPDATE or DELETE statement.

func IsDMLStatement

func IsDMLStatement(stmt Statement) bool

IsDMLStatement returns true if the query is an INSERT, UPDATE or DELETE statement.

func IsLockingFunc

func IsLockingFunc(node Expr) bool

IsLockingFunc returns true for all functions that are used to work with mysql advisory locks

func IsNull

func IsNull(node Expr) bool

IsNull returns true if the Expr is SQL NULL

func IsSimpleTuple

func IsSimpleTuple(node Expr) bool

IsSimpleTuple returns true if the Expr is a ValTuple that contains simple values or if it's a list arg.

func IsValue

func IsValue(node Expr) bool

IsValue returns true if the Expr is a string, integral or value arg. NULL is not considered to be a value.

func KeywordString

func KeywordString(id int) string

KeywordString returns the string corresponding to the given keyword

func LikeToRegexp

func LikeToRegexp(likeExpr string) *regexp.Regexp

LikeToRegexp converts a like sql expression to regular expression

func MustRewriteAST added in v0.10.0

func MustRewriteAST(stmt Statement) bool

MustRewriteAST takes Statement and returns true if RewriteAST must run on it for correct execution irrespective of user flags.

func NewPlanValue

func NewPlanValue(node Expr) (sqltypes.PlanValue, error)

NewPlanValue builds a sqltypes.PlanValue from an Expr.

func Normalize

func Normalize(stmt Statement, reserved *ReservedVars, bindVars map[string]*querypb.BindVariable) error

Normalize changes the statement to use bind values, and updates the bind vars to those values. The supplied prefix is used to generate the bind var names. The function ensures that there are no collisions with existing bind vars. Within Select constructs, bind vars are deduped. This allows us to identify vindex equality. Otherwise, every value is treated as distinct.

func NormalizeAlphabetically added in v0.8.0

func NormalizeAlphabetically(query string) (normalized string, err error)

NormalizeAlphabetically rewrites given query such that: - WHERE 'AND' expressions are reordered alphabetically

func Parse2 added in v0.10.0

func Parse2(sql string) (Statement, BindVars, error)

Parse2 parses the SQL in full and returns a Statement, which is the AST representation of the query, and a set of BindVars, which are all the bind variables that were found in the original SQL query. If a DDL statement is partially parsed but still contains a syntax error, the error is ignored and the DDL is returned anyway.

func ParseAndBind added in v0.9.0

func ParseAndBind(in string, binds ...*querypb.BindVariable) (query string, err error)

ParseAndBind is a one step sweep that binds variables to an input query, in order of placeholders. It is useful when one doesn't have any parser-variables, just bind variables. Example:

query, err := ParseAndBind("select * from tbl where name=%a", sqltypes.StringBindVariable("it's me"))

func ParseTable added in v0.9.0

func ParseTable(input string) (keyspace, table string, err error)

ParseTable parses the input as a qualified table name. It handles all valid literal escaping.

func ParseTokenizer

func ParseTokenizer(tokenizer *Tokenizer) int

ParseTokenizer is a raw interface to parse from the given tokenizer. This does not used pooled parsers, and should not be used in general.

func QueryMatchesTemplates added in v0.8.0

func QueryMatchesTemplates(query string, queryTemplates []string) (match bool, err error)

QueryMatchesTemplates sees if the given query has the same fingerprint as one of the given templates (one is enough)

func RedactSQLQuery

func RedactSQLQuery(sql string) (string, error)

RedactSQLQuery returns a sql string with the params stripped out for display

func SkipQueryPlanCacheDirective

func SkipQueryPlanCacheDirective(stmt Statement) bool

SkipQueryPlanCacheDirective returns true if skip query plan cache directive is set to true in query.

func SplitStatement

func SplitStatement(blob string) (string, string, error)

SplitStatement returns the first sql statement up to either a ; or EOF and the remainder from the given buffer

func SplitStatementToPieces

func SplitStatementToPieces(blob string</