chunweilei commented on a change in pull request #1946:
URL: https://github.com/apache/calcite/pull/1946#discussion_r417033766



##########
File path: 
core/src/test/java/org/apache/calcite/sql/test/SqlOperatorBaseTest.java
##########
@@ -4508,6 +4508,15 @@ private void checkNullOperand(SqlTester tester, String 
op) {
     tester1.checkNull("STRCMP(cast(null as varchar(1)), 'mytesttext')");
   }
 
+  @Test void testInstrFunc() {
+    final SqlTester tester1 = tester(SqlLibrary.MYSQL);
+    tester1.setFor(SqlLibraryOperators.INSTR);
+    tester1.checkString("INSTR('foobarbar', 'bar')", "4", "INTEGER NOT NULL");
+    tester1.checkString("INSTR('bar', 'foobarbar')", "0", "INTEGER NOT NULL");
+    tester1.checkNull("INSTR('foobarbar', cast(null as varchar(1)))");
+    tester1.checkNull("INSTR(cast(null as varchar(1)), 'foobarbar')");

Review comment:
       Could you also add negative tests?




----------------------------------------------------------------
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


Reply via email to