Skip to content

Commit

Permalink
update to 0.9.56
Browse files Browse the repository at this point in the history
  • Loading branch information
bersler committed Nov 24, 2022
1 parent a65fe37 commit 47f0b1a
Show file tree
Hide file tree
Showing 31 changed files with 106 additions and 99 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
0.9.56
- bug fixes

0.9.55
- experimental lob 12.1+ fixes
- fixed bugs related to schema & checkpoints
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(OpenLogReplicator VERSION 0.9.55)
project(OpenLogReplicator VERSION 0.9.56)

set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(CMAKE_CXX_STANDARD 17)
Expand Down
6 changes: 5 additions & 1 deletion src/builder/Builder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,16 @@ namespace OpenLogReplicator {
columnRaw(columnName, data, length);
return;
}
if (table == nullptr || FLAG(REDO_FLAGS_RAW_COLUMN_DATA)) {
if (table == nullptr) {
std::string columnName("COL_" + std::to_string(col));
columnRaw(columnName, data, length);
return;
}
OracleColumn* column = table->columns[col];
if (FLAG(REDO_FLAGS_RAW_COLUMN_DATA)) {
columnRaw(column->name, data, length);
return;
}
if (column->constraint && !FLAG(REDO_FLAGS_SHOW_CONSTRAINT_COLUMNS))
return;
if (column->nested && !FLAG(REDO_FLAGS_SHOW_NESTED_COLUMNS))
Expand Down
9 changes: 4 additions & 5 deletions src/builder/Builder.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,11 +172,10 @@ namespace OpenLogReplicator {
uint64_t base = static_cast<uint64_t>(column) >> 6;
uint64_t mask = static_cast<uint64_t>(1) << (column & 0x3F);
// New value
if ((valuesSet[base] & mask) == 0) {
if ((valuesSet[base] & mask) == 0)
valuesSet[base] |= mask;
if (column >= valuesMax)
valuesMax = column + 1;
}
if (column >= valuesMax)
valuesMax = column + 1;

switch (fb & (FB_P | FB_N)) {
case 0:
Expand Down Expand Up @@ -757,7 +756,7 @@ namespace OpenLogReplicator {
uint64_t unicodeCharacterLength;

if ((charFormat & CHAR_FORMAT_NOMAPPING) == 0) {
unicodeCharacter = characterSet->decode(data, length);
unicodeCharacter = characterSet->decode(lastXid, data, length);
unicodeCharacterLength = 8;
} else {
unicodeCharacter = *data++;
Expand Down
24 changes: 12 additions & 12 deletions src/locales/CharacterSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,48 +28,48 @@ namespace OpenLogReplicator {

CharacterSet::~CharacterSet() = default;

uint64_t CharacterSet::badChar(uint64_t byte1) const {
ERROR("can't decode character: 0x" << std::setfill('0') << std::setw(2) << std::hex << byte1 << " in character set " << name)
uint64_t CharacterSet::badChar(typeXid xid, uint64_t byte1) const {
ERROR("can't decode character: 0x" << std::setfill('0') << std::setw(2) << std::hex << byte1 << " in character set " << name << " xid: " << xid)
return UNICODE_UNKNOWN_CHARACTER;
}

uint64_t CharacterSet::badChar(uint64_t byte1, uint64_t byte2) const {
uint64_t CharacterSet::badChar(typeXid xid, uint64_t byte1, uint64_t byte2) const {
ERROR("can't decode character: 0x" << std::setfill('0') << std::setw(2) << std::hex << byte1 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte2 << " in character set " << name)
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte2 << " in character set " << name << " xid: " << xid)
return UNICODE_UNKNOWN_CHARACTER;
}

uint64_t CharacterSet::badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3) const {
uint64_t CharacterSet::badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3) const {
ERROR("can't decode character: 0x" << std::setfill('0') << std::setw(2) << std::hex << byte1 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte2 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte3 << " in character set " << name)
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte3 << " in character set " << name << " xid: " << xid)
return UNICODE_UNKNOWN_CHARACTER;
}

uint64_t CharacterSet::badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4) const {
uint64_t CharacterSet::badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4) const {
ERROR("can't decode character: 0x" << std::setfill('0') << std::setw(2) << std::hex << byte1 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte2 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte3 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte4 << " in character set " << name)
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte4 << " in character set " << name << " xid: " << xid)
return UNICODE_UNKNOWN_CHARACTER;
}

uint64_t CharacterSet::badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5) const {
uint64_t CharacterSet::badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5) const {
ERROR("can't decode character: 0x" << std::setfill('0') << std::setw(2) << std::hex << byte1 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte2 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte3 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte4 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte5 << " in character set " << name);
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte5 << " in character set " << name << " xid: " << xid);
return UNICODE_UNKNOWN_CHARACTER;
}

uint64_t CharacterSet::badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5, uint64_t byte6) const {
uint64_t CharacterSet::badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5, uint64_t byte6) const {
ERROR("can't decode character: 0x" << std::setfill('0') << std::setw(2) << std::hex << byte1 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte2 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte3 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte4 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte5 <<
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte6 << " in character set " << name)
",0x" << std::setfill('0') << std::setw(2) << std::hex << byte6 << " in character set " << name << " xid: " << xid)
return UNICODE_UNKNOWN_CHARACTER;
}
}
15 changes: 8 additions & 7 deletions src/locales/CharacterSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ along with OpenLogReplicator; see the file LICENSE; If not see
<http://www.gnu.org/licenses/>. */

