Skip to content
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

Use the method setBlob to insert blob data #605

Merged
merged 2 commits into from
Jun 8, 2022

Conversation

xjodoin
Copy link
Contributor

@xjodoin xjodoin commented Sep 16, 2016

On postgresql if you use setBinaryStream the field must be of type bytea but a blob type is oid (ref pull request #600). Instead you must use setBlob method to be able to insert or update data with valueBlobFile

@candrews
Copy link
Contributor

candrews commented Nov 7, 2016

Reported https://liquibase.jira.com/browse/CORE-2937 for this issue.

@candrews
Copy link
Contributor

@nvoxland can you please take a look at this PR?

@xjodoin
Copy link
Contributor Author

xjodoin commented Mar 23, 2018

rebase the pull request on master

@Alemorato
Copy link

any change to be merged?

@xjodoin
Copy link
Contributor Author

xjodoin commented May 23, 2018

the issue still open https://liquibase.jira.com/browse/CORE-2937

@Alemorato
Copy link

we are using these change since a month for our internal builders and it works.

@xjodoin if you provides some unit test maybe the liquibase team could be more encouraged for merge

@nictas
Copy link

nictas commented Jun 25, 2018

Any news on this? We tried adopting version 3.6.1 of Liquibase, but we also encountered the issue mentioned here. We would really appreciate a fix for it.

ThiagoGesser pushed a commit to ThiagoGesser/liquibase that referenced this pull request Oct 10, 2018
Fix for the issue describe in
https://liquibase.jira.com/browse/CORE-2937 using the solution proposed
by liquibase#605.
@xjodoin
Copy link
Contributor Author

xjodoin commented Mar 27, 2019

Is there a reason you don't merge this pull request?

@hypery2k
Copy link

any news on this PR?

@hypery2k
Copy link

@nvoxland Any chance to get this merged?

fxthomas added a commit to fxthomas/airsonic that referenced this pull request Jan 3, 2020
In PostgreSQL, Liquibase maps the `blob` type to an `oid` column by
default[1]. That column type is not supported[2] very well when using
the `valueBlobFile` attribute, which expects a `bytea` column instead.

This was confirmed on all PostgreSQL versions starting from 9.6.

The `validCheckSum` attribute does not need to be updated since it was
already for the previous (binary_type, varchar_type) combination in
an unrelated commit (78a99d5).

Fixes airsonic#1213.

[1] https://liquibase.jira.com/browse/CORE-1863
[2] liquibase/liquibase#605
fxthomas added a commit to fxthomas/airsonic that referenced this pull request Jan 3, 2020
In PostgreSQL, Liquibase maps the `blob` type to an `oid` column by
default[1]. That column type is not supported[2] very well when using
the `valueBlobFile` attribute, which expects a `bytea` column instead.

This was confirmed on all PostgreSQL versions starting from 9.6.

The `validCheckSum` attribute does not need to be updated since it was
already for the previous (binary_type, varchar_type) combination in
an unrelated commit (78a99d5).

Fixes airsonic#1213.

[1] https://liquibase.jira.com/browse/CORE-1863
[2] liquibase/liquibase#605
fxthomas added a commit to fxthomas/airsonic that referenced this pull request Jan 4, 2020
In PostgreSQL, Liquibase maps the `blob` type to an `oid` column by
default[1]. That column type is not supported[2] very well when using
the `valueBlobFile` attribute, which expects a `bytea` column instead.

This was confirmed on all PostgreSQL versions starting from 9.6.

The `validCheckSum` attribute does not need to be updated since it was
already for the previous (binary_type, varchar_type) combination in
an unrelated commit (78a99d5).

Fixes airsonic#1213.

[1] https://liquibase.jira.com/browse/CORE-1863
[2] liquibase/liquibase#605
@datical-jenkins datical-jenkins changed the title Use the method setBlob to insert blob data LB-104 ⁃ Use the method setBlob to insert blob data Mar 4, 2020
@datical-jenkins datical-jenkins changed the title LB-104 ⁃ Use the method setBlob to insert blob data Use the method setBlob to insert blob data Mar 5, 2020
tesshucom pushed a commit to file-struct/jpsonic that referenced this pull request Apr 6, 2020
In PostgreSQL, Liquibase maps the `blob` type to an `oid` column by
default[1]. That column type is not supported[2] very well when using
the `valueBlobFile` attribute, which expects a `bytea` column instead.

This was confirmed on all PostgreSQL versions starting from 9.6.

The `validCheckSum` attribute does not need to be updated since it was
already for the previous (binary_type, varchar_type) combination in
an unrelated commit (78a99d5).

Fixes tesshucom#1213.

[1] https://liquibase.jira.com/browse/CORE-1863
[2] liquibase/liquibase#605
@siyerlin
Copy link

siyerlin commented May 4, 2020

Any updates on this? We are also encountering this problem. Would it help if we still keep the setBinaryStream as default, and introduce a new column config for the setBlob? Thanks!

@ro-rah
Copy link

ro-rah commented May 13, 2020

Hi @xjodoin

Sorry for the long delay, I am getting this ready for conditioning, it looks pretty straight forward, if you include tests I can size this down. For now I will leave at a Med.

Here is some good info in my typical response to PR submitters:
Thanks for your pull request!

Here’s what happens next:

A member of the Liquibase team will take a look at your contribution and may suggest:

The PR will be prioritized according to our internal development and testing capacity.

We’ll let you know when it’s ready to move to the next step or if any changes are needed.

@liquibot
Copy link
Contributor

liquibot commented Jun 4, 2020

➤ Erzsebet Carmean commented:

Thank you for the response, Nathan!

CC: [~accountid:557058:c8f0b24d-f02f-431c-8842-fd9c929dfbf2]

@nvoxland nvoxland added the SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions label May 28, 2022
@nvoxland nvoxland changed the base branch from master to 1_9 May 28, 2022 04:52
@nvoxland nvoxland changed the base branch from 1_9 to master May 28, 2022 04:52
@github-actions
Copy link

Unit Test Results

  4 512 files  ±0    4 512 suites  ±0   33m 15s ⏱️ +46s
  4 419 tests ±0    4 205 ✔️ +4     214 💤  - 4  0 ±0 
52 308 runs  ±0  47 300 ✔️ +4  5 008 💤  - 4  0 ±0 

Results for commit e29ca27. ± Comparison against base commit 4ab687b.

@XDelphiGrl
Copy link
Contributor

@nvoxland, hi! Do we need to worry about the impact of the Java version with this change? I was doing some light reading on Ye Olde Internet and saw this post:

StackoverFlow

I'm trying to figure out if QA should manually test this with different Java versions.

CC @suryaaki

@nvoxland
Copy link
Contributor

nvoxland commented Jun 7, 2022

@XDelphiGrl It wouldn't be a java version thing, but a driver version. Like from the post, postgresql's 9.4 driver didn't work with setBlob. But that has since been fixed, as we see in the automated testing for this ticket. It won't matter the java version we use, but we do run those automated tests with java 8 and they pass.

Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix is targeted to managing LOB content in the applyColumnParameter method.
  • No additional testing required.

APPROVED

Passing Test Harness Run
Functional Test Results
Note Functional test failures are for the quality checks feature and unrelated to this change.

@xjodoin
Copy link
Contributor Author

xjodoin commented Jun 7, 2022

Thanks @XDelphiGrl to approved my pull request

@kataggart kataggart added this to the NEXT milestone Jun 7, 2022
@XDelphiGrl
Copy link
Contributor

Thanks @XDelphiGrl to approved my pull request

Thank you, @xjodoin, for the PR. I hope you have a lovely day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autocandidate DBPostgres RiskLow Trivial changes in spelling, documentation changes, focused bug fixes, etc. SafeToBuild Indicates that a particular PR contains changes which are safe to build using GitHub actions
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet