[TypeError]
think\db\PDOConnection::pdoQuery(): Return value must be of type array, null returned
Exception trace:
() at /www/vendor/topthink/think-orm/src/db/PDOConnection.php:727
think\db\PDOConnection->pdoQuery() at /www/vendor/topthink/think-orm/src/db/PDOConnection.php:919
think\db\PDOConnection->find() at /www/vendor/topthink/think-orm/src/db/BaseQuery.php:1361
think\db\BaseQuery->find() at /www/find.php:13
{closure}() at /www/find.php:15
复现代码
find.php
<?php
declare(strict_types=1);
use app\model\Article;
require __DIR__ . '/vendor/autoload.php';
(new \think\App(__DIR__))->console;
(function () {
for ($i = 0; $i < 100000; $i++) {
Article::cache(86400)->find(200085);
}
})();
update.php
<?php
declare(strict_types=1);
use app\model\Article;
require __DIR__ . '/vendor/autoload.php';
(new \think\App(__DIR__))->console;
(function () {
for ($i = 0; $i < 100000; $i++) {
$article = Article::cache(86400)->find(200085);
++$article->read_count;
$article->save();
}
})();
错误日志
复现代码
find.php
update.php
复现步骤
php find.php
php update.php
Gif 演示