#include "../common/types.h"
#include "../common/typeXid.h"

#ifndef CHARACTER_SET_H_
#define CHARACTER_SET_H_
Expand All @@ -27,20 +28,20 @@ along with OpenLogReplicator; see the file LICENSE; If not see
namespace OpenLogReplicator {
class CharacterSet {
protected:
[[nodiscard]] uint64_t badChar(uint64_t byte1) const;
[[nodiscard]] uint64_t badChar(uint64_t byte1, uint64_t byte2) const;
[[nodiscard]] uint64_t badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3) const;
[[nodiscard]] uint64_t badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4) const;
[[nodiscard]] uint64_t badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5) const;
[[nodiscard]] uint64_t badChar(uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5, uint64_t byte6) const;
[[nodiscard]] uint64_t badChar(typeXid xid, uint64_t byte1) const;
[[nodiscard]] uint64_t badChar(typeXid xid, uint64_t byte1, uint64_t byte2) const;
[[nodiscard]] uint64_t badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3) const;
[[nodiscard]] uint64_t badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4) const;
[[nodiscard]] uint64_t badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5) const;
[[nodiscard]] uint64_t badChar(typeXid xid, uint64_t byte1, uint64_t byte2, uint64_t byte3, uint64_t byte4, uint64_t byte5, uint64_t byte6) const;

public:
const char* name;

explicit CharacterSet(const char* newName);
virtual ~CharacterSet();

virtual uint64_t decode(const uint8_t*& str, uint64_t& length) const = 0;
virtual uint64_t decode(typeXid xid, const uint8_t*& str, uint64_t& length) const = 0;
};
}

