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

cs_convert, dbconvert: Truncate data as needed. #573

Closed
wants to merge 1 commit into from

Conversation

ucko
Copy link
Contributor

@ucko ucko commented May 30, 2024

  • Automatically truncate strings that would overflow their destinations, mainly for the sake of bulk insertions.
  • Fully honor *BINARY and IMAGE data buffer size limits in cs_convert.
  • Update unit tests (ctlib cs_convert, dblib t0019) accordingly.

Split from #555.

* Automatically truncate strings that would overflow their destinations,
  mainly for the sake of bulk insertions.
* Fully honor *BINARY and IMAGE data buffer size limits in cs_convert.
* Update unit tests (ctlib cs_convert, dblib t0019) accordingly.

Signed-off-by: Aaron M. Ucko <[email protected]>
Comment on lines -299 to +300
CS_CHAR test2[] = "ab", CS_CHAR_TYPE, test, 3, CS_CHAR_TYPE, 2, CS_FAIL, test2, 2);
CS_CHAR test2[] = "ab", CS_CHAR_TYPE, test, 3, CS_CHAR_TYPE, 2,
CS_SUCCEED /* CS_FAIL */, test2, 2);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think these tests are checked against proprietary libraries. That is you are introducing a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, yeah, looks like such truncation should occur only in the context of bulk insertion (where it does happen with proprietary libraries).

@ucko
Copy link
Contributor Author

ucko commented Jun 18, 2024

Withdrawn in favor of a (planned) extension to #558.

@ucko ucko closed this Jun 18, 2024
@ucko
Copy link
Contributor Author

ucko commented Jul 3, 2024

This extension wound up with only ctlib changes; I split the dblib changes off to #595.

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.

2 participants