@@ -1196,13 +1196,24 @@ public void testReplaceLegacyPropertyValues() throws Exception {
11961196 connStr .add ("jdbc:mysql://127.0.0.1:1234/db?key=value&zeroDateTimeBehavior=convertToNull" );
11971197 connStr .add ("jdbc:mysql://(port=3306,user=root,password=pwd,zeroDateTimeBehavior=convertToNull)/test" );
11981198 connStr .add ("jdbc:mysql://address=(port=3306)(user=root)(password=pwd)(zeroDateTimeBehavior=convertToNull)/test" );
1199+ connStr .add ("jdbc:mysql://onehost:1111,anotherhost:2222/db" );
1200+ connStr .add ("jdbc:mysql://onehost:1111,anotherhost:2222/db?key=value&zeroDateTimeBehavior=convertToNull" );
1201+ connStr .add ("jdbc:mysql://(host=onehost,port=1111,key=value,zeroDateTimeBehavior=convertToNull),anotherhost:2222/db" );
1202+ connStr .add ("jdbc:mysql:loadbalance://onehost:1111,anotherhost:2222/db" );
1203+ connStr .add ("jdbc:mysql:loadbalance://onehost:1111,anotherhost:2222/db?key=value&zeroDateTimeBehavior=convertToNull" );
1204+ connStr .add ("jdbc:mysql:loadbalance://(host=onehost,port=1111,key=value,zeroDateTimeBehavior=convertToNull),anotherhost:2222/db" );
1205+ connStr .add ("jdbc:mysql:replication://onehost:1111,anotherhost:2222/db" );
1206+ connStr .add ("jdbc:mysql:replication://onehost:1111,anotherhost:2222/db?key=value&zeroDateTimeBehavior=convertToNull" );
1207+ connStr .add ("jdbc:mysql:replication://(host=onehost,port=1111,key=value,zeroDateTimeBehavior=convertToNull),anotherhost:2222/db" );
11991208
12001209 Properties props = new Properties ();
12011210 props .setProperty (PropertyKey .zeroDateTimeBehavior .getKeyName (), "convertToNull" );
12021211
12031212 for (String cs : connStr ) {
12041213 ConnectionUrl connUrl = ConnectionUrl .getConnectionUrlInstance (cs , props );
12051214 assertEquals (ZeroDatetimeBehavior .CONVERT_TO_NULL .name (), connUrl .getMainHost ().getProperty (PropertyKey .zeroDateTimeBehavior .getKeyName ()));
1215+ assertEquals (ZeroDatetimeBehavior .CONVERT_TO_NULL .name (),
1216+ connUrl .getConnectionArgumentsAsProperties ().getProperty (PropertyKey .zeroDateTimeBehavior .getKeyName ()));
12061217 }
12071218 }
12081219
0 commit comments