Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/pr/128' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Dec 20, 2018
2 parents 1c604d1 + e18e035 commit c742e2b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/org/mariadb/jdbc/MariaDbClob.java
Expand Up @@ -250,6 +250,7 @@ public long length() {
} else if (byteValue < 0xF0) {
i += 3;
} else if (byteValue < 0xF8) {
len++;
i += 4;
} else {
throw new UncheckedIOException("invalid UTF8", new CharacterCodingException());
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/org/mariadb/jdbc/MariaDbClobTest.java
Expand Up @@ -19,7 +19,7 @@ public class MariaDbClobTest {
@Test
public void length() {
MariaDbClob clob = new MariaDbClob(bytes);
assertEquals(9, clob.length());
assertEquals(10, clob.length());

MariaDbClob clob2 = new MariaDbClob(bytes, 2, 3);
assertEquals(3, clob2.length());
Expand All @@ -30,6 +30,7 @@ public void getSubString() throws SQLException {
MariaDbClob clob = new MariaDbClob(bytes);
assertEquals("abcde🙏", clob.getSubString(1, 7));
assertEquals("abcde🙏fgh", clob.getSubString(1, 20));
assertEquals("abcde🙏fgh", clob.getSubString(1, (int) clob.length()));
assertEquals("ab", clob.getSubString(1, 2));
assertEquals("🙏", clob.getSubString(6, 2));

Expand Down

0 comments on commit c742e2b

Please sign in to comment.