WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#33105 closed enhancement (fixed)

On reconnect return the value of db_connect()

Reported by: markoheijnen Owned by: pento
Milestone: 4.4 Priority: normal
Severity: normal Version: 3.9
Component: Database Keywords: has-patch
Focuses: Cc:

Description

Currently db_connect() will get called on reconnect inside db_connect. After that the function continues but could be stopped there too.

Attachments (1)

33105.diff (368 bytes) - added by markoheijnen 5 years ago.

Download all attachments as: .zip

Change History (5)

@markoheijnen
5 years ago

#1 @johnbillion
5 years ago

  • Milestone changed from Awaiting Review to 4.4

Makes sense.

#2 @johnbillion
5 years ago

  • Keywords dev-feedback added
  • Owner set to pento
  • Status changed from new to assigned

Should the $allow_bail parameter be passed through, too? Otherwise $allow_bail => false turns into $allow_bail => true when attempting the fallback connection.

#3 @pento
5 years ago

  • Keywords dev-feedback removed

The return is correct. Core only uses $allow_bail => false when reconnecting, which blocks the fallback attempt. I'm okay with adding it in for other uses, though.

#4 @pento
5 years ago

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

In 34478:

WPDB: When attempting to fall back to ext/mysql in db_connect(), return the result of the fall back.

While it doesn't affect Core, we should also be passing the $allow_bail parameter, for anything that uses it differently.

Props markoheijnen, johnbillion.

Fixes #33105.

Note: See TracTickets for help on using tickets.