Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#27693 closed defect (bug) (fixed)

Incorrect call to `mysqli_fetch_field()`

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by: pento's profile 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 11 years ago.

Download all attachments as: .zip

Change History (8)

#1 @Denis-de-Bernardy
11 years ago

  • Severity changed from normal to blocker

@pento
11 years ago

#2 @pento
11 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
11 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
11 years ago

  • Milestone changed from Awaiting Review to 3.9

Introduced in [27250].

#5 @nacin
11 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
11 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.