Skip to content

Commit

Permalink
Fix a bunch of places where we were using "= null" instead of "IS NULL".
Browse files Browse the repository at this point in the history
  • Loading branch information
bharat committed Dec 2, 2009
1 parent d2cb217 commit 94411b3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion modules/exif/helpers/exif.php
Expand Up @@ -145,7 +145,7 @@ static function stats() {
->join("exif_records", "items.id", "exif_records.item_id", "left")
->where("type", "=", "photo")
->and_open()
->where("exif_records.item_id", "=", null)
->where("exif_records.item_id", "IS", null)
->or_where("exif_records.dirty", "=", 1)
->close()
->execute()
Expand Down
2 changes: 1 addition & 1 deletion modules/exif/helpers/exif_task.php
Expand Up @@ -47,7 +47,7 @@ static function update_index($task) {
->join("exif_records", "items.id", "exif_records.item_id", "left")
->where("type", "=", "photo")
->and_open()
->where("exif_records.item_id", "=", null)
->where("exif_records.item_id", "IS", null)
->or_where("exif_records.dirty", "=", 1)
->close()
->find_all() as $item) {
Expand Down
6 changes: 2 additions & 4 deletions modules/search/helpers/search.php
Expand Up @@ -73,15 +73,13 @@ static function update($item) {

static function stats() {
$remaining = db::build()
->select("items.id")
->from("items")
->join("search_records", "items.id", "search_records.item_id", "left")
->and_open()
->where("search_records.item_id", "=", null)
->where("search_records.item_id", "IS", null)
->or_where("search_records.dirty", "=", 1)
->close()
->execute()
->count();
->count_records();

$total = ORM::factory("item")->count_all();
$percent = round(100 * ($total - $remaining) / $total);
Expand Down
2 changes: 1 addition & 1 deletion modules/search/helpers/search_task.php
Expand Up @@ -45,7 +45,7 @@ static function update_index($task) {
$start = microtime(true);
foreach (ORM::factory("item")
->join("search_records", "items.id", "search_records.item_id", "left")
->where("search_records.item_id", "=", null)
->where("search_records.item_id", "IS", null)
->or_where("search_records.dirty", "=", 1)
->find_all() as $item) {
// The query above can take a long time, so start the timer after its done
Expand Down
2 changes: 1 addition & 1 deletion modules/server_add/controllers/server_add.php
Expand Up @@ -198,7 +198,7 @@ static function add($task) {
// they're done.
$entries = ORM::factory("server_add_file")
->where("task_id", "=", $task->id)
->where("item_id", "=", null)
->where("item_id", "IS", null)
->order_by("id", "ASC")
->limit(10)
->find_all();
Expand Down

0 comments on commit 94411b3

Please sign in to comment.