Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Got a clash of key names while trying to run update.php #16

Closed
wants to merge 4 commits into from

3 participants

@hexmode

The name "key_unique" surprisingly isn't that unique.

@brandonsavage brandonsavage commented on the diff
cache/BugzillaCacheMysql.class.php
@@ -55,6 +55,11 @@ public function get($key)
'LIMIT' => 1)
);
+ if( !$res ) {
+ $this->expire( $key );
+ return;
+ }
+

What is the reason for this particular change?

@hexmode
hexmode added a note

Sorry, my ignorance of how github handles pull requests bit me here. This was supposed to be separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@brandonsavage

You can test for false.

if ($res === false)

Note the three equals signs. This tests for type and value equality.

Yes, but an db object won't evaluate as false, so this is safe. I've nothing against the === operator if you prefer that, though.

@brandonsavage

Here's what I'll ask you to do: cherry-pick your commits into two branches, submit two pull requests for those two branches. That way each commit is atomic.

@reedy

I'll see about re-doing these over the weekend so we can get them merged

@brandonsavage

This PR cannot automatically be merged. R- and closing until they can be resubmitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 6 additions and 1 deletion.
  1. +1 −1  cache.sql
  2. +5 −0 cache/BugzillaCacheMysql.class.php
View
2  cache.sql
@@ -7,4 +7,4 @@ CREATE TABLE IF NOT EXISTS `bugzilla_cache` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB, DEFAULT CHARSET=binary;
-CREATE UNIQUE INDEX `key_unique` ON `bugzilla_cache` (`key`);
+CREATE UNIQUE INDEX `uniq_bugzilla_cache_key` ON `bugzilla_cache` (`key`);
View
5 cache/BugzillaCacheMysql.class.php
@@ -55,6 +55,11 @@ public function get($key)
'LIMIT' => 1)
);
+ if( !$res ) {
+ $this->expire( $key );
+ return;
+ }
+

What is the reason for this particular change?

@hexmode
hexmode added a note

Sorry, my ignorance of how github handles pull requests bit me here. This was supposed to be separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
$row = $res->fetchRow();
if(!$row || ($row['expires'] < time())) {
Something went wrong with that request. Please try again.