Make WordPress Core

Opened 18 years ago

Closed 18 years ago

#3293 closed defect (bug) (fixed)

Bypassing mysql library check for mysqli usage

Reported by: morpheu5's profile morpheu5 Owned by: masquerade's profile masquerade
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.0.4
Component: Administration Keywords: has-patch
Focuses: 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 (1)

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

Download all attachments as: .zip

Change History (5)

@Nazgul
18 years ago

#1 @Nazgul
18 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.

#2 @morpheu5
18 years ago

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

#3 @Nazgul
18 years ago

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.

#4 @ryan
18 years ago

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

(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.