Skip to content

Fix Oracle bulk insert schema qualification issues#101

Draft
DPschichholz wants to merge 1 commit into
PhenX:mainfrom
DPschichholz:bugfix/fix-oracle-schema
Draft

Fix Oracle bulk insert schema qualification issues#101
DPschichholz wants to merge 1 commit into
PhenX:mainfrom
DPschichholz:bugfix/fix-oracle-schema

Conversation

@DPschichholz
Copy link
Copy Markdown
Contributor

Fix Oracle bulk insert ORA-39831 when EF Core default schema is configured

  • Fix double-schema qualification when EF Core default schema is configured
  • Clarify table name handling comment

Details

When HasDefaultSchema(...) is set, tableInfo.QuotedTableName becomes a SQL-quoted fully qualified identifier (e.g. "SchemaX"."TableA"). Passing this to OracleBulkCopy.DestinationTableName causes ODP.NET to double-apply the schema, producing SchemaX.SchemaX.TableA and failing with ORA-39831.

Change

  • OracleBulkInsertProvider.BulkInsert: compute destinationTableName before assigning to bulkCopy.DestinationTableName:
    • Direct insert path (tableName == tableInfo.QuotedTableName): use tableInfo.TableName (plain unquoted name — ODP.NET resolves the schema itself)
    • Temp table path: use tableName unchanged
var destinationTableName = tableName == tableInfo.QuotedTableName
    ? tableInfo.TableName
    : tableName;

bulkCopy.DestinationTableName = destinationTableName;

@DPschichholz DPschichholz changed the title Fix Oracle bulk insert schema qualification issues (#1) Fix Oracle bulk insert schema qualification issues May 20, 2026
@DPschichholz DPschichholz marked this pull request as ready for review May 20, 2026 13:06
@DPschichholz DPschichholz requested a review from PhenX as a code owner May 20, 2026 13:06
Copy link
Copy Markdown
Owner

@PhenX PhenX left a comment

Choose a reason for hiding this comment

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

It's ok for me, but can you update your branch for the CI to pass ?

- Fix double-schema qualification when EF Core default schema is configured
- Clarify table name handling comment
@DPschichholz DPschichholz force-pushed the bugfix/fix-oracle-schema branch from a3743ef to ba1b5b4 Compare May 21, 2026 07:02
@DPschichholz
Copy link
Copy Markdown
Contributor Author

@PhenX The branch has been rebased

@PhenX
Copy link
Copy Markdown
Owner

PhenX commented May 21, 2026

@DPschichholz thanks, the test fails now, can you check it?

@DPschichholz DPschichholz marked this pull request as draft May 29, 2026 07:42
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