Opened 2 years ago

Closed 2 years ago

Last modified 2 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 Changed 2 years ago by Carlton Gibson

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 Changed 2 years ago by Mariusz Felisiak

Description: modified (diff)

comment:3 Changed 2 years ago by Mariusz Felisiak

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 Changed 2 years ago by Mariusz Felisiak

Has patch: set

comment:5 Changed 2 years ago by Mariusz Felisiak

Description: modified (diff)

comment:6 Changed 2 years ago by Mariusz Felisiak

Version: master1.11

comment:7 Changed 2 years ago by Mariusz Felisiak

Severity: NormalRelease blocker

comment:8 Changed 2 years ago by Mariusz Felisiak

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

comment:9 Changed 2 years ago by GitHub <noreply@…>

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 Changed 2 years ago by Mariusz Felisiak <felisiak.mariusz@…>

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 Changed 2 years ago by Mariusz Felisiak <felisiak.mariusz@…>

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 Changed 2 years ago by Mariusz Felisiak <felisiak.mariusz@…>

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