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:
- disable debug mode
- open /system/debug.php file for editing
- uncomment DBG_CAPTURE_STATISTICS and DBG_MAX_SQL_TIME constant declarations
- set 0 (instead of current value of 2) as value for DBG_MAX_SQL_TIME constant
- save changes
- open /index.php file for editing
- after $application->Init(); line add this code:
$rows = $application->Conn->GetIterator('SELECT * FROM ' . TABLE_PREFIX . 'Languages', null, true); echo '[is_iterator:' . (is_object($rows) ? 'yes' : 'no') . ']';
- 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:
- open /system/config.php file for editing
- add this code fragment at the end (adjust DB username/password to match the ones you're using):
$_CONFIG['Databases'] = array( array( 'DBHost' => 'localhost', 'DBUser' => 'db-username', 'DBUserPassword' => 'db-password', 'DBLoad' => 1, ), );
- 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)