@@ -2882,14 +2882,6 @@ public void testBug63800() throws Exception {
2882
2882
}
2883
2883
2884
2884
private void testTimestamp (Connection con , Statement st , String dbname ) throws SQLException {
2885
- boolean explicitDefaultsForTimestamp = false ;
2886
- if (versionMeetsMinimum (8 , 0 , 2 )) {
2887
- String v = getMysqlVariable ("explicit_defaults_for_timestamp" );
2888
- if ("ON" .equals (v )) {
2889
- explicitDefaultsForTimestamp = true ;
2890
- }
2891
- }
2892
-
2893
2885
st .execute ("DROP TABLE IF EXISTS testBug63800" );
2894
2886
st .execute ("CREATE TABLE testBug63800(f1 TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP)" );
2895
2887
DatabaseMetaData dmd = con .getMetaData ();
@@ -2913,7 +2905,7 @@ private void testTimestamp(Connection con, Statement st, String dbname) throws S
2913
2905
st .execute ("CREATE TABLE testBug63800(f1 TIMESTAMP)" );
2914
2906
dmd = con .getMetaData ();
2915
2907
this .rs = dmd .getVersionColumns (dbname , dbname , "testBug63800" );
2916
- if (explicitDefaultsForTimestamp ) {
2908
+ if ("ON" . equals ( getMysqlVariable ( "explicit_defaults_for_timestamp" )) ) {
2917
2909
assertFalse ("0 column must be found" , this .rs .next ());
2918
2910
} else {
2919
2911
assertTrue ("1 column must be found" , this .rs .next ());
@@ -3047,14 +3039,6 @@ private void testDatetime(Connection con, Statement st, String dbname) throws SQ
3047
3039
}
3048
3040
assertEquals ("2 column must be found" , 2 , cnt );
3049
3041
3050
- boolean explicitDefaultsForTimestamp = false ;
3051
- if (versionMeetsMinimum (8 , 0 , 2 )) {
3052
- String v = getMysqlVariable ("explicit_defaults_for_timestamp" );
3053
- if ("ON" .equals (v )) {
3054
- explicitDefaultsForTimestamp = true ;
3055
- }
3056
- }
3057
-
3058
3042
st .execute ("DROP TABLE IF EXISTS testBug63800" );
3059
3043
st .execute ("CREATE TABLE testBug63800(f1 TIMESTAMP, f2 DATETIME ON UPDATE CURRENT_TIMESTAMP, f3 TIMESTAMP NULL ON UPDATE CURRENT_TIMESTAMP)" );
3060
3044
dmd = con .getMetaData ();
@@ -3063,7 +3047,7 @@ private void testDatetime(Connection con, Statement st, String dbname) throws SQ
3063
3047
while (this .rs .next ()) {
3064
3048
cnt ++;
3065
3049
}
3066
- if (explicitDefaultsForTimestamp ) {
3050
+ if ("ON" . equals ( getMysqlVariable ( "explicit_defaults_for_timestamp" )) ) {
3067
3051
assertEquals ("2 column must be found" , 2 , cnt );
3068
3052
} else {
3069
3053
assertEquals ("3 column must be found" , 3 , cnt );
0 commit comments