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

Add test for large BLOB with parameter #178

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

illuusio
Copy link
Contributor

@illuusio illuusio commented Feb 7, 2023

Add test for large binary BLOB inserting with prepared statement and large Gzip binary as parameter.

@Grinnz
Copy link
Contributor

Grinnz commented Feb 7, 2023

As noted in #179 the correct application behavior is to bind the parameter as binary when inserting it.

@illuusio
Copy link
Contributor Author

illuusio commented Feb 8, 2023

Ok now using correct bind_param in test and it fixes things 👯. Rebased also wrong commit away

@illuusio illuusio force-pushed the add-large-blob-test branch 2 times, most recently from 988c6c1 to cec23c1 Compare February 9, 2023 14:39
@pali
Copy link
Member

pali commented Feb 10, 2023

Hello! I would like to ask what you motivated to write this test without any code change? Have you triggered some issue in the driver code? Or is there some known bug related to LONGBLOB type?

About test itself, I do not like two things: Usage of rand() and dropping table at the beginning of the test. Test should be deterministic, not random because it would be harder to debug it if it fails only sometimes. And instead of dropping table at the beginning of the test you can use temporary table which is visible only for the current $dbh connection, and is automatically dropped after closing it.

Anyway, repository now contains new Github Actions CI which run tests from the every pull request against lot of different client and server versions. So after rebasing your PR on top of the master branch, github runs these new tests automatically.

@pali
Copy link
Member

pali commented Feb 10, 2023

Btw, when you are adding usage of a new module in test as hard dependency then it is needed to specify that module in TEST_REQUIRES section in Makefile.PL.

@illuusio
Copy link
Contributor Author

Should this be closed altogether as this was just me who was thinking that it could be nice to have this kind of test. As I faced this when testing Perl CHI DBI driver and it didn't work with MariaDB but it worked just fine with MySQL, Postgres and SQLite. As said this just RTFM like people like who don't read Pod/Man pages.

@pali
Copy link
Member

pali commented Mar 4, 2023

I'm not against such test. Just fix issues in the test which I mentioned above.

@illuusio
Copy link
Contributor Author

Ok i've updated this test but have to solve max_allowed_packet problem on older systems

@pali
Copy link
Member

pali commented Aug 26, 2023

@illuusio could you fix test to pass CI?

@illuusio
Copy link
Contributor Author

Sorry this dropped out of my scope for other things but let's see if 512 KB is small enough to make old MySQL and MariaDB happy. I've also rebased branch.

t/40blobslarge.t Outdated Show resolved Hide resolved
Add test for large binary using MariaDB LARGEBLOB
column type with size of 1 M test binary.
After inserting make sure it can be fetched from
database and it's not altered.

As mentioned in Pod documentation test uses
bind_param as normal excute will not handle
binary blobs correctly
@pali
Copy link
Member

pali commented Sep 27, 2023

@choroba any other comments?

@choroba
Copy link
Member

choroba commented Sep 27, 2023

No more comments 🙂

@pali pali merged commit 5096566 into perl5-dbi:master Sep 27, 2023
206 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants