0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Fix parsing of float fields with scale digits

This commit is contained in:
Jürgen Hunold 2022-04-17 17:11:13 +02:00 committed by Roland Bock
parent b50cc454b6
commit 9bfee74a99
2 changed files with 4 additions and 2 deletions

View File

@ -198,7 +198,8 @@ ddlType = (
) )
ddlUnsigned = pp.CaselessLiteral("UNSIGNED").setResultsName("isUnsigned") ddlUnsigned = pp.CaselessLiteral("UNSIGNED").setResultsName("isUnsigned")
ddlWidth = ddlLeft + pp.Word(pp.nums) + ddlRight ddlDigits = "," + pp.Word(pp.nums)
ddlWidth = ddlLeft + pp.Word(pp.nums) + pp.Optional(ddlDigits) + ddlRight
ddlTimezone = ( ddlTimezone = (
(pp.CaselessLiteral("with") | pp.CaselessLiteral("without")) (pp.CaselessLiteral("with") | pp.CaselessLiteral("without"))
+ pp.CaselessLiteral("time") + pp.CaselessLiteral("time")
@ -363,6 +364,7 @@ def testTable():
text = """ text = """
CREATE TABLE "public"."dk" ( CREATE TABLE "public"."dk" (
"id" int8 NOT NULL DEFAULT nextval('dk_id_seq'::regclass), "id" int8 NOT NULL DEFAULT nextval('dk_id_seq'::regclass),
"strange" NUMERIC(314, 15),
"last_update" timestamp(6) DEFAULT now(), "last_update" timestamp(6) DEFAULT now(),
PRIMARY KEY (id) PRIMARY KEY (id)
) )

View File

@ -29,6 +29,7 @@ CREATE TABLE tab_foo
delta varchar(255), delta varchar(255),
_epsilon bigint, _epsilon bigint,
`omega` double, `omega` double,
some_number NUMERIC(314,15),
CONSTRAINT uc_delta UNIQUE (delta, _epsilon) CONSTRAINT uc_delta UNIQUE (delta, _epsilon)
); );
@ -39,4 +40,3 @@ CREATE TABLE tab_bar
gamma bool NOT NULL, gamma bool NOT NULL,
delta int delta int
); );