New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Postgres Malformed array literal 2.4.0 Regression #5439
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
capaj
approved these changes
Jan 17, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @loren138
kibertoad
approved these changes
Jan 17, 2023
Cruikshanks
added a commit
to DEFRA/water-abstraction-system
that referenced
this pull request
Jan 19, 2023
A recent change and test appear to be failing the build after this update to Knex. Checking the Knex changelog we found this - [Bug fix: PostgreSQL: Fix Malformed array literal 2.4.0 Regression #5439](https://github.com/knex/knex/blob/master/CHANGELOG.md#241---18-january-2022) 'Array' you say!? [The PR](knex/knex#5439) links to various issues which all seem to have JSONB and arrays as primary concerns. TBH, we don't have the time to properly dig into why it worked before but now doesn't. But as this was a fix to a regression the behaviour is unlikely to change in Knex so we need to code for it. This change resolves the issue for us. Looking in the DB the column is back to holding an empty array (without the fix Knex's change made it an empty JSON object) which matches what the legacy system is doing.
Cruikshanks
added a commit
to DEFRA/water-abstraction-system
that referenced
this pull request
Jan 19, 2023
* Bump knex from 2.4.0 to 2.4.1 Bumps [knex](https://github.com/knex/knex) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/knex/knex/releases) - [Changelog](https://github.com/knex/knex/blob/master/CHANGELOG.md) - [Commits](https://github.com/knex/knex/commits) --- updated-dependencies: - dependency-name: knex dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> * Fix service following Knex update A recent change and test appear to be failing the build after this update to Knex. Checking the Knex changelog we found this - [Bug fix: PostgreSQL: Fix Malformed array literal 2.4.0 Regression #5439](https://github.com/knex/knex/blob/master/CHANGELOG.md#241---18-january-2022) 'Array' you say!? [The PR](knex/knex#5439) links to various issues which all seem to have JSONB and arrays as primary concerns. TBH, we don't have the time to properly dig into why it worked before but now doesn't. But as this was a fix to a regression the behaviour is unlikely to change in Knex so we need to code for it. This change resolves the issue for us. Looking in the DB the column is back to holding an empty array (without the fix Knex's change made it an empty JSON object) which matches what the legacy system is doing. Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Alan Cruikshanks <alan.cruikshanks@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reverts #5321
Fix #5365
Fix #5430
Adds new test, which I confirmed fails without the changes to
lib/client.js