Preparations
- replace contents of the /modules/custom/install/project_upgrades.sql file with this (replace 52x_ with your table prefix from /system/config.php):
# r1: Initial Project Task (#TASK_ID) SELECT SLEEP(2); SELECT SLEEP(7); # r2: Another Task (#TASK_ID2) SELECT SLEEP(65); SELECT Version FROM `52x_Modules`; # r3: Yet Another Task (#TASK_ID3) SELECT SLEEP(354); SELECT Version FROM `52x_Modules`;
- clear contents of /system/.restricted/project_upgrades.log file
- execute UPDATE 52x_Modules` SET AppliedDBRevisions = NULL; (replace 52x_` with your table prefix from /system/config.php) database query
Test 1 itself (takes 7-8 minutes to execute !!!)
- run the php tools/run_event.php adm:OnDeploy b674006f3edb1d9cd4d838c150b0567d script
- confirm, that contents of SQL-related part of deployment script output looks like this:
# r1: Initial Project Task (#TASK_ID) SELECT SLEEP(2) ... OK (1) *Time*: 2s SELECT SLEEP(7) ... OK (1) *Time*: 7s # r2: Another Task (#TASK_ID2) SELECT SLEEP(65) ... OK (1) *Time*: 1m 5s SELECT Version FROM `52x_Modules` ... OK (7) *Time*: 0s # r3: Yet Another Task (#TASK_ID3) SELECT SLEEP(354) ... OK (1) *Time*: 5m 54s SELECT Version FROM `52x_Modules` ... OK (7) *Time*: 0s Total SQL Time: 7m 8s
- confirm, that from the above output:
- the *Time*: 2s, *Time*: 7s and *Time*: 0s text is shown in regular green color (as OK text before it)
- the *Time*: 1m 5s text is shown in cyan bold color
- the *Time*: 5m 54s and Total SQL Time: 7m 8s text is shown in red bold color
- the Total SQL Time: 7m 8s text represents total SQL run time across all executed SQL revisions
- confirm, that text added into /system/.restricted/project_upgrades.log looks like this (execution start/end date/times would be different, but durations must match):
[2020-12-28 16:39:08] === === # r1: Initial Project Task (#TASK_ID) SELECT SLEEP(2); ... OK (1) Duration: 2s (from 2020-12-28 16:39:08 to 2020-12-28 16:39:10) SELECT SLEEP(7); ... OK (1) Duration: 7s (from 2020-12-28 16:39:10 to 2020-12-28 16:39:17) # r2: Another Task (#TASK_ID2) SELECT SLEEP(65); ... OK (1) Duration: 1m 5s (from 2020-12-28 16:39:17 to 2020-12-28 16:40:22) SELECT Version FROM `52x_Modules`; ... OK (7) Duration: 0s (from 2020-12-28 16:40:22 to 2020-12-28 16:40:22) # r3: Yet Another Task (#TASK_ID3) SELECT SLEEP(354); ... OK (1) Duration: 5m 54s (from 2020-12-28 16:40:22 to 2020-12-28 16:46:16) SELECT Version FROM `52x_Modules`; ... OK (7) Duration: 0s (from 2020-12-28 16:46:16 to 2020-12-28 16:46:16) Total Duration: 7m 8s
Test 2
- add up these lines to the /modules/custom/install/project_upgrades.sql file (replace 52x_ with your table prefix from /system/config.php):
# r4: Initial Project Task (#TASK_ID) SELECT SLEEP(2); ERROR;
- run the php tools/run_event.php adm:OnDeploy b674006f3edb1d9cd4d838c150b0567d script
- confirm, that the contents of the SQL-related part of deployment script output look like this:
# r4: Initial Project Task (#TASK_ID) SELECT SLEEP(2) ... OK (1) *Time*: 2s ERROR ... FAILED SQL Error #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ERROR' at line 1 Please execute rest of SQLs in this Revision by hand and run deployment script again. Total SQL Time: 2s
- confirm, that text added into /system/.restricted/project_upgrades.log looks like this (execution start/end date/times would be different, but durations must match):
[2021-04-30 18:23:08] === === # r4: Initial Project Task (#TASK_ID) SELECT SLEEP(2); ... OK (1) Duration: 2s (from 2021-04-30 18:23:08 to 2021-04-30 18:23:10) ERROR; ... FAILED SQL Error #1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ERROR' at line 1 Total SQL Duration: 2s