DBZ-7446 Reduce string creation during SQL_REDO column read
Oracle Connector can create a new string when reading SQL_REDO column only if CSF column value is 1.
This commit is contained in:
parent
d0e4ad7e14
commit
04b8597239
@ -208,21 +208,18 @@ private Scn getScn(ResultSet rs) throws SQLException {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String getSqlRedo(ResultSet rs) throws SQLException {
|
private String getSqlRedo(ResultSet rs) throws SQLException {
|
||||||
String redoSql = rs.getString(SQL_REDO);
|
|
||||||
if (redoSql == null) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
StringBuilder result = new StringBuilder(redoSql);
|
|
||||||
int csf = rs.getInt(CSF);
|
int csf = rs.getInt(CSF);
|
||||||
int operationCode = rs.getInt(OPERATION_CODE);
|
|
||||||
|
|
||||||
// 0 - indicates SQL_REDO is contained within the same row
|
// 0 - indicates SQL_REDO is contained within the same row
|
||||||
|
if (csf == 0) {
|
||||||
|
return rs.getString(SQL_REDO);
|
||||||
|
}
|
||||||
|
int operationCode = rs.getInt(OPERATION_CODE);
|
||||||
|
StringBuilder result = new StringBuilder(rs.getString(SQL_REDO));
|
||||||
|
|
||||||
|
long sqlLimitCounter = 0;
|
||||||
// 1 - indicates that either SQL_REDO is greater than 4000 bytes in size and is continued in
|
// 1 - indicates that either SQL_REDO is greater than 4000 bytes in size and is continued in
|
||||||
// the next row returned by the ResultSet
|
// the next row returned by the ResultSet
|
||||||
long sqlLimitCounter = 0;
|
|
||||||
while (csf == 1) {
|
while (csf == 1) {
|
||||||
|
|
||||||
rs.next();
|
rs.next();
|
||||||
sqlLimitCounter++;
|
sqlLimitCounter++;
|
||||||
|
|
||||||
@ -251,10 +248,9 @@ else if (sqlLimitCounter > Integer.MAX_VALUE) {
|
|||||||
throw new LogMinerEventRowTooLargeException(tableName, sqlLimitCounter * 4000, scn);
|
throw new LogMinerEventRowTooLargeException(tableName, sqlLimitCounter * 4000, scn);
|
||||||
}
|
}
|
||||||
|
|
||||||
redoSql = rs.getString(SQL_REDO);
|
|
||||||
result.append(redoSql);
|
|
||||||
csf = rs.getInt(CSF);
|
csf = rs.getInt(CSF);
|
||||||
operationCode = rs.getInt(OPERATION_CODE);
|
operationCode = rs.getInt(OPERATION_CODE);
|
||||||
|
result.append(rs.getString(SQL_REDO));
|
||||||
}
|
}
|
||||||
|
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user