Make WordPress Core

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#27693 closed defect (bug) (fixed)

Incorrect call to `mysqli_fetch_field()`

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

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 13 years ago.

Download all attachments as: .zip

Change History (8)

#1 @Denis-de-Bernardy
13 years ago

  • Severity normal → blocker

#2 @pento
13 years ago

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

Nice catch. :-)

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

#3 follow-up: @Denis-de-Bernardy
13 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
13 years ago

  • Milestone Awaiting Review → 3.9

Introduced in [27250].

#5 @nacin
13 years ago

  • Resolution → fixed
  • Status accepted → closed

In 28002:

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

props pento.
fixes #27693.

#6 in reply to: ↑ 3 @pento
13 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.