Closed chongzi5210 closed 6 years ago
可否提供一个可重现的Demo?
用上面的这个代码就可以测试 写一个不能执行的sql 语句就可以。
Swoft\Db\Driver\Mysql\MysqlConnection
不使用事务,也会有 Query 异常导致 getResult() 执行不到, 连接无法释放的问题
不使用事务,也会有 Query 异常导致 getResult() 执行不到, 连接无法释放的问题
这个原因我弄错了,不是getResult 执行不到, 应该是 DbCoResult getResult() line 29 $this->recv(true, false); 调用到MysqlConnection receive line 111触发异常导致
关联issue #269
swoole support => enabled Version => 4.0.1 Author => tianfeng.han[email: mikan.tenny@gmail.com] coroutine => enabled epoll => enabled eventfd => enabled timerfd => enabled signalfd => enabled cpu affinity => enabled spinlock => enabled rwlock => enabled async redis client => enabled async http/websocket client => enabled openssl => enabled Linux Native AIO => enabled pcre => enabled zlib => enabled mutex_timedlock => enabled pthread_barrier => enabled futex => enabled mysqlnd => enabled
Directive => Local Value => Master Value swoole.aio_thread_num => 2 => 2 swoole.display_errors => On => On swoole.use_namespace => On => On swoole.use_shortname => On => On swoole.fast_serialize => Off => Off swoole.unixsock_buffer_size => 8388608 => 8388608
| PHP version | PHP 7.1.14 (cli) (built: Feb 9 2018 17:34:55) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies | Runtime environment | Win10/Mac/CentOS 7/Ubuntu/Docker etc.
Details
不小心把数据表一个字段改掉了, 导致一个事务里面的sql异常, 发现一个比较奇怪的问题 ,异常被程序捕获了,做了回滚操作,发现异常处理里面rollback后面的逻辑未执行, rollback 里面抛出和sql 执行同样的错误。 rollback 执行不下去了咋办? 示例代码: