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

Bulk insert with random column list #1992

Merged

Conversation

balazstbb
Copy link
Contributor

@balazstbb balazstbb commented Dec 7, 2022

The usage of useBulkCopyForBatchInsert=true connection parameter leads to invalid batch inserts.

Requirements of the problem:

  • useBulkCopyForBatchInsert connection parameter value is true
  • the statement and the data types are compatible with the useBulkCopyForBatchInsert requirements known-limitations
  • the columns provided in the insert in a different order then defined in the table schema

This PR contains a JUnit test
com.microsoft.sqlserver.jdbc.preparedStatement.BatchExecutionWithBulkCopyTest.testReverseColumnOrder()
that can be used to reproduce the problem.

This fix takes the column list order make sure the right values picked for the columns.

Issue: #1993

@balazstbb
Copy link
Contributor Author

@microsoft-github-policy-service agree

@lilgreenbird
Copy link
Member

/azp run CI-MacOS

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@lilgreenbird
Copy link
Member

/azp run CI-MacOS

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@tkyc
Copy link
Member

tkyc commented Dec 8, 2022

We'll take a look at the PR after we complete our hotfix releases. Thanks for the contribution.

@lilgreenbird lilgreenbird added this to In progress in MSSQL JDBC via automation Dec 21, 2022
@lilgreenbird lilgreenbird moved this from In progress to Under Investigation in MSSQL JDBC Dec 21, 2022
@lilgreenbird lilgreenbird self-requested a review February 16, 2023 00:16
@lilgreenbird lilgreenbird moved this from Under Investigation to Under Peer Review in MSSQL JDBC Feb 16, 2023
@lilgreenbird lilgreenbird added the Enhancement An enhancement to the driver. Lower priority than bugs. label Feb 16, 2023
@lilgreenbird lilgreenbird added this to the 12.3.0 milestone Feb 16, 2023
tkyc and others added 2 commits March 3, 2023 12:34
…atchExecutionWithBulkCopyTest.java

Co-authored-by: Jeffery Wasty <v-jeffwasty@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement An enhancement to the driver. Lower priority than bugs.
Projects
MSSQL JDBC
  
Closed/Merged PRs
Development

Successfully merging this pull request may close these issues.

None yet

4 participants