-
Notifications
You must be signed in to change notification settings - Fork 489
Closed
Description
Bug Report
Please answer these questions before submitting your issue. Thanks!
- What did you do?
If possible, provide a recipe for reproducing the error.
package main
import (
"fmt"
"github.com/pingcap/parser"
"github.com/pingcap/parser/format"
_ "github.com/pingcap/tidb/types/parser_driver"
"strings"
)
func main() {
p := parser.New()
nodes, _ := p.ParseOneStmt(`
create table precise_types (
c DECIMAL(20,0) NOT NULL,
d DOUBLE(20,0) NOT NULL
);
`, "", "")
var s strings.Builder
ctx := format.NewRestoreCtx(format.DefaultRestoreFlags, &s)
nodes.Restore(ctx)
fmt.Println(s.String())
}- What did you expect to see?
Prints
CREATE TABLE `precise_types` (`c` DECIMAL(20) NOT NULL,`d` DOUBLE(20,0) NOT NULL)- What did you see instead?
The precision is just directly omitted.
CREATE TABLE `precise_types` (`c` DECIMAL NOT NULL,`d` DOUBLE NOT NULL)- What version of TiDB SQL Parser are you using?
master (366172d)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels