@@ -205,7 +205,7 @@ public function tryQuery(
205205 int $ options = self ::QUERY_BUFFERED ,
206206 bool $ cache_affected_rows = true
207207 ) {
208- $ debug = isset ($ GLOBALS ['cfg ' ]['DBG ' ]) ? $ GLOBALS ['cfg ' ]['DBG ' ]['sql ' ] : false ;
208+ $ debug = isset ($ GLOBALS ['cfg ' ]['DBG ' ]) && $ GLOBALS ['cfg ' ]['DBG ' ]['sql ' ];
209209 if (! isset ($ this ->links [$ link ])) {
210210 return false ;
211211 }
@@ -323,7 +323,7 @@ public function getTables(string $database, $link = self::CONNECT_USER): array
323323 * @param bool|int $limit_count number of tables to return
324324 * @param string $sort_by table attribute to sort by
325325 * @param string $sort_order direction to sort (ASC or DESC)
326- * @param string $table_type whether table or view
326+ * @param string|null $table_type whether table or view
327327 * @param mixed $link link type
328328 *
329329 * @return array list of tables in given db(s)
@@ -446,11 +446,10 @@ static function ($a, $b) {
446446 // If permissions are wrong on even one database directory,
447447 // information_schema does not return any table info for any database
448448 // this is why we fall back to SHOW TABLE STATUS even for MySQL >= 50002
449- if (empty ($ tables )) {
449+ if ($ tables === []) {
450+ $ sql = 'SHOW TABLE STATUS FROM ' . Util ::backquote ($ database );
450451 if ($ table || ($ tbl_is_group === true ) || $ table_type ) {
451- $ sql = 'SHOW TABLE STATUS FROM '
452- . Util ::backquote ($ database )
453- . ' WHERE ' ;
452+ $ sql .= ' WHERE ' ;
454453 $ needAnd = false ;
455454 if ($ table || ($ tbl_is_group === true )) {
456455 if (is_array ($ table )) {
@@ -488,9 +487,6 @@ static function ($a, $b) {
488487 $ sql .= " `Comment` != 'VIEW' " ;
489488 }
490489 }
491- } else {
492- $ sql = 'SHOW TABLE STATUS FROM '
493- . Util ::backquote ($ database );
494490 }
495491
496492 $ each_tables = $ this ->fetchResult ($ sql , 'Name ' , null , $ link );
@@ -605,14 +601,14 @@ public function getVirtualTables(string $db): array
605601 /**
606602 * returns array with databases containing extended infos about them
607603 *
608- * @param string $database database
609- * @param bool $force_stats retrieve stats also for MySQL < 5
610- * @param int $link link type
611- * @param string $sort_by column to order by
612- * @param string $sort_order ASC or DESC
613- * @param int $limit_offset starting offset for LIMIT
614- * @param bool|int $limit_count row count for LIMIT or true
615- * for $GLOBALS['cfg']['MaxDbList']
604+ * @param string|null $database database
605+ * @param bool $force_stats retrieve stats also for MySQL < 5
606+ * @param int $link link type
607+ * @param string $sort_by column to order by
608+ * @param string $sort_order ASC or DESC
609+ * @param int $limit_offset starting offset for LIMIT
610+ * @param bool|int $limit_count row count for LIMIT or true
611+ * for $GLOBALS['cfg']['MaxDbList']
616612 *
617613 * @return array
618614 *
@@ -792,10 +788,10 @@ public function getColumnMapFromSql(string $sql_query, array $view_columns = [])
792788 * returns detailed array with all columns for given table in database,
793789 * or all tables/databases
794790 *
795- * @param string $database name of database
796- * @param string $table name of table to retrieve columns from
797- * @param string $column name of specific column
798- * @param mixed $link mysql link resource
791+ * @param string|null $database name of database
792+ * @param string|null $table name of table to retrieve columns from
793+ * @param string|null $column name of specific column
794+ * @param mixed $link mysql link resource
799795 *
800796 * @return array
801797 */
@@ -1051,11 +1047,7 @@ public function setVariable(
10511047 */
10521048 public function postConnect (): void
10531049 {
1054- $ version = $ this ->fetchSingleRow (
1055- 'SELECT @@version, @@version_comment ' ,
1056- DbalInterface::FETCH_ASSOC ,
1057- self ::CONNECT_USER
1058- );
1050+ $ version = $ this ->fetchSingleRow ('SELECT @@version, @@version_comment ' );
10591051
10601052 if (is_array ($ version )) {
10611053 $ this ->versionString = $ version ['@@version ' ] ?? '' ;
@@ -1480,9 +1472,9 @@ public function getDefinition(
14801472 * returns details about the PROCEDUREs or FUNCTIONs for a specific database
14811473 * or details about a specific routine
14821474 *
1483- * @param string $db db name
1484- * @param string $which PROCEDURE | FUNCTION or null for both
1485- * @param string $name name of the routine (to fetch a specific routine)
1475+ * @param string $db db name
1476+ * @param string|null $which PROCEDURE | FUNCTION or null for both
1477+ * @param string $name name of the routine (to fetch a specific routine)
14861478 *
14871479 * @return array information about PROCEDUREs or FUNCTIONs
14881480 */
@@ -1592,7 +1584,7 @@ public function getEvents(string $db, string $name = ''): array
15921584 *
15931585 * @return array information about triggers (may be empty)
15941586 */
1595- public function getTriggers (string $ db , string $ table = '' , $ delimiter = '// ' )
1587+ public function getTriggers (string $ db , string $ table = '' , string $ delimiter = '// ' ): array
15961588 {
15971589 $ result = [];
15981590 if (! $ GLOBALS ['cfg ' ]['Server ' ]['DisableIS ' ]) {
@@ -1822,7 +1814,7 @@ public function getLowerCaseNames()
18221814 * @param int $mode Connection mode on of CONNECT_USER, CONNECT_CONTROL
18231815 * or CONNECT_AUXILIARY.
18241816 * @param array|null $server Server information like host/port/socket/persistent
1825- * @param int $target How to store connection link, defaults to $mode
1817+ * @param int|null $target How to store connection link, defaults to $mode
18261818 *
18271819 * @return mixed false on error or a connection object on success
18281820 */
0 commit comments