Skip to content

Commit

Permalink
Fix bigArchive partition check if DBMS quotes the name
Browse files Browse the repository at this point in the history
  • Loading branch information
Lance Edgar committed Sep 19, 2023
1 parent 79afbf2 commit e4fa1f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fannie/cron/tasks/TransArchiveTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ private function getBigArchiveSql($sql)
private function createPartitionIfNeeded($sql, $date, $bigArchive)
{
$partition_name = "p" . date("Ym", strtotime($date));
if (strstr($bigArchive, 'PARTITION ' . $partition_name . ' VALUES') === false) {
if (preg_match("/PARTITION `?$partition_name`? VALUES/", $bigArchive) === 0) {
$ts = strtotime($date);
$boundary = date("Y-m-d", mktime(0,0,0,date("n", $ts)+1,1,date("Y", $ts)));
// new partition named pYYYYMM
Expand Down

0 comments on commit e4fa1f7

Please sign in to comment.