[parser] add show table $table_name next_row_id syntax (#738)
* add `show table $table_name next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> add show table next row id Signed-off-by: zhang555 <4598181@qq.com> add show table next row id Signed-off-by: zhang555 <4598181@qq.com> add show table next row id Signed-off-by: zhang555 <4598181@qq.com> add show table next row id Signed-off-by: zhang555 <4598181@qq.com> add show table next row id Signed-off-by: zhang555 <4598181@qq.com> add `show table next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> add `show table $table_name next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> add `show table next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> add `show table $table_name next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> add `show table next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> * add `show table $table_name next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> * add `show table $table_name next_row_id` syntax Signed-off-by: zhang555 <4598181@qq.com> * add syntax Signed-off-by: zhang555 <4598181@qq.com> * Merge branch 'master' into mytidb1 Signed-off-by: zhang555 <4598181@qq.com> # Conflicts: # parser.go
This commit is contained in:
@ -1867,6 +1867,7 @@ const (
|
||||
ShowAnalyzeStatus
|
||||
ShowRegions
|
||||
ShowBuiltins
|
||||
ShowTableNextRowId
|
||||
)
|
||||
|
||||
const (
|
||||
@ -2154,6 +2155,13 @@ func (n *ShowStmt) Restore(ctx *format.RestoreCtx) error {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
case ShowTableNextRowId:
|
||||
ctx.WriteKeyWord("TABLE ")
|
||||
if err := n.Table.Restore(ctx); err != nil {
|
||||
return errors.Annotate(err, "An error occurred while restore SplitIndexRegionStmt.Table")
|
||||
}
|
||||
ctx.WriteKeyWord(" NEXT_ROW_ID")
|
||||
return nil
|
||||
default:
|
||||
return errors.New("Unknown ShowStmt type")
|
||||
}
|
||||
|
||||
6173
parser/parser.go
6173
parser/parser.go
File diff suppressed because it is too large
Load Diff
@ -8255,6 +8255,13 @@ ShowStmt:
|
||||
}
|
||||
$$ = stmt
|
||||
}
|
||||
| "SHOW" "TABLE" TableName "NEXT_ROW_ID"
|
||||
{
|
||||
$$ = &ast.ShowStmt{
|
||||
Tp: ast.ShowTableNextRowId,
|
||||
Table: $3.(*ast.TableName),
|
||||
}
|
||||
}
|
||||
| "SHOW" "TABLE" TableName "INDEX" Identifier "REGIONS" WhereClauseOptional
|
||||
{
|
||||
stmt := &ast.ShowStmt{
|
||||
|
||||
@ -800,6 +800,11 @@ AAAAAAAAAAAA5gm5Mg==
|
||||
{"show table t1 index idx1 regions where a=2", true, "SHOW TABLE `t1` INDEX `idx1` REGIONS WHERE `a`=2"},
|
||||
{"show table t1 index idx1", false, ""},
|
||||
|
||||
// for show table next_row_id.
|
||||
{"show table t1.t1 next_row_id", true, "SHOW TABLE `t1`.`t1` NEXT_ROW_ID"},
|
||||
{"show table t1 next_row_id", true, "SHOW TABLE `t1` NEXT_ROW_ID"},
|
||||
{"show table next_row_id", false, ""},
|
||||
|
||||
// for transaction mode
|
||||
{"begin pessimistic", true, "BEGIN PESSIMISTIC"},
|
||||
{"begin optimistic", true, "BEGIN OPTIMISTIC"},
|
||||
|
||||
Reference in New Issue
Block a user