Make WordPress Core

Opened 20 years ago

Closed 19 years ago

Last modified 3 years ago

#3156 closed defect (bug) (fixed)

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

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

Description

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 20 years ago.
patch

Download all attachments as: .zip

Change History (10)

@alexkingorg
20 years ago

patch

#1 @foolswisdom
20 years ago

  • Keywords has-patch 2nd-opinion added
  • Milestone2.1
  • Version2.1

#2 @ryan
20 years ago

  • Resolutionfixed
  • Status newclosed

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

#3 @donncha
20 years ago

  • Resolution fixed
  • Status closedreopened

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
20 years ago

Maybe we need to return false.

#5 @ryan
20 years ago

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

#6 @markjaquith
20 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 WP.com) 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
20 years ago

  • Milestone 2.12.2

#8 @foolswisdom
19 years ago

  • Milestone 2.22.3

#9 @westi
19 years ago

  • Resolutionfixed
  • Status reopenedclosed

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.