Ticket #3293 (closed defect (bug): fixed)

Opened 5 years ago

Last modified 5 years ago

Bypassing mysql library check for mysqli usage

Reported by: morpheu5 Owned by: masquerade
Priority: normal Milestone: 2.1
Component: Administration Version: 2.0.4
Severity: normal Keywords: has-patch
Cc:

Description

As suggested by masquerade in  http://trac.wordpress.org/ticket/3292 I'm proposing this workaround that checks for mysql or mysqli library loaded. I've converted the WP code to mysqli as suggested by  http://forge.mysql.com/wiki/Converting_to_MySQLi and it works. I guess this is not a matter of saying "we don't use it, we don't care" because my experience is that if a technology is intended to replace an older one, it *must* be taken in account *even if* you actually don't use it. It's called "flexibility" in the real world, I guess...

Workaround:

/wp-settings.php row 53

if ( !extension_loaded('mysqli') and !extension_loaded('mysql') )

Attachments

3293.diff Download (568 bytes) - added by Nazgul 5 years ago.

Change History

Nazgul5 years ago

  • Keywords has-patch added
  • Milestone set to 2.1

I think we should link the mysql extension check to the existance of the custom db.php. Right now the mysql extension has to be present, even if the custom db.php uses an entirely different engine.

Mysqli support could than be achieved by a custom db.php 'plugin'.

Patch for this attached.

I'm not experiencing any pain with my solution, I don't have mysql extension loaded and I have a fully converted WP installation.

I know that you don't experience it, because you converted your wp-db.php to be compatible with mysqli.

Most people won't do that (or know how to) and thus experience a Wordpress breakdown if their server has mysqli, but not mysql available, because the default wp-db.php won't work in that case.

comment:4   ryan5 years ago

  • Status changed from new to closed
  • Resolution set to fixed

(In [4489]) Don't enforce presence of mysql system if custom DB class is being used. Props Nazgul. fixes #3293

Note: See TracTickets for help on using tickets.