Support suffixes containing space in the changelog state DB.
ReplicationDbEnvTest.java:
Added one test case.
ReplicationDbEnv.java:
Fixed the code.
| | |
| | | |
| | | if (debugEnabled()) |
| | | { |
| | | debug("read (key, value)=(" + stringKey + ", " + stringData + ")"); |
| | | debug("read (key, data)=(" + stringKey + ", " + stringData + ")"); |
| | | } |
| | | |
| | | final String[] str = stringData.split(FIELD_SEPARATOR, 3); |
| | | if (str[0].equals(GENERATION_ID_TAG)) |
| | | final String prefix = stringKey.split(FIELD_SEPARATOR)[0]; |
| | | if (prefix.equals(GENERATION_ID_TAG)) |
| | | { |
| | | final String[] str = stringData.split(FIELD_SEPARATOR, 3); |
| | | final long generationId = toLong(str[1]); |
| | | final DN baseDN = DN.decode(str[2]); |
| | | if (debugEnabled()) |
| | |
| | | } |
| | | else |
| | | { |
| | | final String[] str = stringData.split(FIELD_SEPARATOR, 2); |
| | | final int serverId = toInt(str[0]); |
| | | final DN baseDN = DN.decode(str[1]); |
| | | if (debugEnabled()) |
| | |
| | | return new Object[][] { |
| | | { DN.decode("dc=example,dc=com"), 524157415, asList(42, 346) }, |
| | | // test with a space in the baseDN (space is the field separator in the DB) |
| | | // FIXME does not work yet (gosh!!) |
| | | // { DN.decode("cn=admin data"), 524157415, asList(42, 346) }, |
| | | { DN.decode("cn=admin data"), 524157415, asList(42, 346) }, |
| | | }; |
| | | } |
| | | |