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 459d522
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fannie/cron/tasks/TransArchiveTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ 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 459d522

Please sign in to comment.