# Part 1 (doInsert)
# open `/index.php` file for editing
# replace line after `$application->Init();` line with `$application->Conn->doInsert(array('F1' => 'V1'), 'sample table');`
# save changes
# open Front-End
# confirm, that INSERT SQL error, shown in debugger, has table name (the `sample table`) unescaped
# Part 2 (doUpdate)
# open `/index.php` file for editing
# replace line after `$application->Init();` line with `$application->Conn->doUpdate(array('F1' => 'V1'), 'sample table', 'TRUE');`
# save changes
# open Front-End
# confirm, that UPDATE SQL error, shown in debugger, has table name (the `sample table`) unescaped
# Part 3 (prepare data)
# login to Admin Console
# go to {nav Configuration > Website > Advanced} section
# enable `Track database changes to change log` system setting
# save changes
# re-login (to create session log record) to the Admin Console
# execute this SQL (use actual table prefix instead of "52x_"):
```
ALTER TABLE `52x_Users` DROP INDEX `ResourceId`, ADD UNIQUE INDEX `ResourceId` (`ResourceId`,`PortalUserId`) USING BTREE;
ALTER TABLE 52x_Users PARTITION BY RANGE (PortalUserId) (
PARTITION FirstHundredUsers VALUES LESS THAN (100),
PARTITION OtherUsers VALUES LESS THAN (MAXVALUE)
);
```
# Part 3 (test itself)
## Test Data
Try this test with every LEFT JOIN clause from below:
* `LEFT JOIN '.TABLE_PREFIX.'Users ON '.TABLE_PREFIX.'Users.PortalUserId = %1$s.PortalUserId` (for this test replace `'u.` in calculated fields with `TABLE_PREFIX . 'Users.`, and once finished replace back)
* `LEFT JOIN '.TABLE_PREFIX.'Users AS u ON u.PortalUserId = %1$s.PortalUserId`
* `LEFT JOIN '.TABLE_PREFIX.'Users AS u USE INDEX (Username) ON u.PortalUserId = %1$s.PortalUserId`
* `LEFT JOIN '.TABLE_PREFIX.'Users PARTITION (FirstHundredUsers) AS u USE INDEX (Username) ON u.PortalUserId = %1$s.PortalUserId`
* `LEFT JOIN '.TABLE_PREFIX.'Users PARTITION (FirstHundredUsers) AS u ON u.PortalUserId = %1$s.PortalUserId`
## Test
# open `core/units/logs/session_logs/session_logs_config.php` file for editing
# change `LEFT JOIN` clause of the ListSQL to above provided
# save changes
# login to Admin Console
# go to {nav Logs & Reports > Session Log} section
# open debugger
# confirm, that COUNT(*) clause for this grid doesn't have "LEFT JOIN" to "Users" table
# confirm, that no SQL error happened
# confirm, that no notices/warnings/errors happens
# filter by any non-empty value in the "First Name" column
# confirm, that COUNT(*) clause for this grid has "LEFT JOIN" to "Users" table
# confirm, that no SQL error happened
# confirm, that no notices/warnings/errors happens
# remove filter