core: repair ERP5Site_reindexLatestIndexedObjects
This script stopped working since Catalog changed to be ERP5 document, because it was calling the unindex method of the catalog (which itself is indexable like any other ERP5 document). Update to use the uncatalogObject which is the method to unindex a document by uid. Even though it was somehow working before, it was not really correct in selecting objects, because it was using - operator on TIMESTAMP column, which is not computing a difference in seconds as this script was expecting. See for example https://stackoverflow.com/a/24504132/7607763 or the example below for an explanation. Instead, use TIMESTAMPADD to compute the start timestamp only once and use >= operator, which works as expected. This query was also sorting by indexation_timestamp, which does not use an index. Remove the sort because it's not really needed. Excluding reserved path was also not needed, we no longer use these since 69aefdff (ZSQLCatalog: Drop support for "reserved" path., 2017-09-18) --- Another reproduction of the timestamp arithmetic problem select TIMESTAMP('2021-01-02 00:00:00') - TIMESTAMP('2021-01-01 00:00:00') a, 20210102000000 - 20210101000000 aa, TIMESTAMP('2021-06-01 00:00:00') - TIMESTAMP('2021-05-31 00:00:00') b, 20210601000000 - 20210531000000 bb, TIMESTAMPDIFF(second, TIMESTAMP('2021-05-31 00:00:00'), TIMESTAMP('2021-06-01 00:00:00')) c | a | aa | b | bb | c | | ------ | ------ | ------ | ------ | ------ | | 1000000 | 1000000 | 70000000 | 70000000 | 86400 |
Status | Job ID | Name | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
External | |||||||||
running |
#477425
external
|
ERP5.CodingStyleTest-Master |
21613:29:46 |
||||||
running |
#477422
external
|
ERP5.PerformanceTest-Master |
21613:30:00 |
||||||
running |
#477426
external
|
ERP5.UnitTest-Master |
21613:29:44 |
||||||
running |
#477442
external
|
ERP5.UnitTest-Master.Medusa |
21613:29:35 |
||||||
running |
#477439
external
|
SlapOS.Eggs.UnitTest-Master.Python2 |
21613:29:36 |
||||||
running |
#477445
external
|
SlapOS.Eggs.UnitTest-Master.Python3 |
21613:29:34 |
||||||