Description
$logger = new LoggerAppenderPDO();
$logger->setUser($sys_dbuser);
$logger->setPassword($sys_dbpasswd);
$logger->setDSN($dsn);
$logger->setTable('forge_upgrade_log');
$logger->setInsertSql('INSERT INTO forge_upgrade_log (timestamp, logger, level, message, thread, file, line) VALUES (?,?,?,?,?,?,?)');
$logger->setInsertPattern('%d,%c,%p,%m,%t,%F,%L');
$logger->activateOptions();
Throw:
PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2014 Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.' in lib/log4php/appenders/LoggerAppenderPDO.php:161
Patch:
diff --git a/lib/log4php/appenders/LoggerAppenderPDO.php b/lib/log4php/appenders/LoggerAppenderPDO.php
index 8fadd00..f9503a3 100644
— a/lib/log4php/appenders/LoggerAppenderPDO.php
+++ b/lib/log4php/appenders/LoggerAppenderPDO.php
@@ -126,6 +126,7 @@ class LoggerAppenderPDO extends LoggerAppender {
// test if log table exists
try
catch (PDOException $e) {
// It could be something else but a "no such table" is the most likely
$result = false;