@@ -750,6 +750,7 @@ void testSplitSqlQueryWithComments() throws IOException,
750
750
@ Test
751
751
void testValidateConnectionUrl () throws IOException , InterpreterException {
752
752
Properties properties = new Properties ();
753
+ // it easier to unit test with H2 but this is really a MySQL issue (and maybe MariaDB too)
753
754
properties .setProperty ("default.driver" , "org.h2.Driver" );
754
755
properties .setProperty ("default.url" , getJdbcConnection () + ";allowLoadLocalInfile=true" );
755
756
properties .setProperty ("default.user" , "" );
@@ -762,9 +763,26 @@ void testValidateConnectionUrl() throws IOException, InterpreterException {
762
763
interpreterResult .message ().get (0 ).getData ());
763
764
}
764
765
766
+ @ Test
767
+ void testValidateConnectionUrlAllowLoadLocal () throws IOException , InterpreterException {
768
+ Properties properties = new Properties ();
769
+ // it easier to unit test with H2 but this is really a MySQL issue (and maybe MariaDB too)
770
+ properties .setProperty ("default.driver" , "org.h2.Driver" );
771
+ properties .setProperty ("default.url" , getJdbcConnection () + ";allowLoadLocal=true" );
772
+ properties .setProperty ("default.user" , "" );
773
+ properties .setProperty ("default.password" , "" );
774
+ JDBCInterpreter jdbcInterpreter = new JDBCInterpreter (properties );
775
+ jdbcInterpreter .open ();
776
+ InterpreterResult interpreterResult = jdbcInterpreter .interpret ("SELECT 1" , context );
777
+ assertEquals (InterpreterResult .Code .ERROR , interpreterResult .code ());
778
+ assertEquals ("Connection URL contains improper configuration" ,
779
+ interpreterResult .message ().get (0 ).getData ());
780
+ }
781
+
765
782
@ Test
766
783
void testValidateConnectionUrlEncoded () throws IOException , InterpreterException {
767
784
Properties properties = new Properties ();
785
+ // it easier to unit test with H2 but this is really a MySQL issue (and maybe MariaDB too)
768
786
properties .setProperty ("default.driver" , "org.h2.Driver" );
769
787
properties .setProperty ("default.url" , getJdbcConnection () + ";%61llowLoadLocalInfile=true" );
770
788
properties .setProperty ("default.user" , "" );
0 commit comments