[#2534] Correctly handle Oracle BLOB and CLOB data types, when fetched
through plain SQL - Added failing integration test
This commit is contained in:
parent
5bfd3c62ab
commit
753d5f367d
@ -596,4 +596,26 @@ extends BaseTest<A, AP, B, S, B2S, BS, L, X, DATE, BOOL, D, T, U, UU, I, IPK, T7
|
||||
assertEquals("Baz", create.configuration().data("Foo-Field"));
|
||||
assertEquals("Baz", create.configuration().data("Foo-Condition"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPlainSQLBlobAndClob() throws Exception {
|
||||
jOOQAbstractTest.reset = false;
|
||||
|
||||
create().update(TBook())
|
||||
.set(TBook_CONTENT_TEXT(), "text")
|
||||
.set(TBook_CONTENT_PDF(), "pdf".getBytes("UTF-8"))
|
||||
.where(TBook_ID().eq(1))
|
||||
.execute();
|
||||
|
||||
Record r1 = create().fetchOne("select content_text, content_pdf from t_book where id = 1");
|
||||
assertEquals("text", r1.getValue(0));
|
||||
assertEquals("pdf", new String((byte[]) r1.getValue(1), "UTF-8"));
|
||||
|
||||
Record r2 = create().select(field("content_text"), field("content_pdf"))
|
||||
.from("t_book")
|
||||
.where("id = 1")
|
||||
.fetchOne();
|
||||
assertEquals("text", r2.getValue(0));
|
||||
assertEquals("pdf", new String((byte[]) r2.getValue(1), "UTF-8"));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1139,6 +1139,11 @@ public abstract class jOOQAbstractTest<
|
||||
new PlainSQLTests(this).testPlainSQLResultQuery();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testPlainSQLBlobAndClob() throws Exception {
|
||||
new PlainSQLTests(this).testPlainSQLBlobAndClob();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testCustomSQL() throws Exception {
|
||||
new PlainSQLTests(this).testCustomSQL();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user