jbogard/Respawn

Oracle error while creating respawner when include table with schema name

Closed this issue · 0 comments

I run into an issue when setting up respawn for some Oracle database tests.

Example setting up TablesToInclude:

var respawner = await Respawner.CreateAsync(oracleConnection, new RespawnerOptions
{
    DbAdapter = DbAdapter.Oracle,
    TablesToInclude = new[] { new Table("userA", "foo") }
});

would throw error:

Oracle.ManagedDataAccess.Client.OracleException : ORA-01722: invalid number

Error was due to using + sign instead of || for string concatenation:

// OracleDbAdapter.cs
commandText += " AND OWNER + '.' + TABLE_NAME NOT IN (" + args + ")";
// should be
commandText += " AND OWNER || '.' || TABLE_NAME NOT IN (" + args + ")";

The fix to Oracle adapter should be similar to commit 2dd3c58.

Edit: added pull request.