-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve MySQLReplication BinaryDataReader #11
Conversation
- Add support for reading 64-bit unsigned integers - Change the return type of `readUInt56()` from `string` to `int`
也不晓得这样处理是否合理 |
@huangdijia 能提供出现问题时的 MySQL 版本和PHP版本吗? |
CHARSET=latin1 的字段就会报错 |
需要提供具体, mysql版本, 创建表语句 |
Mysql版本:5.7.22 建表语句: CREATE TABLE `my_table` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL COMMENT '會員ID',
`community_id` int(11) NOT NULL DEFAULT '0' COMMENT '社区ID',
`cases_id` int(11) NOT NULL COMMENT '建案id',
`status` tinyint(2) NOT NULL COMMENT '狀態: 0 未使用 1 已過期 2 開啟 3 已成交 4 已成交',
`closed` tinyint(2) NOT NULL COMMENT '是否關閉: 0 未關閉 1 關閉中 2 回收站',
`living` set('depart','advstore','market','night','park','school','hospital','police') NOT NULL DEFAULT '' COMMENT '生活機能',
`housetype` tinyint(2) NOT NULL COMMENT '經辦者',
`isdeleted` tinyint(1) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; |
这是我改变 /**
* @test
*/
public function shouldBeSet(): void
{
$createQuery = <<<EOT
CREATE TABLE `my_table` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL COMMENT '會員ID',
`community_id` int(11) NOT NULL DEFAULT '0' COMMENT '社区ID',
`cases_id` int(11) NOT NULL COMMENT '建案id',
`status` tinyint(2) NOT NULL COMMENT '狀態: 0 未使用 1 已過期 2 開啟 3 已成交 4 已成交',
`closed` tinyint(2) NOT NULL COMMENT '是否關閉: 0 未關閉 1 關閉中 2 回收站',
`living` set('depart','advstore','market','night','park','school','hospital','police') NOT NULL DEFAULT '' COMMENT '生活機能',
`housetype` tinyint(2) NOT NULL COMMENT '經辦者',
`isdeleted` tinyint(1) NOT NULL COMMENT '是否删除',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
EOT;
;
$insertQuery = 'INSERT INTO my_table VALUES(null, 1, 1, 1, 1, 1, "park,school", 1, 0)';
$event = $this->createAndInsertValue($createQuery, $insertQuery);
self::assertEquals(['park', 'school'], $event->getValues()[0]['living']);
} 根据#10 的堆栈分析: 得到的 |
我测试了,跟协程环境没有关系,确实存在 |
提供下PHP版本。 |
$ php -v
PHP 8.1.18 (cli) (built: Apr 12 2023 12:31:46) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.18, Copyright (c) Zend Technologies
with Zend OPcache v8.1.18, Copyright (c), by Zend Technologies
|
@huangdijia 希望能提供下单元测试,这个是我本机的 docker run -e MYSQL_ROOT_PASSWORD=123456 -p 3306:3306 mysql:5.7 --default-authentication-plugin=mysql_native_password --server-id=1 --log_bin --expire_logs_days=10 --max_binlog_size=100M --binlog-format=row |
fix #10
readUInt56()
fromstring
toint