Closed vkviyu closed 5 months ago
Please write issues in English, please.
It is because "dbal:run-sql" recognize your sql as a statement, not a query. You can use "force-fetch" option to force run query.
Check \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand::doExecute
Bug Report
Summary
在使用Doctrine的
dbal:run-sql
命令执行SQL查询时,没有正确地输出查询结果,而是显示"0 rows affected"。Current behavior
当我运行
php doctrine.php dbal:run-sql "show databases"
命令时,我期望看到我所有的数据库列表。但是,实际上我看到的输出是"0 rows affected",并没有显示任何数据库。How to reproduce
在doctrine.php文件中,设置数据库连接参数。如下图:
在终端中,运行
php doctrine.php dbal:run-sql "show databases"
命令。如下图:Expected behavior
我期望
dbal:run-sql
命令能正确地输出SQL查询的结果。在这个例子中,我期望看到我所有的数据库列表。我不确定这个 bug 在新版本的 doctrine/orm 中是否得到了解决,但因为一些原因我无法去升级我的 php 版本。