[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:
张某
2020-02-09 15:02:48 +08:00
committed by Ti Chi Robot
parent acf6cb52c0
commit 644e72eba2
4 changed files with 3111 additions and 3082 deletions

View File

@ -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")
}

File diff suppressed because it is too large Load Diff

View File

@ -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{

View File

@ -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"},