@@ -573,4 +573,36 @@ public void testSwitchDatabase() throws Exception {
573573 }
574574 }
575575 }
576+
577+ @ Test (groups = { "integration" })
578+ public void testNullableFixedStringType () throws Exception {
579+ try (Connection conn = getJdbcConnection ()) {
580+ String sqlCreate = "CREATE TABLE `data_types` (`f1` FixedString(4),`f2` LowCardinality(FixedString(4)), `f3` Nullable(FixedString(4)), `f4` LowCardinality(Nullable(FixedString(4))) ) ENGINE Memory;" ;
581+ try (Statement stmt = conn .createStatement ()) {
582+ int r = stmt .executeUpdate (sqlCreate );
583+ assertEquals (r , 0 );
584+ }
585+ try (Statement stmt = conn .createStatement ()) {
586+ String sqlInsert = "INSERT INTO `data_types` VALUES ('val1', 'val2', 'val3', 'val4')" ;
587+ int r = stmt .executeUpdate (sqlInsert );
588+ assertEquals (r , 1 );
589+ }
590+ try (Statement stmt = conn .createStatement ()) {
591+ String sqlSelect = "SELECT * FROM `data_types`" ;
592+ ResultSet rs = stmt .executeQuery (sqlSelect );
593+ assertTrue (rs .next ());
594+ assertEquals (rs .getString (1 ), "val1" );
595+ assertEquals (rs .getString (2 ), "val2" );
596+ assertEquals (rs .getString (3 ), "val3" );
597+ assertEquals (rs .getString (4 ), "val4" );
598+ assertFalse (rs .next ());
599+ }
600+ try (Statement stmt = conn .createStatement ()) {
601+ String sqlSelect = "SELECT f4 FROM `data_types`" ;
602+ ResultSet rs = stmt .executeQuery (sqlSelect );
603+ assertTrue (rs .next ());
604+ assertEquals (rs .getString (1 ), "val4" );
605+ }
606+ }
607+ }
576608}
0 commit comments