commit 74f22addc intruduced a bug that results in copying eg.
july CDRs into august backup table. datetime obejcts are not
immutable, so clone it before modifying.
Change-Id: I12a52b1de7f4f5f68397148cd206035d2ac0b6b7
mariadb version > 10.1 changed the default row_format
from COMPACT to DYNAMIC. system upgraded to 7.5 therefore
end up with table partitions with different row_format, since
creating tables do not honour row_format (mysql bug 95478).
this in turn causes "ALTER TABLE .. EXCHANGE PARTITION .."
statements to fail with an error 1731 ("non matching attribute
ROW_FORMAT between table and partition", see MDEV-26027).
a manual mitigation would mean to align the row_formats
using "ALTER TABLE .. ROW_FORMAT = ..". But this in turn can
result fail with erro 1118 ("row size too large") for tables
with many&long columns (ie. accounting.cdr).
this fix will now mitigate the situation by falling back to
the built-in rowcopy method, if it detects mismatching
row_format.
Change-Id: Ief220be41b2350fa1437b6f35d46d1811facb57f
* cleanup_data():
- print error message when deletion from a table
fails (usually a non-exiting table is provided)
- amount of affected rows is set to 0 if undefined
Change-Id: I066041aae5d6a65c766480a2bbaf976c6563d188
* if a use-partitioning is enabled for a table
and this table is not suitable for it, the table
is processed using the sql backup method.
Change-Id: Ia3d8bc4701cc31fed54465227e49ec4563e5c100
* backup-months is replaced by keep-months
* backup-retro is removed, now everything that is
below keep-months is backed up
* backup-months and backup-retro are marked as deprecated
and acc-cleanup stops with the a mandatory request to
upgrade the config file
* "over-a-year" months difference is now correctly calculated
* slightly simplified min-max dates calculations and iterations
Change-Id: If1e4ae95713a06dc140a4c1f322d23e496493dda
* timestamp-column parameter is fetched before time-column
as it is set to time-column afterwards
* use only time-column env variable
Change-Id: I2330c3e1f88af51217a57d5052c277c45afc8460
* if the target backup table already exists
(for instance the original table got some new data
for previous periods)
it is not possible to exchange partitions with that table
anymore so the normal backup method is used for the table
as a fallback.
Change-Id: I2336a5867fc4445feb29962b0981d1d79fa88140
* start_time cannot be used there as a constant because
cdr_* extended tables have a different name for the column
Change-Id: I79b030e6a8b6d6e855f9ed7c0a1509685ab34e7f
* the extra partition that are below checked range
of ones to backup is also dropped now
* adjusted debug messages
Change-Id: I1e8cb156951313651f11b94e6ff605e2a579cdf2
* logic moved to NGCP::Cleanup
* refactored NGCP::Cleanup to support OO, logging
* implemented table partitioning support
* optimized speed for key columns containing timestamps
Change-Id: I8eaec0f42d15de30daf65753e5f04bc9b104c9cc