5.0.0 - 严重 - 未处理
代码:$fields = '`id`,`pid`,`bus_id`,`batch_id`,`status`,`times`,`data`,`createtime`,`updatetime`';
$sql = "LOAD DATA LOCAL INFILE '{$file}'
into table `task_queue`
fields terminated by '|'
enclosed by '|'
lines terminated by ';' ({$fields});
";
$count = Db::connect('dbname')->execute($sql);
if ($count === false) {
Log::error("loadDB fail");
return false;
}
Log::info(" loadDB succes,count[{$count}]");
报错:
[ 2018-09-19T18:21:37+08:00 ][ error ] 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.
