Aleksei-Litsov commented on a change in pull request #7521: IGNITE-8152 Forbid 
empty sql schema name
URL: https://github.com/apache/ignite/pull/7521#discussion_r393525524
 
 

 ##########
 File path: 
modules/indexing/src/test/java/org/apache/ignite/sqltests/BaseSqlTest.java
 ##########
 @@ -1249,6 +1255,36 @@ public void 
testFullOuterDistributedJoinIsNotSupported() {
         });
     }
 
+    /**
+     * Check schema for validation
+     */
+
+    @Rule
+    public ExpectedException expectedEx = ExpectedException.none();
+
+    @Test
+    public void testCheckEmptySchema() {
+
+        expectedEx.expect(IgniteSQLException.class);
+        expectedEx.expectMessage("Failed to set schema for DB connection. " +
+                "Schema name could not be an empty string"
+        );
+
+        String sqlQuery = "SELECT * FROM Employee limit 1";
+
+        testAllNodes(node -> {
+            executeFrom(sqlQuery, node, "");
+            executeFrom(sqlQuery, node, " ");
+            assertTrue("Check valid schema",
+                    executeFrom(sqlQuery, node, 
"PUBLIC").values().stream().count() > 0
+            );
+            assertTrue("Check null schema",
+                    executeFrom(sqlQuery, node, 
null).values().stream().count() > 0
+            );
+        });
+
 
 Review comment:
   fixed

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to