Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertMySQLVersionToCommentVersion(version string) (string, error)
- func ExtractMysqlComment(sql string) (string, string)
- func GetKeywords() []cache.Keyword
- func IsMySQL80AndAbove() bool
- func KeywordString(id int) string
- func Parse(lexer tokenizer.Tokenizer) int
- func ParsePooled(lexer tokenizer.Tokenizer) int
- type MysqlTokenizer
- func (tkn *MysqlTokenizer) BindVar(bvar string, value struct{})
- func (tkn *MysqlTokenizer) Cur() rune
- func (tkn *MysqlTokenizer) DecNesting()
- func (tkn *MysqlTokenizer) Error(err string)
- func (tkn *MysqlTokenizer) GetBindVars() ast.BindVars
- func (tkn *MysqlTokenizer) GetDialect() dialect.SqlDialect
- func (tkn *MysqlTokenizer) GetIdToken() int
- func (tkn *MysqlTokenizer) GetKeywordString(token int) string
- func (tkn *MysqlTokenizer) GetLastError() error
- func (tkn *MysqlTokenizer) GetNesting() int
- func (tkn *MysqlTokenizer) GetParseTree() ast.Statement
- func (tkn *MysqlTokenizer) GetPartialDDL() ast.Statement
- func (tkn *MysqlTokenizer) GetPos() int
- func (tkn *MysqlTokenizer) GetText(startPos int) string
- func (tkn *MysqlTokenizer) IncNesting()
- func (tkn *MysqlTokenizer) Lex(lval *mysqSymType) int
- func (tkn *MysqlTokenizer) Peek(dist int) rune
- func (tkn *MysqlTokenizer) Reset()
- func (tkn *MysqlTokenizer) ResetTo(nextPos int)
- func (tkn *MysqlTokenizer) Scan() (int, string)
- func (tkn *MysqlTokenizer) SetAllowComments(allow bool)
- func (tkn *MysqlTokenizer) SetIgnoreCommentKeyword(ignore bool)
- func (tkn *MysqlTokenizer) SetMulti(multi bool)
- func (tkn *MysqlTokenizer) SetParseTree(stmt ast.Statement)
- func (tkn *MysqlTokenizer) SetPartialDDL(node ast.Statement)
- func (tkn *MysqlTokenizer) SetSkipSpecialComments(skip bool)
- func (tkn *MysqlTokenizer) SetSkipToEnd(skip bool)
- func (tkn *MysqlTokenizer) Skip(dist int)
- func (tkn *MysqlTokenizer) SkipBlank()
- type PositionedErr
Constants ¶
const ACTION = 57570
const ACTIVE = 57817
const ADD = 57550
const ADMIN = 57818
const AFTER = 57619
const AGAINST = 57783
const ALGORITHM = 57423
const ALL = 57365
const ALTER = 57546
const ALWAYS = 57383
const ANALYZE = 57549
const AND = 57477
const APPROXNUM = 57684
const ARRAY = 57792
const AS = 57367
const ASC = 57369
const ASCII = 57680
const AT_AT_ID = 57430
const AT_ID = 57429
const AUTOEXTEND_SIZE = 57819
const AUTO_INCREMENT = 57683
const AVG_ROW_LENGTH = 57896
const BEGIN = 57629
const BETWEEN = 57479
const BIGINT = 57643
const BINARY = 57499
const BIT = 57637
const BIT_LITERAL = 57442
const BLOB = 57664
const BOOL = 57656
const BOOLEAN = 57784
const BOTH = 57466
const BUCKETS = 57820
const BY = 57361
const BYTE = 57793
const CALL = 57379
const CANCEL = 57621
const CASCADE = 57571
const CASCADED = 57607
const CASE = 57480
const CAST = 57754
const CHANGE = 57552
const CHANNEL = 57893
const CHAR = 57654
const CHARACTER = 57657
const CHARSET = 57471
const CHECK = 57568
const CHECKSUM = 57898
const CLEANUP = 57624
const CLONE = 57821
const COALESCE = 57585
const CODE = 57688
const COLLATE = 57498
const COLLATION = 57689
const COLUMN = 57564
const COLUMNS = 57690
const COLUMN_FORMAT = 57822
const COMMENT = 57440
const COMMENT_KEYWORD = 57441
const COMMIT = 57632
const COMMITTED = 57719
const COMPACT = 57911
const COMPLETE = 57623
const COMPONENT = 57823
const COMPRESSED = 57909
const COMPRESSION = 57443
const CONNECTION = 57897
const CONSTRAINT = 57572
const CONVERT = 57753
const COPY = 57421
const CREATE = 57545
const CROSS = 57414
const CSV = 57393
const CUME_DIST = 57794
const CURRENT_DATE = 57724
const CURRENT_TIME = 57726
const CURRENT_TIMESTAMP = 57722
const CURRENT_USER = 57729
const DATA = 57386
const DATABASE = 57723
const DATABASES = 57691
const DATE = 57580
const DATETIME = 57652
const DAY = 57733
const DAY_HOUR = 57734
const DAY_MICROSECOND = 57735
const DAY_MINUTE = 57736
const DAY_SECOND = 57737
const DEALLOCATE = 57554
const DECIMAL = 57436
const DECIMAL_TYPE = 57648
const DEFAULT = 57373
const DEFINER = 57608
const DEFINITION = 57824
const DELAY_KEY_WRITE = 57899
const DELETE = 57355
const DENSE_RANK = 57796
const DESC = 57370
const DESCRIBE = 57578
const DESCRIPTION = 57795
const DIRECTORY = 57601
const DISABLE = 57462
const DISCARD = 57459
const DISK = 57918
const DISTINCT = 57366
const DISTINCTROW = 57380
const DIV = 57495
const DO = 57378
const DOUBLE = 57646
const DROP = 57547
const DUMPFILE = 57392
const DUPLICATE = 57372
const DYNAMIC = 57908
const ELSE = 57483
const EMPTY = 57797
const EMPTY_FROM_CLAUSE = 57469
const ENABLE = 57461
const ENCLOSED = 57391
const ENCRYPTION = 57900
const END = 57484
const ENFORCED = 57825
const ENGINE = 57901
const ENGINES = 57692
const ENGINE_ATTRIBUTE = 57826
const ENUM = 57671
const ERROR = 57887
const ESCAPE = 57581
const ESCAPED = 57390
const EVENT = 57693
const EXCEPT = 57798
const EXCHANGE = 57586
const EXCLUDE = 57827
const EXCLUSIVE = 57426
const EXECUTE = 57591
const EXISTS = 57368
const EXPANSION = 57788
const EXPIRE = 57627
const EXPLAIN = 57579
const EXPORT = 57895
const EXPRESSION_PREC_SETTER = 57474
const EXTENDED = 57694
const EXTRACT = 57454
const FALSE = 57457
const FIELDS = 57695
const FIRST = 57618
const FIRST_VALUE = 57799
const FIXED = 57907
const FLOAT = 57435
const FLOAT_TYPE = 57647
const FLUSH = 57551
const FOLLOWING = 57828
const FOR = 57364
const FORCE = 57417
const FOREIGN = 57573
const FORMAT = 57880
const FROM = 57356
const FULL = 57696
const FULLTEXT = 57566
const FUNCTION = 57697
const FUNCTION_CALL_NON_KEYWORD = 57347
const GE = 57486
const GENERAL = 57888
const GENERATED = 57382
const GEOMCOLLECTION = 57829
const GEOMETRY = 57672
const GEOMETRYCOLLECTION = 57676
const GET_MASTER_PUBLIC_KEY = 57830
const GLOBAL = 57711
const GROUP = 57358
const GROUPING = 57800
const GROUPS = 57801
const GROUP_CONCAT = 57757
const GTID_EXECUTED = 57698
const HASH = 57925
const HAVING = 57359
const HEADER = 57394
const HEX = 57431
const HEXNUM = 57437
const HISTOGRAM = 57831
const HISTORY = 57832
const HOSTS = 57889
const HOUR = 57738
const HOUR_MICROSECOND = 57739
const HOUR_MINUTE = 57740
const HOUR_SECOND = 57741
const ID = 57428
const IF = 57562
const IGNORE = 57561
const IMPORT = 57460
const IN = 57492
const INACTIVE = 57833
const INDEX = 57558
const INDEXES = 57569
const INNER = 57412
const INPLACE = 57420
const INSERT = 57353
const INSERT_METHOD = 57902
const INSTANT = 57422
const INT = 57641
const INTEGER = 57642
const INTEGRAL = 57434
const INTERVAL = 57542
const INTNUM = 57644
const INTO = 57371
const INVISIBLE = 57834
const INVOKER = 57616
const IS = 57489
const ISOLATION = 57713
const JOIN = 57408
const JSON = 57668
const JSON_ARRAY = 57765
const JSON_ARRAY_APPEND = 57772
const JSON_ARRAY_INSERT = 57773
const JSON_CONTAINS = 57447
const JSON_CONTAINS_PATH = 57448
const JSON_DEPTH = 57768
const JSON_EXTRACT = 57449
const JSON_EXTRACT_OP = 57543
const JSON_INSERT = 57774
const JSON_KEYS = 57450
const JSON_LENGTH = 57770
const JSON_MERGE = 57775
const JSON_MERGE_PATCH = 57776
const JSON_MERGE_PRESERVE = 57777
const JSON_OBJECT = 57766
const JSON_OVERLAPS = 57451
const JSON_PRETTY = 57444
const JSON_QUOTE = 57767
const JSON_REMOVE = 57778
const JSON_REPLACE = 57779
const JSON_SCHEMA_VALID = 57669
const JSON_SCHEMA_VALIDATION_REPORT = 57670
const JSON_SEARCH = 57452
const JSON_SET = 57780
const JSON_STORAGE_FREE = 57446
const JSON_STORAGE_SIZE = 57445
const JSON_TABLE = 57802
const JSON_TYPE = 57769
const JSON_UNQUOTE = 57781
const JSON_UNQUOTE_EXTRACT_OP = 57544
const JSON_VALID = 57771
const JSON_VALUE = 57453
const KEY = 57473
const KEYS = 57377
const KEYSPACES = 57699
const KEY_BLOCK_SIZE = 57567
const LAG = 57803
const LANGUAGE = 57785
const LAST = 57620
const LAST_INSERT_ID = 57400
const LAST_VALUE = 57804
const LATERAL = 57805
const LE = 57485
const LEAD = 57806
const LEADING = 57467
const LEFT = 57410
const LESS = 57595
const LEVEL = 57714
const LEX_ERROR = 57348
const LIKE = 57490
const LIMIT = 57362
const LINEAR = 57920
const LINES = 57388
const LINESTRING = 57674
const LIST = 57922
const LIST_ARG = 57439
const LOAD = 57387
const LOCAL = 57883
const LOCALTIME = 57727
const LOCALTIMESTAMP = 57728
const LOCK = 57375
const LOCKED = 57835
const LOGS = 57886
const LONGBLOB = 57667
const LONGTEXT = 57663
const LOWER_THAN_CHARSET = 57470
const LOW_PRIORITY = 57884
const LTRIM = 57762
const MANIFEST = 57395
const MASTER_COMPRESSION_ALGORITHMS = 57836
const MASTER_PUBLIC_KEY_PATH = 57837
const MASTER_TLS_CIPHERSUITES = 57838
const MASTER_ZSTD_COMPRESSION_LEVEL = 57839
const MATCH = 57782
const MAXVALUE = 57592
const MAX_ROWS = 57903
const MEDIUMBLOB = 57666
const MEDIUMINT = 57640
const MEDIUMTEXT = 57662
const MEMBER = 57346
const MEMORY = 57917
const MERGE = 57613
const MICROSECOND = 57742
const MINUTE = 57743
const MINUTE_MICROSECOND = 57744
const MINUTE_SECOND = 57745
const MIN_ROWS = 57904
const MOD = 57496
const MODE = 57404
const MODIFY = 57553
const MONTH = 57746
const MULTILINESTRING = 57678
const MULTIPOINT = 57677
const MULTIPOLYGON = 57679
const NAME = 57602
const NAMES = 57710
const NATURAL = 57415
const NCHAR = 57659
const NCHAR_STRING = 57433
const NE = 57487
const NESTED = 57840
const NETWORK_NAMESPACE = 57841
const NEXT = 57401
const NO = 57574
const NONE = 57424
const NOT = 57478
const NOW = 57725
const NOWAIT = 57842
const NO_WRITE_TO_BINLOG = 57885
const NTH_VALUE = 57807
const NTILE = 57808
const NULL = 57455
const NULLS = 57843
const NULLX = 57682
const NULL_SAFE_EQUAL = 57488
const NUMERIC = 57649
const OF = 57809
const OFF = 57458
const OFFSET = 57363
const OJ = 57844
const OLD = 57845
const ON = 57418
const ONLY = 57717
const OPEN = 57700
const OPTIMIZE = 57583
const OPTIMIZER_COSTS = 57890
const OPTION = 57609
const OPTIONAL = 57846
const OPTIONALLY = 57398
const OR = 57475
const ORDER = 57360
const ORDINALITY = 57847
const ORGANIZATION = 57848
const OTHERS = 57849
const OUTER = 57413
const OUTFILE = 57384
const OVER = 57810
const OVERWRITE = 57396
const PACK_KEYS = 57905
const PARSER = 57381
const PARTIAL = 57850
const PARTITION = 57593
const PARTITIONING = 57588
const PARTITIONS = 57919
const PASSWORD = 57906
const PATH = 57851
const PERCENT_RANK = 57811
const PERSIST = 57852
const PERSIST_ONLY = 57853
const PLUGINS = 57701
const POINT = 57673
const POLYGON = 57675
const PRECEDING = 57854
const PREPARE = 57590
const PRIMARY = 57563
const PRIVILEGES = 57702
const PRIVILEGE_CHECKS_USER = 57855
const PROCEDURE = 57597
const PROCESS = 57856
const PROCESSLIST = 57703
const QUARTER = 57747
const QUERY = 57787
const RANDOM = 57857
const RANGE = 57921
const RANK = 57812
const RATIO = 57628
const READ = 57715
const REAL = 57645
const REBUILD = 57587
const RECURSIVE = 57813
const REDUNDANT = 57910
const REFERENCE = 57858
const REFERENCES = 57575
const REGEXP = 57491
const RELAY = 57894
const RELEASE = 57635
const REMOVE = 57589
const RENAME = 57548
const REORGANIZE = 57594
const REPAIR = 57582
const REPEATABLE = 57718
const REPLACE = 57752
const REQUIRE_ROW_FORMAT = 57859
const RESOURCE = 57860
const RESPECT = 57861
const RESTART = 57862
const RESTRICT = 57576
const RETAIN = 57863
const RETRY = 57622
const RETURNING = 57879
const REUSE = 57864
const REVERT = 57555
const RIGHT = 57411
const ROLE = 57865
const ROLLBACK = 57633
const ROW_FORMAT = 57912
const ROW_NUMBER = 57814
const RTRIM = 57763
const S3 = 57385
const SAVEPOINT = 57634
const SCHEMA = 57556
const SCHEMAS = 57704
const SECOND = 57748
const SECONDARY = 57866
const SECONDARY_ENGINE = 57867
const SECONDARY_ENGINE_ATTRIBUTE = 57868
const SECONDARY_LOAD = 57869
const SECONDARY_UNLOAD = 57870
const SECOND_MICROSECOND = 57749
const SECURITY = 57617
const SELECT = 57350
const SEPARATOR = 57758
const SEQUENCE = 57612
const SERIALIZABLE = 57721
const SESSION = 57712
const SET = 57374
const SHARE = 57403
const SHARED = 57425
const SHIFT_LEFT = 57493
const SHIFT_RIGHT = 57494
const SHOW = 57577
const SIGNED = 57685
const SIMPLE = 57871
const SKIP = 57872
const SLOW = 57892
const SMALLINT = 57639
const SPATIAL = 57565
const SQL = 57610
const SQL_CACHE = 57406
const SQL_CALC_FOUND_ROWS = 57407
const SQL_NO_CACHE = 57405
const SRID = 57873
const START = 57630
const STARTING = 57397
const STATS_AUTO_RECALC = 57913
const STATS_PERSISTENT = 57914
const STATS_SAMPLE_PAGES = 57915
const STATUS = 57604
const STORAGE = 57916
const STORED = 57465
const STRAIGHT_JOIN = 57409
const STREAM = 57351
const STRING = 57432
const SUBPARTITION = 57923
const SUBPARTITIONS = 57924
const SUBQUERY_AS_EXPR = 57427
const SUBSTR = 57755
const SUBSTRING = 57756
const SYSTEM = 57815
const TABLE = 57557
const TABLES = 57705
const TABLESPACE = 57463
const TEMPORARY = 57614
const TEMPTABLE = 57615
const TERMINATED = 57389
const TEXT = 57660
const THAN = 57596
const THEN = 57482
const THREAD_PRIORITY = 57874
const THROTTLE = 57625
const TIES = 57875
const TIME = 57650
const TIMESTAMP = 57651
const TIMESTAMPADD = 57759
const TIMESTAMPDIFF = 57760
const TINYBLOB = 57665
const TINYINT = 57638
const TINYTEXT = 57661
const TO = 57560
const TRADITIONAL = 57882
const TRAILING = 57468
const TRANSACTION = 57631
const TREE = 57881
const TRIGGER = 57598
const TRIGGERS = 57706
const TRIM = 57764
const TRUE = 57456
const TRUNCATE = 57584
const UNARY = 57497
const UNBOUNDED = 57876
const UNCOMMITTED = 57720
const UNDEFINED = 57611
const UNDERSCORE_ARMSCII8 = 57500
const UNDERSCORE_ASCII = 57501
const UNDERSCORE_BIG5 = 57502
const UNDERSCORE_BINARY = 57503
const UNDERSCORE_CP1250 = 57504
const UNDERSCORE_CP1251 = 57505
const UNDERSCORE_CP1256 = 57506
const UNDERSCORE_CP1257 = 57507
const UNDERSCORE_CP850 = 57508
const UNDERSCORE_CP852 = 57509
const UNDERSCORE_CP866 = 57510
const UNDERSCORE_CP932 = 57511
const UNDERSCORE_DEC8 = 57512
const UNDERSCORE_EUCJPMS = 57513
const UNDERSCORE_EUCKR = 57514
const UNDERSCORE_GB18030 = 57515
const UNDERSCORE_GB2312 = 57516
const UNDERSCORE_GBK = 57517
const UNDERSCORE_GEOSTD8 = 57518
const UNDERSCORE_GREEK = 57519
const UNDERSCORE_HEBREW = 57520
const UNDERSCORE_HP8 = 57521
const UNDERSCORE_KEYBCS2 = 57522
const UNDERSCORE_KOI8R = 57523
const UNDERSCORE_KOI8U = 57524
const UNDERSCORE_LATIN1 = 57525
const UNDERSCORE_LATIN2 = 57526
const UNDERSCORE_LATIN5 = 57527
const UNDERSCORE_LATIN7 = 57528
const UNDERSCORE_MACCE = 57529
const UNDERSCORE_MACROMAN = 57530
const UNDERSCORE_SJIS = 57531
const UNDERSCORE_SWE7 = 57532
const UNDERSCORE_TIS620 = 57533
const UNDERSCORE_UCS2 = 57534
const UNDERSCORE_UJIS = 57535
const UNDERSCORE_UTF16 = 57536
const UNDERSCORE_UTF16LE = 57537
const UNDERSCORE_UTF32 = 57538
const UNDERSCORE_UTF8 = 57539
const UNDERSCORE_UTF8MB3 = 57541
const UNDERSCORE_UTF8MB4 = 57540
const UNICODE = 57681
const UNION = 57349
const UNIQUE = 57472
const UNLOCK = 57376
const UNSIGNED = 57686
const UNTHROTTLE = 57626
const UNUSED = 57791
const UPDATE = 57354
const UPGRADE = 57603
const USE = 57416
const USER = 57707
const USER_RESOURCES = 57891
const USING = 57419
const UTC_DATE = 57730
const UTC_TIME = 57731
const UTC_TIMESTAMP = 57732
const VALIDATION = 57790
const VALUE = 57402
const VALUES = 57399
const VALUE_ARG = 57438
const VARBINARY = 57658
const VARCHAR = 57655
const VARIABLES = 57605
const VCPU = 57877
const VGTID_EXECUTED = 57708
const VIEW = 57559
const VINDEX = 57599
const VINDEXES = 57600
const VIRTUAL = 57464
const VISIBLE = 57878
const VSCHEMA = 57709
const VSTREAM = 57352
const WARNINGS = 57606
const WEEK = 57751
const WEIGHT_STRING = 57761
const WHEN = 57481
const WHERE = 57357
const WINDOW = 57816
const WITH = 57786
const WITHOUT = 57789
const WORK = 57636
const WRITE = 57716
const XOR = 57476
const YEAR = 57653
const YEAR_MONTH = 57750
const ZEROFILL = 57687
Variables ¶
var MySQLServerVersion = flag.String("mysql_server_version", "", "MySQL server version to advertise.")
MySQLServerVersion is what Vitess will present as it's version during the connection handshake, and as the value to the @@version system variable. If nothing is provided, Vitess will report itself as a specific MySQL version with the vitess version appended to it
var MySQLVersion = "50709" // default version if nothing else is stated
MySQLVersion is the version of MySQL that the parser would emulate
Functions ¶
func ConvertMySQLVersionToCommentVersion ¶
ConvertMySQLVersionToCommentVersion converts the MySQL version into comment version format.
func ExtractMysqlComment ¶
ExtractMysqlComment extracts the version and SQL from a comment-only query such as /*!50708 sql here */
func GetKeywords ¶
func IsMySQL80AndAbove ¶
func IsMySQL80AndAbove() bool
func KeywordString ¶
KeywordString returns the string corresponding to the given keyword
func ParsePooled ¶
mysqParsePooled is a wrapper around mysqParse that pools the parser objects. There isn't a particularly good reason to use yyParse directly, since it immediately discards its parser.
N.B: Parser pooling means that you CANNOT take references directly to parse stack variables (e.g. $$ = &$4) in sql.y rules. You must instead add an intermediate reference like so:
showCollationFilterOpt := $4 $$ = &Show{Type: string($2), ShowCollationFilterOpt: &showCollationFilterOpt}
Types ¶
type MysqlTokenizer ¶
type MysqlTokenizer struct { AllowComments bool SkipSpecialComments bool SkipToEnd bool LastError error ParseTree ast.Statement BindVars map[string]struct{} Pos int // contains filtered or unexported fields }
MysqlTokenizer is the struct used to generate SQL tokens for the parser.
func NewMysqlStringTokenizer ¶
func NewMysqlStringTokenizer(sql string) *MysqlTokenizer
NewMysqlStringTokenizer creates a new Tokenizer for the sql string.
func (*MysqlTokenizer) BindVar ¶
func (tkn *MysqlTokenizer) BindVar(bvar string, value struct{})
BindVar implements sql_parser.Tokenizer.
func (*MysqlTokenizer) Cur ¶
func (tkn *MysqlTokenizer) Cur() rune
func (*MysqlTokenizer) DecNesting ¶
func (tkn *MysqlTokenizer) DecNesting()
DecNesting implements sql_parser.Tokenizer.
func (*MysqlTokenizer) Error ¶
func (tkn *MysqlTokenizer) Error(err string)
Error is called by go yacc if there's a parsing error.
func (*MysqlTokenizer) GetBindVars ¶
func (tkn *MysqlTokenizer) GetBindVars() ast.BindVars
GetBindVars implements tokenizer.Tokenizer.
func (*MysqlTokenizer) GetDialect ¶
func (tkn *MysqlTokenizer) GetDialect() dialect.SqlDialect
GetDialect implements tokenizer.Tokenizer.
func (*MysqlTokenizer) GetIdToken ¶
func (tkn *MysqlTokenizer) GetIdToken() int
GetIdToken implements sql_parser.Tokenizer.
func (*MysqlTokenizer) GetKeywordString ¶
func (tkn *MysqlTokenizer) GetKeywordString(token int) string
GetKeywordString implements sql_parser.Tokenizer.
func (*MysqlTokenizer) GetLastError ¶
func (tkn *MysqlTokenizer) GetLastError() error
GetLastError implements tokenizer.Tokenizer.
func (*MysqlTokenizer) GetNesting ¶
func (tkn *MysqlTokenizer) GetNesting() int
GetNesting implements sql_parser.Tokenizer.
func (*MysqlTokenizer) GetParseTree ¶
func (tkn *MysqlTokenizer) GetParseTree() ast.Statement
GetParseTree implements sql_parser.Tokenizer.
func (*MysqlTokenizer) GetPartialDDL ¶
func (tkn *MysqlTokenizer) GetPartialDDL() ast.Statement
GetPartialDDL implements sql_parser.Tokenizer.
func (*MysqlTokenizer) GetPos ¶
func (tkn *MysqlTokenizer) GetPos() int
GetPos implements tokenizer.Tokenizer.
func (*MysqlTokenizer) GetText ¶
func (tkn *MysqlTokenizer) GetText(startPos int) string
GetText implements tokenizer.Tokenizer.
func (*MysqlTokenizer) IncNesting ¶
func (tkn *MysqlTokenizer) IncNesting()
IncNesting implements sql_parser.Tokenizer.
func (*MysqlTokenizer) Lex ¶
func (tkn *MysqlTokenizer) Lex(lval *mysqSymType) int
Lex returns the next token form the Tokenizer. This function is used by go yacc.
func (*MysqlTokenizer) Peek ¶
func (tkn *MysqlTokenizer) Peek(dist int) rune
func (*MysqlTokenizer) ResetTo ¶
func (tkn *MysqlTokenizer) ResetTo(nextPos int)
ResetTo implements tokenizer.Tokenizer.
func (*MysqlTokenizer) Scan ¶
func (tkn *MysqlTokenizer) Scan() (int, string)
Scan scans the tokenizer for the next token and returns the token type and an optional value.
func (*MysqlTokenizer) SetAllowComments ¶
func (tkn *MysqlTokenizer) SetAllowComments(allow bool)
SetAllowComments implements sql_parser.Tokenizer.
func (*MysqlTokenizer) SetIgnoreCommentKeyword ¶
func (tkn *MysqlTokenizer) SetIgnoreCommentKeyword(ignore bool)
SetIgnoreCommentKeyword implements sql_parser.Tokenizer.
func (*MysqlTokenizer) SetMulti ¶
func (tkn *MysqlTokenizer) SetMulti(multi bool)
SetMulti implements tokenizer.Tokenizer.
func (*MysqlTokenizer) SetParseTree ¶
func (tkn *MysqlTokenizer) SetParseTree(stmt ast.Statement)
SetParseTree implements sql_parser.Tokenizer.
func (*MysqlTokenizer) SetPartialDDL ¶
func (tkn *MysqlTokenizer) SetPartialDDL(node ast.Statement)
SetPartialDDL implements sql_parser.Tokenizer.
func (*MysqlTokenizer) SetSkipSpecialComments ¶
func (tkn *MysqlTokenizer) SetSkipSpecialComments(skip bool)
SetSkipSpecialComments implements tokenizer.Tokenizer.
func (*MysqlTokenizer) SetSkipToEnd ¶
func (tkn *MysqlTokenizer) SetSkipToEnd(skip bool)
SetSkipToEnd implements sql_parser.Tokenizer.
func (*MysqlTokenizer) Skip ¶
func (tkn *MysqlTokenizer) Skip(dist int)
func (*MysqlTokenizer) SkipBlank ¶
func (tkn *MysqlTokenizer) SkipBlank()
SkipBlank skips the cursor while it finds whitespace
type PositionedErr ¶
PositionedErr holds context related to parser errors
func (PositionedErr) Error ¶
func (p PositionedErr) Error() string