-
Notifications
You must be signed in to change notification settings - Fork 102
fix #115 for mysql 8.4.0 #116
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi tx for contribution
1, Fix tests
- MySQLReplication\Tests\Unit\Repository\MySQLRepositoryTest::testShouldGetVersion
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'foobar123'
+''
run composer cs:fix
to fix code style
Any status of this PR or is there some other php 8.4 fixes in the works? |
My project used this pr in product env. |
…deprecated, the explicit nullable type must be used instead
@krowinski now with more mysql versions in test suite, maybe this has a chance to be tested and (maybe) merged? |
@cyppe resolve conflict pls |
tests are failing There were 2 failures:
/home/runner/work/php-mysql-replication/php-mysql-replication/tests/Unit/BinaryDataReader/BinaryDataReaderTest.php:138
/home/runner/work/php-mysql-replication/php-mysql-replication/tests/Unit/BinaryDataReader/BinaryDataReaderTest.php:190 FAILURES! |
Because I change return value of Int64 type like default PDO::ATTR_STRINGIFY_FETCHES=false OR MYSQLI_OPT_INT_AND_FLOAT_NATIVE , Int64 may string or int value. CREATE TABLE `test` (
`id` bigint unsigned NOT NULL DEFAULT '0',
`show` int DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
insert into test(id) values(9223372036854775807),(9223372036854775808); try {
// 数据库配置
$host = '127.0.0.1';
$db = 'test'; // 你的数据库名
$user = 'root'; // 数据库用户名
$pass = ''; // 数据库密码
$port = "3306";
$charset = 'utf8mb4';
// 设置DSN(数据源名称)
$dsn = "mysql:host=$host;dbname=$db;charset=$charset;port=$port";
// 设置PDO选项
$options = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, // 抛出异常错误
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, // 获取关联数组
PDO::ATTR_EMULATE_PREPARES => false, // 关闭模拟预处理
];
// 创建PDO实例
$pdo = new PDO($dsn, $user, $pass, $options);
// 编写SQL语句
$sql = "SELECT * FROM test"; // 假设你有一个users表
var_dump(PHP_INT_MAX);
var_dump(PHP_INT_MIN);
// 执行查询
$stmt = $pdo->query($sql);
// 获取结果
while ($row = $stmt->fetch()) {
var_dump($row);
}
} catch (\PDOException $e) {
// 处理连接错误
throw new \PDOException($e->getMessage(), (int)$e->getCode());
} |
No description provided.