
| Key: |
OSC-206
|
| Type: |
Bug
|
| Status: |
Open
|
| Priority: |
Minor
|
| Assignee: |
Unassigned
|
| Reporter: |
Andy Cox
|
| Votes: |
0
|
| Watchers: |
1
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
When caching queries an empty element is added to the end of $this->cache_data array in the osC_Database_Result object. This causes an incorrect return from calls to numberOfRows() on cached data.
For example the configuration query in application_top.php :
// set the application parameters
$Qcfg = $osC_Database->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
$Qcfg->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qcfg->setCache('configuration');
$Qcfg->execute();
while ($Qcfg->next()) {
define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
}
$Qcfg->freeResult();
if you print_r($Qcfg) you can see the $this->cached_data array has an empty element at the end.
It can be easily resolved by checking $this->result before adding to the cached data array.
|
|
Description
|
When caching queries an empty element is added to the end of $this->cache_data array in the osC_Database_Result object. This causes an incorrect return from calls to numberOfRows() on cached data.
For example the configuration query in application_top.php :
// set the application parameters
$Qcfg = $osC_Database->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
$Qcfg->bindTable(':table_configuration', TABLE_CONFIGURATION);
$Qcfg->setCache('configuration');
$Qcfg->execute();
while ($Qcfg->next()) {
define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
}
$Qcfg->freeResult();
if you print_r($Qcfg) you can see the $this->cached_data array has an empty element at the end.
It can be easily resolved by checking $this->result before adding to the cached data array. |
Show » |
|
|