# Preparations
* in IDE:
# enable debug mode
* in Web Browser
# open Front-End
# remember SQL count in Debugger (in my case it was 21 sql (1 of SQLs was repeated twice + 1 sql was non-loggable because it wasn't a SELECT = 19 loggable sqls)
* in IDE:
1. disable debug mode
2. open `/system/debug.php` file for editing
3. uncomment `DBG_CAPTURE_STATISTICS` and `DBG_MAX_SQL_TIME` constant declarations
4. set `0` (instead of current value of `2`) as value for `DBG_MAX_SQL_TIME` constant
5. save changes
6. open `/index.php` file for editing
7. after `$application->Init();` line add this code:
```
lang=php
$rows = $application->Conn->GetIterator('SELECT * FROM ' . TABLE_PREFIX . 'Languages', null, true);
echo '[is_iterator:' . (is_object($rows) ? 'yes' : 'no') . ']';
```
8. save changes
# Plan (part 1 - general & iterator logging)
* in Database Manager:
# clear contents of `SlowSqlCapture` and `StatisticsCapture` tables in the database
* in Web Browser
# go to Front-End
# confirm, that no Fatal Error happened
# confirm, that `[is_iterator:yes]` text is displayed somewhere on the page (before the patch it would have `no` instead of `yes`
* in Database browser
# open `SlowSqlCapture` table
# confirm, that record for each unique SQL (was 19 records in my case + one of records has Hits=2) are created
# confirm, that records mentioning `SlowSqlCapture` and `StatisticsCapture` tables are not logged
# Plan (part 2 - load balancer logging)
* in Database Manager:
# clear contents of `SlowSqlCapture` and `StatisticsCapture` tables in the database
* in IDE:
1. open `/system/config.php` file for editing
2. add this code fragment at the end (adjust DB username/password to match the ones you're using):
```
lang=php
$_CONFIG['Databases'] = array(
array(
'DBHost' => 'localhost',
'DBUser' => 'db-username',
'DBUserPassword' => 'db-password',
'DBLoad' => 1,
),
);
```
3. save changes
* repeat tests from `Plan (part 1 - general & iterator logging)`
* one extra SQL (the `SHOW PROCESSLIST` would be logged, when load balancer is used, but that's fine)