@@ -573,7 +573,8 @@ public void testSwitchDatabase() throws Exception {
573573 }
574574 }
575575 }
576-
576+
577+
577578 @ Test (groups = { "integration" })
578579 public void testNewLineSQLParsing () throws Exception {
579580 try (Connection conn = getJdbcConnection ()) {
@@ -637,4 +638,37 @@ public void testNewLineSQLParsing() throws Exception {
637638 }
638639 }
639640 }
641+
642+
643+ @ Test (groups = { "integration" })
644+ public void testNullableFixedStringType () throws Exception {
645+ try (Connection conn = getJdbcConnection ()) {
646+ String sqlCreate = "CREATE TABLE `data_types` (`f1` FixedString(4),`f2` LowCardinality(FixedString(4)), `f3` Nullable(FixedString(4)), `f4` LowCardinality(Nullable(FixedString(4))) ) ENGINE Memory;" ;
647+ try (Statement stmt = conn .createStatement ()) {
648+ int r = stmt .executeUpdate (sqlCreate );
649+ assertEquals (r , 0 );
650+ }
651+ try (Statement stmt = conn .createStatement ()) {
652+ String sqlInsert = "INSERT INTO `data_types` VALUES ('val1', 'val2', 'val3', 'val4')" ;
653+ int r = stmt .executeUpdate (sqlInsert );
654+ assertEquals (r , 1 );
655+ }
656+ try (Statement stmt = conn .createStatement ()) {
657+ String sqlSelect = "SELECT * FROM `data_types`" ;
658+ ResultSet rs = stmt .executeQuery (sqlSelect );
659+ assertTrue (rs .next ());
660+ assertEquals (rs .getString (1 ), "val1" );
661+ assertEquals (rs .getString (2 ), "val2" );
662+ assertEquals (rs .getString (3 ), "val3" );
663+ assertEquals (rs .getString (4 ), "val4" );
664+ assertFalse (rs .next ());
665+ }
666+ try (Statement stmt = conn .createStatement ()) {
667+ String sqlSelect = "SELECT f4 FROM `data_types`" ;
668+ ResultSet rs = stmt .executeQuery (sqlSelect );
669+ assertTrue (rs .next ());
670+ assertEquals (rs .getString (1 ), "val4" );
671+ }
672+ }
673+ }
640674}
0 commit comments