| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Current dependencies on/for this PR: This comment was auto-generated by Graphite. |
Sorry, something went wrong.
|
Images are ready for the commit at 7d1d2f6. To use with deploy scripts, first export MAIN_IMAGE_TAG=4.1.x-525-g7d1d2f6084. |
Sorry, something went wrong.
|
What about all the preexisting entries in the DB using the old format? |
Sorry, something went wrong.
I think they are fine. Queries will be the same a before and will work, when upsert will happen we will replace them with {}. I thought about using v4 approach and store 'null' but this doesn't make much sense. |
Sorry, something went wrong.
|
If we change all the values to {}, will pgx v4 still work the same way? We need to ensure any changes are completely backwards compatible |
Sorry, something went wrong.
|
That's tricky. If we want be 100% backward compatible then we should store 'null'. The only incompatibility I could think of is a query that checks exact value or if value is a string and not map. I think our code does not allow such queries but I'm not an expert in this area. @md2119 do we expose any other queries than tested for maps? |
Sorry, something went wrong.
We pretty much have to be backwards compatible in the event of a rollback from 4.2 to 4.1. Greatly increases the amount of testing required to verify that we can make this change. |
Sorry, something went wrong.
|
@connorgorman @dashrews78 I added test for this behaviour and changed from {} to 'null' |
Sorry, something went wrong.
|
/retest |
Sorry, something went wrong.
There was a problem hiding this comment.
please ensure value array construction consistency across insertInto and copyFrom
Sorry, something went wrong.
| {{- else if eq $field.SQLType "uuid" }} | ||
| pgutils.NilOrUUID({{$field.Getter "obj"}}), | ||
| {{- else if eq $field.DataType "map" }} | ||
| pgutils.EmptyOrMap({{$field.Getter "obj"}}), |
There was a problem hiding this comment.
I think the copyFrom template needs this change too (at least to be future-proof).
Maybe the {{- range $field := $schema.DBColumnFields -}} ... {{- end }} pattern could be extracted into another template.
Sorry, something went wrong.
There was a problem hiding this comment.
oh, good point. I'll try to add a test for it too
Sorry, something went wrong.
There was a problem hiding this comment.
Sorry, something went wrong.
|
/retest |
Sorry, something went wrong.
|
/retest |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
## Description Fixes: - #6929 (comment) ## Checklist - [ ] Investigated and inspected CI test results - [ ] Unit test and regression tests added - [ ] Evaluated and added CHANGELOG entry if required - [ ] Determined and documented upgrade steps - [ ] Documented user facing changes (create PR based on [openshift/openshift-docs](https://github.com/openshift/openshift-docs) and merge into [rhacs-docs](https://github.com/openshift/openshift-docs/tree/rhacs-docs)) If any of these don't apply, please comment below. ## Testing Performed CI
| Back | FazBrowse Home | New Git URL |
Description
Currently we store nil map as 'null' (string). In next version of pgx the semantic has changed and it will be stored as null.
This PR seal this behaviour and whenever we would like to store nil map it will be replaced with {} (empty but not nil map).
TestIndex/TestMapHighlights/key_does_not_exist shows the difference between having 'null' and null in JSON field and null always returns false so negative queries will not work correctly.
Checklist
If any of these don't apply, please comment below.
Testing Performed
CI