Expand Down
6 changes: 3 additions & 3 deletions src/locales/CharacterSet16bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ namespace OpenLogReplicator {

CharacterSet16bit::~CharacterSet16bit() = default;

typeUnicode CharacterSet16bit::decode(const uint8_t*& str, uint64_t& length) const {
typeUnicode CharacterSet16bit::decode(typeXid xid, const uint8_t*& str, uint64_t& length) const {
uint64_t byte1 = *str++;
--length;
if (byte1 <= 0x7F)
return byte1;

if (length == 0)
return badChar(byte1);
return badChar(xid, byte1);

uint64_t byte2 = *str++;
--length;

if (byte1 < byte1min || byte1 > byte1max || byte2 < byte2min || byte2 > byte2max)
return badChar(byte1, byte2);
return badChar(xid, byte1, byte2);

return readMap(byte1, byte2);
}
Expand Down
2 changes: 1 addition & 1 deletion src/locales/CharacterSet16bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace OpenLogReplicator {
uint64_t newByte2max);
~CharacterSet16bit() override;

typeUnicode decode(const uint8_t*& str, uint64_t& length) const override;
typeUnicode decode(typeXid xid, const uint8_t*& str, uint64_t& length) const override;

static typeUnicode16 unicode_map_JA16VMS[(JA16VMS_b1_max - JA16VMS_b1_min + 1) *
(JA16VMS_b2_max - JA16VMS_b2_min + 1)];
Expand Down
2 changes: 1 addition & 1 deletion src/locales/CharacterSet7bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace OpenLogReplicator {

CharacterSet7bit::~CharacterSet7bit() = default;

typeUnicode CharacterSet7bit::decode(const uint8_t*& str, uint64_t& length) const {
typeUnicode CharacterSet7bit::decode(typeXid xid, const uint8_t*& str, uint64_t& length) const {
uint64_t byte1 = *str++;
--length;
return readMap(byte1 & 0x7F);
Expand Down
2 changes: 1 addition & 1 deletion src/locales/CharacterSet7bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace OpenLogReplicator {
CharacterSet7bit(const char* newName, const typeUnicode16* newMap);
~CharacterSet7bit() override;

typeUnicode decode(const uint8_t*& str, uint64_t& length) const override;
typeUnicode decode(typeXid xid, const uint8_t*& str, uint64_t& length) const override;

// Conversion arrays for 7-bit character sets
static typeUnicode16 unicode_map_D7DEC[128];
Expand Down
2 changes: 1 addition & 1 deletion src/locales/CharacterSet8bit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace OpenLogReplicator {

CharacterSet8bit::~CharacterSet8bit() = default;

typeUnicode CharacterSet8bit::decode(const uint8_t*& str, uint64_t& length) const {
typeUnicode CharacterSet8bit::decode(typeXid xid, const uint8_t*& str, uint64_t& length) const {
uint64_t byte1 = *str++;
--length;
return readMap(byte1);
Expand Down
2 changes: 1 addition & 1 deletion src/locales/CharacterSet8bit.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace OpenLogReplicator {
CharacterSet8bit(const char* newName, const typeUnicode16* newMap, bool newCustomAscii);
~CharacterSet8bit() override;

typeUnicode decode(const uint8_t*& str, uint64_t& length) const override;
typeUnicode decode(typeXid xid, const uint8_t*& str, uint64_t& length) const override;

static typeUnicode16 unicode_map_AR8ADOS710[128];
static typeUnicode16 unicode_map_AR8ADOS710T[128];
Expand Down
12 changes: 6 additions & 6 deletions src/locales/CharacterSetAL16UTF16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,30 @@ namespace OpenLogReplicator {

CharacterSetAL16UTF16::~CharacterSetAL16UTF16() = default;

typeUnicode CharacterSetAL16UTF16::decode(const uint8_t*& str, uint64_t& length) const {
typeUnicode CharacterSetAL16UTF16::decode(typeXid xid, const uint8_t*& str, uint64_t& length) const {
uint64_t byte1 = *str++;
--length;

if (length == 0)
return badChar(byte1);
return badChar(xid, byte1);

uint64_t byte2 = *str++;
--length;

if ((byte1 & 0xFC) == 0xDC)
return badChar(byte1, byte2);
return badChar(xid, byte1, byte2);

if ((byte1 & 0xFC) != 0xD8)
return (byte1 << 8) | byte2;

if (length == 0)
return badChar(byte1, byte2);
return badChar(xid, byte1, byte2);

uint64_t byte3 = *str++;
--length;

if (length == 0)
return badChar(byte1, byte2, byte3);
return badChar(xid, byte1, byte2, byte3);

uint64_t byte4 = *str++;
--length;
Expand All @@ -61,6 +61,6 @@ namespace OpenLogReplicator {
if ((byte3 & 0xFC) == 0xDC) {
return 0x10000 + (((byte1 & 0x03) << 18) | (byte2 << 10) | ((byte3 & 0x03) << 8) | byte4);
} else
return badChar(byte1, byte2, byte3, byte4);
return badChar(xid, byte1, byte2, byte3, byte4);
}
}
2 changes: 1 addition & 1 deletion src/locales/CharacterSetAL16UTF16.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace OpenLogReplicator {
CharacterSetAL16UTF16();
~CharacterSetAL16UTF16() override;

typeUnicode decode(const uint8_t*& str, uint64_t& length) const override;
typeUnicode decode(typeXid xid, const uint8_t*& str, uint64_t& length) const override;
};
}

Expand Down
16 changes: 8 additions & 8 deletions src/locales/CharacterSetAL32UTF8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace OpenLogReplicator {

CharacterSetAL32UTF8::~CharacterSetAL32UTF8() = default;

typeUnicode CharacterSetAL32UTF8::decode(const uint8_t*& str, uint64_t& length) const {
typeUnicode CharacterSetAL32UTF8::decode(typeXid xid, const uint8_t*& str, uint64_t& length) const {
uint64_t byte1 = *str++;
--length;

Expand All @@ -35,39 +35,39 @@ namespace OpenLogReplicator {
return byte1;

if (length == 0)
return badChar(byte1);
return badChar(xid, byte1);

uint64_t byte2 = *str++;
--length;

if ((byte2 & 0xC0) != 0x80)
return badChar(byte1, byte2);
return badChar(xid, byte1, byte2);

// 110xxxxx 10xxxxxx
if ((byte1 & 0xE0) == 0xC0)
return ((byte1 & 0x1F) << 6) | (byte2 & 0x3F);

if (length == 0)
return badChar(byte1, byte2);
return badChar(xid, byte1, byte2);

uint64_t byte3 = *str++;
--length;

if ((byte3 & 0xC0) != 0x80)
return badChar(byte1, byte2, byte3);
return badChar(xid, byte1, byte2, byte3);

// 1110xxxx 10xxxxxx 10xxxxxx
if ((byte1 & 0xF0) == 0xE0)
return ((byte1 & 0x0F) << 12) | ((byte2 & 0x3F) << 6) | (byte3 & 0x3F);

if (length == 0)
return badChar(byte1, byte2, byte3);
return badChar(xid, byte1, byte2, byte3);

uint64_t byte4 = *str++;
--length;

if ((byte4 & 0xC0) != 0x80)
return badChar(byte1, byte2, byte3, byte4);
return badChar(xid, byte1, byte2, byte3, byte4);

// 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
if ((byte1 & 0xF8) == 0xF0) {
Expand All @@ -76,6 +76,6 @@ namespace OpenLogReplicator {
return character;
}

return badChar(byte1, byte2, byte3, byte4);
return badChar(xid, byte1, byte2, byte3, byte4);
}
}
2 changes: 1 addition & 1 deletion src/locales/CharacterSetAL32UTF8.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace OpenLogReplicator {
CharacterSetAL32UTF8();
~CharacterSetAL32UTF8() override;

typeUnicode decode(const uint8_t*& str, uint64_t& length) const override;
typeUnicode decode(typeXid xid, const uint8_t*& str, uint64_t& length) const override;
};
}

Expand Down
10 changes: 5 additions & 5 deletions src/locales/CharacterSetJA16EUC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,35 +30,35 @@ namespace OpenLogReplicator {

CharacterSetJA16EUC::~CharacterSetJA16EUC() = default;

uint64_t CharacterSetJA16EUC::decode(const uint8_t*& str, uint64_t& length) const {
uint64_t CharacterSetJA16EUC::decode(typeXid xid, const uint8_t*& str, uint64_t& length) const {
uint64_t byte1 = *str++;
--length;
if (byte1 <= 0x7F)
return byte1;

if (length == 0)
return badChar(byte1);
return badChar(xid, byte1);

uint64_t byte2 = *str++;
--length;

// 3 bytes sequence
if (byte1 == 0x8F) {
if (length == 0)
return badChar(byte1, byte2);
return badChar(xid, byte1, byte2);

uint64_t byte3 = *str++;
--length;

if (byte2 < JA16EUC_b2_min || byte2 > JA16EUC_b2_max || byte3 < JA16EUC_b3_min || byte3 > JA16EUC_b3_max)
return badChar(byte1, byte2, byte3);
return badChar(xid, byte1, byte2, byte3);

return readMap3(byte2, byte3);
}

// 2 bytes sequence
if (byte1 < JA16EUC_b1_min || byte1 > JA16EUC_b1_max || byte2 < JA16EUC_b2_min || byte2 > JA16EUC_b2_max || !validCode(byte1, byte2))
return badChar(byte1, byte2);
return badChar(xid, byte1, byte2);

return readMap2(byte1, byte2);
}
Expand Down
2 changes: 1 addition & 1 deletion src/locales/CharacterSetJA16EUC.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ namespace OpenLogReplicator {
explicit CharacterSetJA16EUC(const char* newName);
~CharacterSetJA16EUC() override;

typeUnicode decode(const uint8_t*& str, uint64_t& length) const override;
typeUnicode decode(typeXid xid, const uint8_t*& str, uint64_t& length) const override;
};
}

Expand Down
Loading

0 comments on commit 47f0b1a

Please sign in to comment.