Make WordPress Core

Opened 18 years ago

Closed 17 years ago

Last modified 4 months ago

#3156 closed defect (bug) (fixed)

Uninitialized var (PHP Notice) in ternary expressions - wp-db.php

Reported by: alexkingorg's profile alexkingorg Owned by:
Milestone: 2.3 Priority: normal
Severity: normal Version: 2.1
Component: General Keywords: has-patch 2nd-opinion
Focuses: Cc:


I'm not sure the best way to fix this. I've attached a patch that I think should work, but someone should put some serious eyeballs on this one.

Attachments (1)

patch.diff (430 bytes) - added by alexkingorg 18 years ago.

Download all attachments as: .zip

Change History (10)

18 years ago


#1 @foolswisdom
18 years ago

  • Keywords has-patch 2nd-opinion added
  • Milestone set to 2.1
  • Version set to 2.1

#2 @ryan
18 years ago

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

(In [4208]) Check if array index is set. Props Alex King. fixes #3156

#3 @donncha
18 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

This caused some weird problems for wpcom - it looked like a cache problem and caused lots of hits on the same queries over and over again. ie.

SELECT option_value FROM wp_options WHERE option_name = 'siteurl' LIMIT 1

repeated about 50 times.

#4 @ryan
18 years ago

Maybe we need to return false.

#5 @ryan
18 years ago

Actually, nevermind on that. I'm not seeing why this would make a difference. Weird.

#6 @markjaquith
18 years ago

Lots of hits on the same queries over and over again can happen if you're using the WP Object Cache (I think you're using a Memcached drop-in on and you're querying something that doesn't exist in the DB (like an option).

See #2268

Basically, there's no way to tell the difference between "option isn't in cache" and "option's non-existence has been cached."

This may be related... dunno.

#7 @matt
18 years ago

  • Milestone changed from 2.1 to 2.2

#8 @foolswisdom
17 years ago

  • Milestone changed from 2.2 to 2.3

#9 @westi
17 years ago

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

Marking this as fixed.

No extra info in nearly a year.

Non-existent options caching went into [4855] which should fix the large number of db queries on cache misses for non-existent options.

Please raise another ticket if you still have issue.

Note: See TracTickets for help on using tickets.