@@ -334,7 +334,7 @@ public function doQuery(
334
334
}
335
335
336
336
// If need session, check this feature
337
- if (!empty ($ this ->options ['session_id ' ])) {
337
+ if (!empty ($ this ->options ['session_id ' ])) {
338
338
if (isset ($ this ->support_fe ['session_id ' ])) {
339
339
$ sess_sup = $ this ->support_fe ['session_id ' ];
340
340
} else {
@@ -542,7 +542,7 @@ public function getVersion($re_check = false)
542
542
$ session_id = $ this ->getSession ();
543
543
$ query = 'SELECT version() ' ;
544
544
$ ans = $ this ->doApiCall ($ this ->server_url , compact ('query ' , 'session_id ' ));
545
- if ($ ans ['code ' ] == 200 ) {
545
+ if ($ ans ['code ' ] == 200 ) {
546
546
$ this ->support_fe ['session_id ' ] = true ;
547
547
} else {
548
548
// if session_id unsupported send request again
@@ -551,7 +551,9 @@ public function getVersion($re_check = false)
551
551
$ ans = $ this ->doApiCall ($ this ->server_url , compact ('query ' ));
552
552
}
553
553
$ ver = explode ("\n" , $ ans ['response ' ]);
554
- $ this ->server_version = (count ($ ver ) == 2 ) ? $ ver [0 ] : "Unknown " ;
554
+ $ ver = (count ($ ver ) == 2 && strlen ($ ver [0 ]) < 32 ) ? $ ver [0 ] : "Unknown " ;
555
+ $ this ->support_fe ['query ' ] = \is_string ($ ver ) && (\count (\explode (". " , $ ver )) > 2 );
556
+ $ this ->server_version = $ ver ;
555
557
$ this ->setSession ($ old_sess );
556
558
}
557
559
return $ this ->server_version ;
0 commit comments