swoft-cloud / swoft

🚀 PHP Microservice Full Coroutine Framework
https://swoft.org
Apache License 2.0
5.58k stars 788 forks source link

sql 语句查询出错 #120

Closed aprchen closed 6 years ago

aprchen commented 6 years ago
Q A
Bug report? yes
Feature request? yes/no
Swoft version beta
Swoole version 2.1.0
PHP version 7.1.4

Details 只配置主数据库,可以通过命令行生成实体,但是直接通过sql语句查询,无法查询

error.log
     2018/03/05 06:07:39 [error] [swoft] [logid:5a9cdeab04f66] [spanid:0] trace[AopHandler.php:42,Swoft\Proxy\Handler\AopHandler->invoke] mysql执行出错,connectError= error=
2018/03/05 06:07:39 [warning] [swoft] [logid:5a9cdeab04f66] [spanid:0] trace[AopHandler.php:42,Swoft\Proxy\Handler\AopHandler->invoke] Key 2-select * from sl_book-transaction-swoft does not exist
2018/03/05 06:07:39 [warning] [swoft] [logid:5a9cdeab04f66] [spanid:0] trace[AopHandler.php:42,Swoft\Proxy\Handler\AopHandler->invoke] Key contextConnects does not exist
2018/03/05 06:07:39 [warning] [swoft] [logid:5a9cdeab2824c] [spanid:0] trace[AopHandler.php:42,Swoft\Proxy\Handler\AopHandler->invoke] Key contextConnects does not exist

notice.log

2018/03/05 06:07:37 [notice] [swoft] [logid:5a9cdea99d433] [spanid:0] [0.74(ms)] [8(MB)] [process-cronTimer] [] profile[] counting[]
2018/03/05 06:07:37 [notice] [swoft] [logid:5a9cdea9a4fa8] [spanid:0] [0.79(ms)] [8(MB)] [process-cronExec] [] profile[] counting[]
2018/03/05 06:07:39 [debug] [swoft] [logid:5a9cdeab04f66] [spanid:0] trace[AopHandler.php:42,Swoft\Proxy\Handler\AopHandler->invoke] sql execute sqlId=d41d8cd98f00b204e9800998ecf8427e, sql=
2018/03/05 06:07:39 [debug] [swoft] [logid:5a9cdeab04f66] [spanid:0] trace[AopHandler.php:42,Swoft\Proxy\Handler\AopHandler->invoke] SQL语句执行结果(defer) sqlId=mysql result=false
2018/03/05 06:07:39 [notice] [swoft] [logid:5a9cdeab04f66] [spanid:0] [18.17(ms)] [8(MB)] [http://localhost:9501/] [] profile[] counting[]
2018/03/05 06:07:39 [notice] [swoft] [logid:5a9cdeab2824c] [spanid:0] [0.34(ms)] [8(MB)] [http://localhost:9501/favicon.ico] [] profile[] counting[]

Provide minimal script to reproduce the issue

 $sql = "select * from sl_book";
        $em = EntityManager::create();
        $query = $em->createQuery($sql);
        $res = $query->execute()->getResult();
        $em->close();
aprchen commented 6 years ago

image

stelin commented 6 years ago

已经修复,代码更新测试