mirror of
https://github.com/pgvector/pgvector.git
synced 2026-06-06 05:51:21 +08:00
Fixed segmentation fault with text representation
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
## 0.4.4 (unreleased)
|
||||
|
||||
- Improved error message for malformed vector literal
|
||||
- Fixed segmentation fault with text representation
|
||||
- Fixed consecutive delimiters with text representation
|
||||
|
||||
## 0.4.3 (2023-06-10)
|
||||
|
||||
@@ -194,7 +194,7 @@ vector_in(PG_FUNCTION_ARGS)
|
||||
pt = strtok(NULL, ",");
|
||||
}
|
||||
|
||||
if (*stringEnd != ']')
|
||||
if (stringEnd == NULL || *stringEnd != ']')
|
||||
ereport(ERROR,
|
||||
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
|
||||
errmsg("malformed vector literal: \"%s\"", lit),
|
||||
|
||||
@@ -81,6 +81,16 @@ ERROR: malformed vector literal: "1,2,3"
|
||||
LINE 1: SELECT '1,2,3'::vector;
|
||||
^
|
||||
DETAIL: Vector contents must start with "[".
|
||||
SELECT '['::vector;
|
||||
ERROR: malformed vector literal: "["
|
||||
LINE 1: SELECT '['::vector;
|
||||
^
|
||||
DETAIL: Unexpected end of input.
|
||||
SELECT '[,'::vector;
|
||||
ERROR: malformed vector literal: "[,"
|
||||
LINE 1: SELECT '[,'::vector;
|
||||
^
|
||||
DETAIL: Unexpected end of input.
|
||||
SELECT '[]'::vector;
|
||||
ERROR: vector must have at least 1 dimension
|
||||
LINE 1: SELECT '[]'::vector;
|
||||
|
||||
@@ -14,6 +14,8 @@ SELECT '[4e38,1]'::vector;
|
||||
SELECT '[1,2,3'::vector;
|
||||
SELECT '[1,2,3]9'::vector;
|
||||
SELECT '1,2,3'::vector;
|
||||
SELECT '['::vector;
|
||||
SELECT '[,'::vector;
|
||||
SELECT '[]'::vector;
|
||||
SELECT '[1,]'::vector;
|
||||
SELECT '[1a]'::vector;
|
||||
|
||||
Reference in New Issue
Block a user