Skip to content

Commit

Permalink
Fix miscellaneous Sphinx DB usage
Browse files Browse the repository at this point in the history
These two codepaths use the Sphinx DB. The table changed.
  • Loading branch information
zorkian committed Feb 8, 2013
1 parent bbfce05 commit 6e75c71
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cgi-bin/DW/Hooks/SiteSearch.pm
Expand Up @@ -30,7 +30,7 @@ LJ::Hooks::register_hook( 'setprop', sub {
return unless $opts{prop} eq 'opt_blockglobalsearch';

my $dbh = _sphinx_db() or return 0;
$dbh->do( 'UPDATE posts_raw SET allow_global_search = ? WHERE journal_id = ?',
$dbh->do( 'UPDATE items_raw SET allow_global_search = ? WHERE journal_id = ?',
undef, $opts{value} eq 'Y' ? 0 : 1, $opts{u}->id );
die $dbh->errstr if $dbh->err;

Expand All @@ -46,7 +46,7 @@ sub _mark_deleted {
my ( $u, $is_deleted ) = @_;

my $dbh = _sphinx_db() or return 0;
$dbh->do( 'UPDATE posts_raw SET is_deleted = ? where journal_id = ?',
$dbh->do( 'UPDATE items_raw SET is_deleted = ? where journal_id = ?',
undef, $is_deleted, $u->id );
die $dbh->errstr if $dbh->err;

Expand Down
2 changes: 1 addition & 1 deletion cgi-bin/LJ/DB.pm
Expand Up @@ -712,7 +712,7 @@ sub alloc_global_counter
} elsif ( $dom eq 'X' ) {
my $dbsx = LJ::get_dbh( 'sphinx_search' )
or die "Unable to allocate counter type X unless Sphinx is configured.\n";
$newmax = $dbsx->selectrow_array( 'SELECT MAX(id) FROM posts_raw' );
$newmax = $dbsx->selectrow_array( 'SELECT MAX(id) FROM items_raw' );
} else {
$newmax = LJ::Hooks::run_hook('global_counter_init_value', $dom);
die "No alloc_global_counter initalizer for domain '$dom'"
Expand Down

0 comments on commit 6e75c71

Please sign in to comment.