public function engineCompat(string $sql): string
    {
        $sql = $this->c::mbTrim($sql);

        if (!preg_match('/^CREATE\s+TABLE\b/ui', $sql)) {
            return $sql; // Not applicable.
        }
        $sql = preg_replace('/\bENGINE\=[%a-z0-9_\-]*/ui', '', $sql);

        if (!preg_match('/\bFULLTEXT\s+KEY\b/ui', $sql) || version_compare($this->wp->db_version(), '5.6.4', '>=')) {
            // MySQL v5.6.4+ supports fulltext indexes w/ InnoDB. See: <http://bit.ly/ZVeF42>
            $sql = preg_replace('/;$/u', ' ENGINE=InnoDB;', $sql);
        } else {
            $sql = preg_replace('/;$/u', ' ENGINE=MyISAM;', $sql);
        }
        return $sql;
    }
public function engineCompat(string $sql): string
    {
        $sql = $this->c::mbTrim($sql);

        if (!preg_match('/^CREATE\s+TABLE\b/ui', $sql)) {
            return $sql; // Not applicable.
        }
        $sql = preg_replace('/\bENGINE\=[%a-z0-9_\-]*/ui', '', $sql);

        if (!preg_match('/\bFULLTEXT\s+KEY\b/ui', $sql) || version_compare($this->wp->db_version(), '5.6.4', '>=')) {
            // MySQL v5.6.4+ supports fulltext indexes w/ InnoDB. See: <http://bit.ly/ZVeF42>
            $sql = preg_replace('/;$/u', ' ENGINE=InnoDB;', $sql);
        } else {
            $sql = preg_replace('/;$/u', ' ENGINE=MyISAM;', $sql);
        }
        return $sql;
    }
public function engineCompat ( string $ sql ) : string { $ sql = $ this -> c :: mbTrim ( $ sql ) ; if ( ! preg_match ( '/^CREATE\s+TABLE\b/ui' , $ sql ) ) { return $ sql ; // Not applicable. } $ sql = preg_replace ( '/\bENGINE\=[%a-z0-9_\-]*/ui' , '' , $ sql ) ; if ( ! preg_match ( '/\bFULLTEXT\s+KEY\b/ui' , $ sql ) || version_compare ( $ this -> wp -> db_version ( ) , '5.6.4' , '>=' ) ) { // MySQL v5.6.4+ supports fulltext indexes w/ InnoDB. See: <http://bit.ly/ZVeF42> $ sql = preg_replace ( '/;$/u' , ' ENGINE=InnoDB;' , $ sql ) ; } else { $ sql = preg_replace ( '/;$/u' , ' ENGINE=MyISAM;' , $ sql ) ; } return $ sql ; }
MySQL storage engine compat.

@since 160524 First documented version.

@param string $sql SQL to check.

@return string Output `$sql` with engine modification.
MySQL storage engine compat .