nizhikov commented on code in PR #11492:
URL: https://github.com/apache/ignite/pull/11492#discussion_r1751800183
##########
modules/clients/src/test/java/org/apache/ignite/jdbc/thin/JdbcThinPreparedStatementSelfTest.java:
##########
@@ -854,6 +858,90 @@ public void testArray() throws Exception {
assert cnt == 1;
}
+ /**
+ * @throws Exception If failed.
+ */
+ @Test
+ public void testBlob() throws Exception {
+ stmt = conn.prepareStatement(SQL_PART + " where blobVal is not
distinct from ?");
+
+ Blob blob = conn.createBlob();
+
+ blob.setBytes(1, new byte[] {1});
+
+ stmt.setBlob(1, blob);
+
+ ResultSet rs = stmt.executeQuery();
+
+ int cnt = 0;
+
+ while (rs.next()) {
+ if (cnt == 0)
+ assert rs.getInt("id") == 1;
+
+ cnt++;
+ }
+
+ assertEquals(1, cnt);
+
+ stmt.setNull(1, BLOB);
+
+ rs = stmt.executeQuery();
+
+ cnt = 0;
+
+ while (rs.next()) {
+ if (cnt == 0)
+ assert rs.getInt("id") == 2;
+
+ cnt++;
+ }
+
+ assert cnt == 1;
+ }
+
+ /**
+ * @throws Exception If failed.
+ */
+ @Test
+ public void testClob() throws Exception {
+ stmt = conn.prepareStatement(SQL_PART + " where clobVal is not
distinct from ?");
+
+ Clob clob = conn.createClob();
+
+ clob.setString(1, "large str");
+
+ stmt.setClob(1, clob);
+
+ ResultSet rs = stmt.executeQuery();
+
+ int cnt = 0;
+
+ while (rs.next()) {
+ if (cnt == 0)
+ assert rs.getInt("id") == 1;
+
+ cnt++;
+ }
+
+ assertEquals(1, cnt);
+
+ stmt.setNull(1, CLOB);
+
+ rs = stmt.executeQuery();
+
+ cnt = 0;
+
+ while (rs.next()) {
+ if (cnt == 0)
+ assert rs.getInt("id") == 2;
+
+ cnt++;
+ }
+
+ assert cnt == 1;
Review Comment:
```suggestion
assertTrue(rs.next());
assertEquals(2, rs.getInt("id");
assertFalse(rs.next());
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]