39 return 'Fragmented Rollback Test';
52 return 'A test to find fragmented rollback entries';
66 public static function test(&$messages, &$errors)
72 $sql =
'SELECT count(*) FROM (SELECT assetid, attrid, count(*) AS id FROM sq_rb_ast_attr_val WHERE sq_eff_to is null GROUP BY assetid, attrid HAVING count(*) > 1)';
75 if (!empty($result)) {
77 $messages[] =
'There are '.$result.
' fragmented entries on sq_ast_attr_val table';
81 $sql =
'SELECT count(*) FROM (SELECT url, name, count(*) AS id FROM sq_rb_ast_lookup_value WHERE sq_eff_to is null GROUP BY url, name HAVING count(*) > 1)';
84 if (!empty($result)) {
86 $messages[] =
'There are '.$result.
' fragmented entries on sq_ast_lookup_value table';
90 $sql =
'SELECT count(*) FROM (SELECT url, assetid, root_urlid, count(*) AS id FROM sq_rb_ast_lookup WHERE sq_eff_to is null GROUP BY url, assetid, root_urlid HAVING count(*) > 1)';
93 if (!empty($result)) {
95 $messages[] =
'There are '.$result.
' fragmented entries on sq_ast_lookup table';
99 $sql =
'SELECT count(*) FROM (SELECT assetid, count(*) AS id FROM sq_rb_ast WHERE sq_eff_to is null GROUP BY assetid HAVING count(*) > 1)';
102 if (!empty($result)) {
104 $messages[] =
'There are '.$result.
' fragmented entries on sq_ast table';