minor fix for calculated columns with fullcolumns
This commit is contained in:
@@ -616,7 +616,8 @@ class MeekroDB {
|
|||||||
if ($full_names) {
|
if ($full_names) {
|
||||||
$infos = array();
|
$infos = array();
|
||||||
foreach ($result->fetch_fields() as $info) {
|
foreach ($result->fetch_fields() as $info) {
|
||||||
$infos[] = $info->table . '.' . $info->name;
|
if (strlen($info->table)) $infos[] = $info->table . '.' . $info->name;
|
||||||
|
else $infos[] = $info->name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -352,13 +352,14 @@ class BasicTest extends SimpleTest {
|
|||||||
));
|
));
|
||||||
DB::query("UPDATE accounts SET profile_id=1 WHERE id=2");
|
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");
|
INNER JOIN profile ON accounts.profile_id=profile.id");
|
||||||
|
|
||||||
$this->assert(count($r) === 1);
|
$this->assert(count($r) === 1);
|
||||||
$this->assert($r[0]['accounts.id'] === '2');
|
$this->assert($r[0]['accounts.id'] === '2');
|
||||||
$this->assert($r[0]['profile.id'] === '1');
|
$this->assert($r[0]['profile.id'] === '1');
|
||||||
$this->assert($r[0]['profile.signature'] === 'u_suck');
|
$this->assert($r[0]['profile.signature'] === 'u_suck');
|
||||||
|
$this->assert($r[0]['1+1'] === '2');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user