minor fix for calculated columns with fullcolumns

This commit is contained in:
Sergey Tsalkov
2013-03-19 11:20:20 -07:00
parent 027e1529ba
commit 6cb757797b
2 changed files with 4 additions and 2 deletions

View File

@@ -616,7 +616,8 @@ class MeekroDB {
if ($full_names) {
$infos = array();
foreach ($result->fetch_fields() as $info) {
$infos[] = $info->table . '.' . $info->name;
if (strlen($info->table)) $infos[] = $info->table . '.' . $info->name;
else $infos[] = $info->name;
}
}

View File

@@ -352,13 +352,14 @@ class BasicTest extends SimpleTest {
));
DB::query("UPDATE accounts SET profile_id=1 WHERE id=2");
$r = DB::queryFullColumns("SELECT accounts.*, profile.* FROM accounts
$r = DB::queryFullColumns("SELECT accounts.*, profile.*, 1+1 FROM accounts
INNER JOIN profile ON accounts.profile_id=profile.id");
$this->assert(count($r) === 1);
$this->assert($r[0]['accounts.id'] === '2');
$this->assert($r[0]['profile.id'] === '1');
$this->assert($r[0]['profile.signature'] === 'u_suck');
$this->assert($r[0]['1+1'] === '2');
}
}