@@ -6822,29 +6822,6 @@ public Void call() throws Exception {
6822
6822
} while ((sendFractionalSeconds = !sendFractionalSeconds ) || (useServerPrepStmts = !useServerPrepStmts ));
6823
6823
}
6824
6824
6825
- /**
6826
- * Tests for fix to BUG#92574 (28706219), WHEN CONVERTING FROM VARCHAR TO JAVA BOOLEAN, 'N' IS NOT SUPPORTED.
6827
- *
6828
- * @throws Exception
6829
- */
6830
- @ Test
6831
- public void testBug92574 () throws Exception {
6832
- String [] strValues = new String [] { null , "N" , "n" , "Y" , "y" , "0" , "1" };
6833
- boolean [] boolValues = new boolean [] { false , false , false , true , true , false , true };
6834
-
6835
- createTable ("testBug92574" , "(id int not null, f varchar(1), key(id))" );
6836
- for (int i = 0 ; i < strValues .length ; i ++) {
6837
- String val = strValues [i ] == null ? null : "'" + strValues [i ] + "'" ;
6838
- this .stmt .executeUpdate ("insert into testBug92574 values(" + i + "," + val + ")" );
6839
- }
6840
- this .rs = this .stmt .executeQuery ("SELECT * from testBug92574" );
6841
- while (this .rs .next ()) {
6842
- int i = this .rs .getInt (1 );
6843
- assertEquals (strValues [i ], this .rs .getString (2 ));
6844
- assertEquals (boolValues [i ], this .rs .getBoolean (2 ));
6845
- }
6846
- }
6847
-
6848
6825
/**
6849
6826
* Tests fix for Bug#91065 (28101003), ZERODATETIMEBEHAVIOR=CONVERT_TO_NULL SHOULD NOT APPLY TO 00:00:00 TIME COLUMNS.
6850
6827
*
@@ -8054,4 +8031,30 @@ public void testBug32954396() throws Exception {
8054
8031
testConn .close ();
8055
8032
} while ((useCursorFetch = !useCursorFetch ) || (setFetchSize = !setFetchSize ));
8056
8033
}
8034
+
8035
+ /**
8036
+ * Test fix for Bug#33185116, Have method ResultSet.getBoolean() supporting conversion of 'T' and 'F' in a VARCHAR to True/False (boolean).
8037
+ * Extended the test for BUG#92574 (28706219), WHEN CONVERTING FROM VARCHAR TO JAVA BOOLEAN, 'N' IS NOT SUPPORTED.
8038
+ *
8039
+ * @throws Exception
8040
+ */
8041
+ @ Test
8042
+ public void testBug33185116 () throws Exception {
8043
+ String [] strValues = new String [] { null , "N" , "n" , "Y" , "y" , "0" , "1" , "T" , "t" , "F" , "f" , "yes" , "Yes" , "no" , "No" , "true" , "TrUe" , "false" ,
8044
+ "FalsE" };
8045
+ boolean [] boolValues = new boolean [] { false , false , false , true , true , false , true , true , true , false , false , true , true , false , false , true , true ,
8046
+ false , false };
8047
+
8048
+ createTable ("testBug33185116" , "(id int not null, f varchar(5), key(id))" );
8049
+ for (int i = 0 ; i < strValues .length ; i ++) {
8050
+ String val = strValues [i ] == null ? null : "'" + strValues [i ] + "'" ;
8051
+ this .stmt .executeUpdate ("insert into testBug33185116 values(" + i + "," + val + ")" );
8052
+ }
8053
+ this .rs = this .stmt .executeQuery ("SELECT * from testBug33185116" );
8054
+ while (this .rs .next ()) {
8055
+ int i = this .rs .getInt (1 );
8056
+ assertEquals (strValues [i ], this .rs .getString (2 ));
8057
+ assertEquals (boolValues [i ], this .rs .getBoolean (2 ));
8058
+ }
8059
+ }
8057
8060
}
0 commit comments