From b237e7e4b13bf9f8ef061eaee0d8e834721f30db Mon Sep 17 00:00:00 2001 From: Vladyslav Podorozhnyi Date: Fri, 8 Dec 2023 21:32:53 +0100 Subject: [PATCH] Fix integration tests Test: \Magento\Framework\Backup\DbTest::testBackupAndRollbackIncludesCustomTriggers Error: Unable to revert fixture: Magento/Framework/Backup/_files/trigger.php #0 /var/www/html/dev/tests/integration/testsuite/Magento/Framework/Backup/DbTest.php(42): Magento\Framework\Backup\DbTest->testBackupAndRollbackIncludesCustomTriggers() --- library/Zend/Db/Statement.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/library/Zend/Db/Statement.php b/library/Zend/Db/Statement.php index 46d175c..b4307ab 100644 --- a/library/Zend/Db/Statement.php +++ b/library/Zend/Db/Statement.php @@ -209,6 +209,12 @@ protected function _stripQuoted($sql) // remove "foo\"bar" $sql = preg_replace("/\"(\\\\\"|[^\"])*\"/Us", '', $sql); + if ($sql === null) { + // this preg_replace call can return NULL in case of error (PREG_BACKTRACK_LIMIT_ERROR). + // In this case the result of this method will be an empty string. + return ''; + } + // get the character for delimited id quotes, // this is usually " but in MySQL is ` $d = $this->_adapter->quoteIdentifier('a');