Opened 10 months ago

Closed 10 months ago

Last modified 10 months ago

#30672 closed Bug (fixed)

JSONField/HStoreField key and index transforms crash.

Reported by: felixxm Owned by: felixxm
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 felixxm)

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 10 months 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 10 months ago by felixxm

Description: modified (diff)

comment:3 Changed 10 months ago by felixxm

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 10 months ago by felixxm

Has patch: set

comment:5 Changed 10 months ago by felixxm

Description: modified (diff)

comment:6 Changed 10 months ago by felixxm

Version: master1.11

comment:7 Changed 10 months ago by felixxm

Severity: NormalRelease blocker

comment:8 Changed 10 months ago by felixxm

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

comment:9 Changed 10 months 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 10 months 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 10 months 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 10 months 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