Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#30672 closed Bug (fixed)

JSONField/HStoreField key and index transforms crash.

Reported by: Mariusz Felisiak Owned by: Mariusz Felisiak
Component: contrib.postgres Version: 1.11
Severity: Release blocker Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Mariusz Felisiak)

JSONField/HStoreField key and index transforms crash when we pass expressions with parameters, e.g.

KeyTransform('x', RawSQL("%s::jsonb", ['{"x": "bar"}'])

this is caused by regression introduced in the last security release 7deeabc7c7526786df6894429ce89a9c4b614086, however KeyTransform is undocumented and such usage is untested.

Crash for nested keys in KeyTransform for JSONField is not a regression because it has not been changed since its introduction.

Change History (12)

comment:1 by Carlton Gibson, 5 years ago

Triage Stage: UnreviewedAccepted

Well, clearly a bug. I'm inclined to view this as new usage, rather than a regression, but open to opinions.

comment:2 by Mariusz Felisiak, 5 years ago

Description: modified (diff)

comment:3 by Mariusz Felisiak, 5 years ago

Description: modified (diff)
Version: 2.2master

OK, it seems that it's not a regression because these transforms crashed (when we pass expressions with parameters) even before 7deeabc7c7526786df6894429ce89a9c4b614086. Of course from a different reason.

comment:4 by Mariusz Felisiak, 5 years ago

Has patch: set

comment:5 by Mariusz Felisiak, 5 years ago

Description: modified (diff)

comment:6 by Mariusz Felisiak, 5 years ago

Version: master1.11

comment:7 by Mariusz Felisiak, 5 years ago

Severity: NormalRelease blocker

comment:8 by Mariusz Felisiak, 5 years ago

I moved an issue with nested transforms to a separate ticket #30704 because it is not a regression.

comment:9 by GitHub <noreply@…>, 5 years ago

Resolution: fixed
Status: assignedclosed

In 1f8382d3:

Fixed #30672 -- Fixed crash of JSONField/HStoreField key transforms on expressions with params.

Regression in 4f5b58f5cd3c57fee9972ab074f8dc6895d8f387.

Thanks Florian Apolloner for the report and helping with tests.

comment:10 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 52a7759a:

[2.2.x] Fixed #30672 -- Fixed crash of JSONField/HStoreField key transforms on expressions with params.

Regression in 4f5b58f5cd3c57fee9972ab074f8dc6895d8f387.

Thanks Florian Apolloner for the report and helping with tests.

Backport of 1f8382d34d54061eddc41df6994e20ee38c60907 from master.

comment:11 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 968b9af9:

[2.1.x] Fixed #30672 -- Fixed crash of JSONField/HStoreField key transforms on expressions with params.

Regression in 4f5b58f5cd3c57fee9972ab074f8dc6895d8f387.

Thanks Florian Apolloner for the report and helping with tests.

Backport of 1f8382d34d54061eddc41df6994e20ee38c60907 from master.

comment:12 by Mariusz Felisiak <felisiak.mariusz@…>, 5 years ago

In 473c526b:

[1.11.x] Fixed #30672 -- Fixed crash of JSONField/HStoreField key transforms on expressions with params.

Regression in 4f5b58f5cd3c57fee9972ab074f8dc6895d8f387.

Thanks Florian Apolloner for the report and helping with tests.

Backport of 1f8382d34d54061eddc41df6994e20ee38c60907 from master.

Note: See TracTickets for help on using tickets.
Back to Top