v1-0001-Test-cases-for-JSON-path-decimal-literals.patch

text/plain

Filename: v1-0001-Test-cases-for-JSON-path-decimal-literals.patch
Type: text/plain
Part: 0
Message: JSON path decimal literal syntax

Patch

Format: format-patch
Series: patch v1-0001
Subject: Test cases for JSON path decimal literals
File+
src/test/regress/expected/jsonpath.out 18 0
src/test/regress/sql/jsonpath.sql 4 0
From 9fc73f1fa4d83da85dc1626cf8b218ec8a11104c Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter@eisentraut.org>
Date: Fri, 18 Feb 2022 10:52:56 +0100
Subject: [PATCH v1 1/2] Test cases for JSON path decimal literals

---
 src/test/regress/expected/jsonpath.out | 18 ++++++++++++++++++
 src/test/regress/sql/jsonpath.sql      |  4 ++++
 2 files changed, 22 insertions(+)

diff --git a/src/test/regress/expected/jsonpath.out b/src/test/regress/expected/jsonpath.out
index e399fa9631..54eb548ad1 100644
--- a/src/test/regress/expected/jsonpath.out
+++ b/src/test/regress/expected/jsonpath.out
@@ -878,6 +878,24 @@ select '0.0010e+2'::jsonpath;
  0.10
 (1 row)
 
+select '.001'::jsonpath;
+ERROR:  syntax error, unexpected '.' at or near "." of jsonpath input
+LINE 1: select '.001'::jsonpath;
+               ^
+select '.001e1'::jsonpath;
+ERROR:  syntax error, unexpected '.' at or near "." of jsonpath input
+LINE 1: select '.001e1'::jsonpath;
+               ^
+select '1.'::jsonpath;
+ERROR:  syntax error, unexpected end of file at end of jsonpath input
+LINE 1: select '1.'::jsonpath;
+               ^
+select '1.e1'::jsonpath;
+ jsonpath 
+----------
+ 1."e1"
+(1 row)
+
 select '1e'::jsonpath;
 ERROR:  invalid floating point number at or near "1e" of jsonpath input
 LINE 1: select '1e'::jsonpath;
diff --git a/src/test/regress/sql/jsonpath.sql b/src/test/regress/sql/jsonpath.sql
index 17ab775783..bf71b99fc5 100644
--- a/src/test/regress/sql/jsonpath.sql
+++ b/src/test/regress/sql/jsonpath.sql
@@ -163,6 +163,10 @@
 select '0.0010e-1'::jsonpath;
 select '0.0010e+1'::jsonpath;
 select '0.0010e+2'::jsonpath;
+select '.001'::jsonpath;
+select '.001e1'::jsonpath;
+select '1.'::jsonpath;
+select '1.e1'::jsonpath;
 select '1e'::jsonpath;
 select '1.e'::jsonpath;
 select '1.2e'::jsonpath;
-- 
2.35.1