parser icon indicating copy to clipboard operation
parser copied to clipboard

Error parsing default values for tables

Open kyleconroy opened this issue 4 years ago • 0 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
CREATE TABLE t1 (
  -- literal defaults
  i INT         DEFAULT 0,
  c VARCHAR(10) DEFAULT '',
  -- expression defaults
  f FLOAT       DEFAULT (RAND() * RAND()),
  b BINARY(16)  DEFAULT (UUID_TO_BIN(UUID())),
  d DATE        DEFAULT (CURRENT_DATE + INTERVAL 1 YEAR),
  p POINT       DEFAULT (Point(0,0)),
  j JSON        DEFAULT (JSON_ARRAY())
);
  1. What did you expect to see?

No parsing error

  1. What did you see instead?

A parsing error

  1. What version of TiDB SQL Parser are you using?
github.com/pingcap/parser v0.0.0-20210914110036-002913dd28ec

kyleconroy avatar Sep 20 '21 03:09 kyleconroy