@@ -334,7 +334,7 @@ public function doQuery(
334334 }
335335
336336 // If need session, check this feature
337- if (!empty ($ this ->options ['session_id ' ])) {
337+ if (!empty ($ this ->options ['session_id ' ])) {
338338 if (isset ($ this ->support_fe ['session_id ' ])) {
339339 $ sess_sup = $ this ->support_fe ['session_id ' ];
340340 } else {
@@ -542,7 +542,7 @@ public function getVersion($re_check = false)
542542 $ session_id = $ this ->getSession ();
543543 $ query = 'SELECT version() ' ;
544544 $ ans = $ this ->doApiCall ($ this ->server_url , compact ('query ' , 'session_id ' ));
545- if ($ ans ['code ' ] == 200 ) {
545+ if ($ ans ['code ' ] == 200 ) {
546546 $ this ->support_fe ['session_id ' ] = true ;
547547 } else {
548548 // if session_id unsupported send request again
@@ -551,7 +551,9 @@ public function getVersion($re_check = false)
551551 $ ans = $ this ->doApiCall ($ this ->server_url , compact ('query ' ));
552552 }
553553 $ 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 ;
555557 $ this ->setSession ($ old_sess );
556558 }
557559 return $ this ->server_version ;
0 commit comments