@@ -67,90 +67,90 @@ void basicLogging() throws IOException {
6767 MariadbConnectionMetadata meta = connection .getMetadata ();
6868 connection .close ().block ();
6969
70- String contents = new String (Files .readAllBytes (Paths .get (tempFile .getPath ())));
71- String selectIsolation =
72- " +-------------------------------------------------+\r \n " +
73- " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n " +
74- "+--------+-------------------------------------------------+----------------+\r \n " +
75- "|00000000| b9 00 00 00 03 53 45 54 20 61 75 74 6f 63 6f 6d |.....SET autocom|\r \n " +
76- "|00000010| 6d 69 74 3d 31 2c 74 78 5f 69 73 6f 6c 61 74 69 |mit=1,tx_isolati|\r \n " +
77- "|00000020| 6f 6e 3d 27 52 45 50 45 41 54 41 42 4c 45 2d 52 |on='REPEATABLE-R|\r \n " +
78- "|00000030| 45 41 44 27 2c 73 65 73 73 69 6f 6e 5f 74 72 61 |EAD',session_tra|\r \n " +
79- "|00000040| 63 6b 5f 73 63 68 65 6d 61 3d 31 2c 73 65 73 73 |ck_schema=1,sess|\r \n " +
80- "|00000050| 69 6f 6e 5f 74 72 61 63 6b 5f 73 79 73 74 65 6d |ion_track_system|\r \n " +
81- "|00000060| 5f 76 61 72 69 61 62 6c 65 73 3d 43 4f 4e 43 41 |_variables=CONCA|\r \n " +
82- "|00000070| 54 28 40 40 73 65 73 73 69 6f 6e 5f 74 72 61 63 |T(@@session_trac|\r \n " +
83- "|00000080| 6b 5f 73 79 73 74 65 6d 5f 76 61 72 69 61 62 6c |k_system_variabl|\r \n " +
84- "|00000090| 65 73 2c 27 2c 61 75 74 6f 63 6f 6d 6d 69 74 2c |es,',autocommit,|\r \n " +
85- "|000000a0| 74 78 5f 69 73 6f 6c 61 74 69 6f 6e 27 29 2c 20 |tx_isolation'), |\r \n " +
86- "|000000b0| 6e 61 6d 65 73 20 55 54 46 38 4d 42 34 |names UTF8MB4 |\r \n " +
87- "+--------+-------------------------------------------------+----------------+\r \n " ;
88- String transactionIsolation =
89- " +-------------------------------------------------+\r \n "
90- + " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n "
91- + "+--------+-------------------------------------------------+----------------+\r \n "
92- + "|00000000| cb 00 00 00 03 53 45 54 20 61 75 74 6f 63 6f 6d |.....SET autocom|\r \n "
93- + "|00000010| 6d 69 74 3d 31 2c 74 72 61 6e 73 61 63 74 69 6f |mit=1,transactio|\r \n "
94- + "|00000020| 6e 5f 69 73 6f 6c 61 74 69 6f 6e 3d 27 52 45 50 |n_isolation='REP|\r \n "
95- + "|00000030| 45 41 54 41 42 4c 45 2d 52 45 41 44 27 2c 73 65 |EATABLE-READ',se|\r \n "
96- + "|00000040| 73 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 63 68 65 |ssion_track_sche|\r \n "
97- + "|00000050| 6d 61 3d 31 2c 73 65 73 73 69 6f 6e 5f 74 72 61 |ma=1,session_tra|\r \n "
98- + "|00000060| 63 6b 5f 73 79 73 74 65 6d 5f 76 61 72 69 61 62 |ck_system_variab|\r \n "
99- + "|00000070| 6c 65 73 3d 43 4f 4e 43 41 54 28 40 40 73 65 73 |les=CONCAT(@@ses|\r \n "
100- + "|00000080| 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 79 73 74 65 |sion_track_syste|\r \n "
101- + "|00000090| 6d 5f 76 61 72 69 61 62 6c 65 73 2c 27 2c 61 75 |m_variables,',au|\r \n "
102- + "|000000a0| 74 6f 63 6f 6d 6d 69 74 2c 74 72 61 6e 73 61 63 |tocommit,transac|\r \n "
103- + "|000000b0| 74 69 6f 6e 5f 69 73 6f 6c 61 74 69 6f 6e 27 29 |tion_isolation')|\r \n "
104- + "|000000c0| 2c 20 6e 61 6d 65 73 20 55 54 46 38 4d 42 34 |, names UTF8MB4 |\r \n "
105- + "+--------+-------------------------------------------------+----------------+" ;
106- String mysqlIsolation =
107- " +-------------------------------------------------+\r \n " +
108- " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n " +
109- "+--------+-------------------------------------------------+----------------+\r \n " +
110- "|00000000| c0 00 00 00 03 53 45 54 20 61 75 74 6f 63 6f 6d |.....SET autocom|\r \n " +
111- "|00000010| 6d 69 74 3d 31 2c 74 72 61 6e 73 61 63 74 69 6f |mit=1,transactio|\r \n " +
112- "|00000020| 6e 5f 69 73 6f 6c 61 74 69 6f 6e 3d 27 52 45 50 |n_isolation='REP|\r \n " +
113- "|00000030| 45 41 54 41 42 4c 45 2d 52 45 41 44 27 2c 73 65 |EATABLE-READ',se|\r \n " +
114- "|00000040| 73 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 63 68 65 |ssion_track_sche|\r \n " +
115- "|00000050| 6d 61 3d 31 2c 73 65 73 73 69 6f 6e 5f 74 72 61 |ma=1,session_tra|\r \n " +
116- "|00000060| 63 6b 5f 73 79 73 74 65 6d 5f 76 61 72 69 61 62 |ck_system_variab|\r \n " +
117- "|00000070| 6c 65 73 3d 43 4f 4e 43 41 54 28 40 40 73 65 73 |les=CONCAT(@@ses|\r \n " +
118- "|00000080| 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 79 73 74 65 |sion_track_syste|\r \n " +
119- "|00000090| 6d 5f 76 61 72 69 61 62 6c 65 73 2c 27 2c 74 72 |m_variables,',tr|\r \n " +
120- "|000000a0| 61 6e 73 61 63 74 69 6f 6e 5f 69 73 6f 6c 61 74 |ansaction_isolat|\r \n " +
121- "|000000b0| 69 6f 6e 27 29 2c 20 6e 61 6d 65 73 20 55 54 46 |ion'), names UTF|\r \n " +
122- "|000000c0| 38 4d 42 34 |8MB4 |\r \n " +
123- "+--------+-------------------------------------------------+----------------+" ;
124- if ((meta .isMariaDBServer () && !meta .minVersion (11 , 1 , 1 ))
125- || (meta .getMajorVersion () < 8 && !meta .minVersion (5 , 7 , 20 ))
126- || (meta .getMajorVersion () >= 8 && !meta .minVersion (8 , 0 , 3 ))) {
127- Assertions .assertTrue (
128- contents .contains (selectIsolation )
129- || contents .contains (selectIsolation .replace ("\r \n " , "\n " )),
130- contents );
131- } else if (meta .isMariaDBServer ()) {
132- Assertions .assertTrue (
133- contents .contains (transactionIsolation )
134- || contents .contains (transactionIsolation .replace ("\r \n " , "\n " )),
135- contents );
136- } else {
137- Assertions .assertTrue (
138- contents .contains (mysqlIsolation )
139- || contents .contains (mysqlIsolation .replace ("\r \n " , "\n " )),
140- contents );
141- }
142-
143- String selectOne =
144- " +-------------------------------------------------+\r \n "
145- + " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n "
146- + "+--------+-------------------------------------------------+----------------+\r \n "
147- + "|00000000| 09 00 00 00 03 53 45 4c 45 43 54 20 31 |.....SELECT 1 |\r \n "
148- + "+--------+-------------------------------------------------+----------------+" ;
70+ String contents = new String (Files .readAllBytes (Paths .get (tempFile .getPath ())));
71+ String selectIsolation =
72+ " +-------------------------------------------------+\r \n "
73+ + " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n "
74+ + "+--------+-------------------------------------------------+----------------+\r \n "
75+ + "|00000000| b9 00 00 00 03 53 45 54 20 61 75 74 6f 63 6f 6d |.....SET autocom|\r \n "
76+ + "|00000010| 6d 69 74 3d 31 2c 74 78 5f 69 73 6f 6c 61 74 69 |mit=1,tx_isolati|\r \n "
77+ + "|00000020| 6f 6e 3d 27 52 45 50 45 41 54 41 42 4c 45 2d 52 |on='REPEATABLE-R|\r \n "
78+ + "|00000030| 45 41 44 27 2c 73 65 73 73 69 6f 6e 5f 74 72 61 |EAD',session_tra|\r \n "
79+ + "|00000040| 63 6b 5f 73 63 68 65 6d 61 3d 31 2c 73 65 73 73 |ck_schema=1,sess|\r \n "
80+ + "|00000050| 69 6f 6e 5f 74 72 61 63 6b 5f 73 79 73 74 65 6d |ion_track_system|\r \n "
81+ + "|00000060| 5f 76 61 72 69 61 62 6c 65 73 3d 43 4f 4e 43 41 |_variables=CONCA|\r \n "
82+ + "|00000070| 54 28 40 40 73 65 73 73 69 6f 6e 5f 74 72 61 63 |T(@@session_trac|\r \n "
83+ + "|00000080| 6b 5f 73 79 73 74 65 6d 5f 76 61 72 69 61 62 6c |k_system_variabl|\r \n "
84+ + "|00000090| 65 73 2c 27 2c 61 75 74 6f 63 6f 6d 6d 69 74 2c |es,',autocommit,|\r \n "
85+ + "|000000a0| 74 78 5f 69 73 6f 6c 61 74 69 6f 6e 27 29 2c 20 |tx_isolation'), |\r \n "
86+ + "|000000b0| 6e 61 6d 65 73 20 55 54 46 38 4d 42 34 |names UTF8MB4 |\r \n "
87+ + "+--------+-------------------------------------------------+----------------+\r \n " ;
88+ String transactionIsolation =
89+ " +-------------------------------------------------+\r \n "
90+ + " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n "
91+ + "+--------+-------------------------------------------------+----------------+\r \n "
92+ + "|00000000| cb 00 00 00 03 53 45 54 20 61 75 74 6f 63 6f 6d |.....SET autocom|\r \n "
93+ + "|00000010| 6d 69 74 3d 31 2c 74 72 61 6e 73 61 63 74 69 6f |mit=1,transactio|\r \n "
94+ + "|00000020| 6e 5f 69 73 6f 6c 61 74 69 6f 6e 3d 27 52 45 50 |n_isolation='REP|\r \n "
95+ + "|00000030| 45 41 54 41 42 4c 45 2d 52 45 41 44 27 2c 73 65 |EATABLE-READ',se|\r \n "
96+ + "|00000040| 73 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 63 68 65 |ssion_track_sche|\r \n "
97+ + "|00000050| 6d 61 3d 31 2c 73 65 73 73 69 6f 6e 5f 74 72 61 |ma=1,session_tra|\r \n "
98+ + "|00000060| 63 6b 5f 73 79 73 74 65 6d 5f 76 61 72 69 61 62 |ck_system_variab|\r \n "
99+ + "|00000070| 6c 65 73 3d 43 4f 4e 43 41 54 28 40 40 73 65 73 |les=CONCAT(@@ses|\r \n "
100+ + "|00000080| 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 79 73 74 65 |sion_track_syste|\r \n "
101+ + "|00000090| 6d 5f 76 61 72 69 61 62 6c 65 73 2c 27 2c 61 75 |m_variables,',au|\r \n "
102+ + "|000000a0| 74 6f 63 6f 6d 6d 69 74 2c 74 72 61 6e 73 61 63 |tocommit,transac|\r \n "
103+ + "|000000b0| 74 69 6f 6e 5f 69 73 6f 6c 61 74 69 6f 6e 27 29 |tion_isolation')|\r \n "
104+ + "|000000c0| 2c 20 6e 61 6d 65 73 20 55 54 46 38 4d 42 34 |, names UTF8MB4 |\r \n "
105+ + "+--------+-------------------------------------------------+----------------+" ;
106+ String mysqlIsolation =
107+ " +-------------------------------------------------+\r \n "
108+ + " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n "
109+ + "+--------+-------------------------------------------------+----------------+\r \n "
110+ + "|00000000| c0 00 00 00 03 53 45 54 20 61 75 74 6f 63 6f 6d |.....SET autocom|\r \n "
111+ + "|00000010| 6d 69 74 3d 31 2c 74 72 61 6e 73 61 63 74 69 6f |mit=1,transactio|\r \n "
112+ + "|00000020| 6e 5f 69 73 6f 6c 61 74 69 6f 6e 3d 27 52 45 50 |n_isolation='REP|\r \n "
113+ + "|00000030| 45 41 54 41 42 4c 45 2d 52 45 41 44 27 2c 73 65 |EATABLE-READ',se|\r \n "
114+ + "|00000040| 73 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 63 68 65 |ssion_track_sche|\r \n "
115+ + "|00000050| 6d 61 3d 31 2c 73 65 73 73 69 6f 6e 5f 74 72 61 |ma=1,session_tra|\r \n "
116+ + "|00000060| 63 6b 5f 73 79 73 74 65 6d 5f 76 61 72 69 61 62 |ck_system_variab|\r \n "
117+ + "|00000070| 6c 65 73 3d 43 4f 4e 43 41 54 28 40 40 73 65 73 |les=CONCAT(@@ses|\r \n "
118+ + "|00000080| 73 69 6f 6e 5f 74 72 61 63 6b 5f 73 79 73 74 65 |sion_track_syste|\r \n "
119+ + "|00000090| 6d 5f 76 61 72 69 61 62 6c 65 73 2c 27 2c 74 72 |m_variables,',tr|\r \n "
120+ + "|000000a0| 61 6e 73 61 63 74 69 6f 6e 5f 69 73 6f 6c 61 74 |ansaction_isolat|\r \n "
121+ + "|000000b0| 69 6f 6e 27 29 2c 20 6e 61 6d 65 73 20 55 54 46 |ion'), names UTF|\r \n "
122+ + "|000000c0| 38 4d 42 34 |8MB4 |\r \n "
123+ + "+--------+-------------------------------------------------+----------------+" ;
124+ if ((meta .isMariaDBServer () && !meta .minVersion (11 , 1 , 1 ))
125+ || (meta .getMajorVersion () < 8 && !meta .minVersion (5 , 7 , 20 ))
126+ || (meta .getMajorVersion () >= 8 && !meta .minVersion (8 , 0 , 3 ))) {
127+ Assertions .assertTrue (
128+ contents .contains (selectIsolation )
129+ || contents .contains (selectIsolation .replace ("\r \n " , "\n " )),
130+ contents );
131+ } else if (meta .isMariaDBServer ()) {
132+ Assertions .assertTrue (
133+ contents .contains (transactionIsolation )
134+ || contents .contains (transactionIsolation .replace ("\r \n " , "\n " )),
135+ contents );
136+ } else {
149137 Assertions .assertTrue (
150- contents .contains (selectOne ) || contents .contains (selectOne .replace ("\r \n " , "\n " )));
151- logger .setLevel (initialLevel );
152- logger .detachAppender (fa );
153- logger .setAdditive (true );
138+ contents .contains (mysqlIsolation )
139+ || contents .contains (mysqlIsolation .replace ("\r \n " , "\n " )),
140+ contents );
141+ }
142+
143+ String selectOne =
144+ " +-------------------------------------------------+\r \n "
145+ + " | 0 1 2 3 4 5 6 7 8 9 a b c d e f |\r \n "
146+ + "+--------+-------------------------------------------------+----------------+\r \n "
147+ + "|00000000| 09 00 00 00 03 53 45 4c 45 43 54 20 31 |.....SELECT 1 |\r \n "
148+ + "+--------+-------------------------------------------------+----------------+" ;
149+ Assertions .assertTrue (
150+ contents .contains (selectOne ) || contents .contains (selectOne .replace ("\r \n " , "\n " )));
151+ logger .setLevel (initialLevel );
152+ logger .detachAppender (fa );
153+ logger .setAdditive (true );
154154 }
155155
156156 public String encodeHexString (byte [] byteArray ) {
0 commit comments