WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#27693 closed defect (bug) (fixed)

Incorrect call to `mysqli_fetch_field()`

Reported by: Denis-de-Bernardy Owned by: pento
Milestone: 3.9 Priority: normal
Severity: blocker Version: 3.9
Component: Database Keywords: has-patch commit
Focuses: Cc:

Description

We call it with two parameters, whereas it only expects a single one:

http://us2.php.net/manual/en/mysqli-result.fetch-field.php

This breaks $wpdb->col_info among other things.

Attachments (1)

27693.diff (540 bytes) - added by pento 8 years ago.

Download all attachments as: .zip

Change History (8)

#1 @Denis-de-Bernardy
8 years ago

  • Severity changed from normal to blocker

@pento
8 years ago

#2 @pento
8 years ago

  • Keywords has-patch commit added
  • Owner set to pento
  • Status changed from new to accepted

Nice catch. :-)

As we're retrieving fields sequentially, we don't really need the field offset, anyway.

#3 follow-up: @Denis-de-Bernardy
8 years ago

Quick aside, here: is there any good reason to silence errors in those calls the way things are, instead of ensuring that it won't spit out a warning?

#4 @SergeyBiryukov
8 years ago

  • Milestone changed from Awaiting Review to 3.9

Introduced in [27250].

#5 @nacin
8 years ago

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

In 28002:

wpdb: Don't pass a second argument to mysqli_fetch_field().

props pento.
fixes #27693.

#6 in reply to: ↑ 3 @pento
8 years ago

Replying to Denis-de-Bernardy:

Quick aside, here: is there any good reason to silence errors in those calls the way things are, instead of ensuring that it won't spit out a warning?

Good question! This has always existed, so I'm going to go with "no-one has been brave enough to change it".

Note: See TracTickets for help on using tickets.