mirror of https://github.com/postgres/postgres
Fix not-quite-right string comparison in parse_jsonb_index_flags().
This code would accept "strinX", where X is any 1-byte character, as meaning "string". Clearly it wasn't meant to do that. No back-patch, since this doesn't affect correct queries and there's some tiny chance we'd break somebody's incorrect query in a minor release. Report and patch by Dominik Czarnota. Discussion: https://postgr.es/m/CABEVAa1dU0mDCAfaT8WF2adVXTDsLVJy_izotg6ze_hh-cn8qQ@mail.gmail.com
This commit is contained in:
parent
74b35eb468
commit
870ad6a59b
|
@ -5125,7 +5125,7 @@ parse_jsonb_index_flags(Jsonb *jb)
|
|||
pg_strncasecmp(v.val.string.val, "key", 3) == 0)
|
||||
flags |= jtiKey;
|
||||
else if (v.val.string.len == 6 &&
|
||||
pg_strncasecmp(v.val.string.val, "string", 5) == 0)
|
||||
pg_strncasecmp(v.val.string.val, "string", 6) == 0)
|
||||
flags |= jtiString;
|
||||
else if (v.val.string.len == 7 &&
|
||||
pg_strncasecmp(v.val.string.val, "numeric", 7) == 0)
|
||||
|
|
Loading…
Reference in New Issue