Skip to content

Commit

Permalink
Bugfixes, including failed getUser(123, ["foo"]).
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiemccarthy committed Sep 24, 2003
1 parent f16ff67 commit a940c47
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
7 changes: 5 additions & 2 deletions Slash/DB/MySQL/MySQL.pm
Expand Up @@ -7436,7 +7436,7 @@ sub getUser {
# Specific column(s) are needed.
my $return_hr = { };
for my $col (@$val) {
$return_hr->{$col} = $answer->{$val};
$return_hr->{$col} = $answer->{$col};
}
$answer = $return_hr;
} elsif ($val) {
Expand Down Expand Up @@ -7471,6 +7471,9 @@ sub _getUser_do_selects {
# WHERE users.uid=123 AND users_blurb.uid=123 AND so on.
# Note if we're being asked to get only params, we skip this.
my $answer = { };
if ($mcddebug > 1) {
print STDERR scalar(gmtime) . " $$ mcd gU_ds selecthashref: '$select' '$from' '$where'\n";
}
$answer = $self->sqlSelectHashref($select, $from, $where) if $select && $from && $where;
if ($mcddebug > 1) {
print STDERR scalar(gmtime) . " $$ mcd gU_ds got answer '$select' '$from' '$where'\n";
Expand Down Expand Up @@ -7699,7 +7702,7 @@ sub _getUser_get_table_data {
}

if ($mcddebug > 1) {
print STDERR scalar(gmtime) . " $$ _getU_gtd cols_needed: '@$cols_needed'\n";
print STDERR scalar(gmtime) . " $$ _getU_gtd cols_needed: " . ($cols_needed ? "'@$cols_needed'" : "(all)") . "\n";
}

# Now, check to see if we know all the answers for that exact
Expand Down
10 changes: 6 additions & 4 deletions Slash/Slash.pm
Expand Up @@ -622,15 +622,17 @@ sub printComments {
# loop here, pull what cids we can
my $cids_needed_ar = $user->{state}{cids} || [ ];
my($mcd_debug, $mcdkey, $mcdkeylen);
if ($mcd && $constants->{memcached_debug}) {
if ($mcd) {
# MemCached key prefix "ctp" means "comment_text, parsed".
# Prepend our site key prefix to try to avoid collisions
# with other sites that may be using the same servers.
$mcd_debug = { start_time => Time::HiRes::time };
$mcdkey = "$mcd->{keyprefix}ctp:";
$mcdkeylen = length($mcdkey);
if ($constants->{memcached_debug}) {
$mcd_debug = { start_time => Time::HiRes::time };
}
}
$mcd_debug->{total} = scalar @$cids_needed_ar if $mcd_debug;
$mcdkey = "$mcd->{keyprefix}ctp:";
$mcdkeylen = length($mcdkey);
if ($mcd) {
if ($mcd && $constants->{memcached_debug} && $constants->{memcached_debug} > 2) {
print STDERR scalar(gmtime) . " printComments memcached mcdkey '$mcdkey'\n";
Expand Down

0 comments on commit a940c47

Please sign in to comment.