-
Couldn't load subscription status.
- Fork 8k
Skip gh20122.phpt on pdo_mysql + libmysqlclient #20245
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
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.
Missing require __DIR__ . '/mysql_pdo_test.inc';.
It makes me wonder why it's not available with libmysqlclient.
FIELD_TYPE_JSON is a mysqlnd only feature.
f06ae2b to
0d2e3a2
Compare
Co-authored-by: Kamil Tekiela <tekiela246@gmail.com>
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.
The reason seems to be that libmysqlclient defines only MYSQL_TYPE_JSON but not FIELD_TYPE_JSON. It's worth noting that the FIELD_TYPE_* defines are actual BC aliases for MYSQL_TYPE_*. However, JSON was likely introduced much more recently than these BC aliases were, so I think a BC alias for it was never made.
Same problem for VECTOR.
Makes me wonder if it's as simple as modifying #define PDO_MYSQL_NATIVE_TYPE_NAME(x) case FIELD_TYPE_##x: return #x; to use MYSQL_TYPE_ instead of FIELD_TYPE_
|
Ahh that explains it. If you change the macro, for mysqlnd it should still work the same. As I can see the two values which are not |
|
What's the lowest version of libmysqlclient that we support? I'm asking because I'm concerned: what if MYSQL_TYPE_* doesn't exist on some version of libmysqclient we still support. That could be the reason why we use the BC aliases? |
I don't know if it's explicitely stated anywhere. I think we can assume that the latest PHP releases should definitely support all currently supported MySQL versions. As far as I know, MySQL 5 is out of support, but when PHP 8.3 was released it was still supported. I think it would be safe to assume at least MySQL 5.5 should be supported. And if the change was made before MySQL 5.1 then I am pretty sure we should not be concerned about it. |
|
I checked out the mysql 5.0.0 sources and it does have the MYSQL_TYPE_* constants, so I believe it's safe to change. |
The FIELD_TYPE constants are for BC. The JSON/VECTOR types are not defined in FIELD_TYPE for libmysqlclient. MYSQL_TYPE appears to be available since MYSQL 5.0.0, so switch to that. Replaces phpGH-20245.
The FIELD_TYPE constants are for BC. The JSON/VECTOR types are not defined in FIELD_TYPE for libmysqlclient. MYSQL_TYPE is available since MYSQL 5.0.0, so switch to that. Since MYSQL_TYPEs are enums and not defines, we need version checks instead. JSON was added in mysql 8.0.0 in mysql/mysql-server@c24045514581 VECTOR was added in mysql 9.0.0 in mysql/mysql-server@8cd51511de7d Replaces phpGH-20245.
The FIELD_TYPE constants are for BC. The JSON/VECTOR types are not defined in FIELD_TYPE for libmysqlclient. MYSQL_TYPE is available since MYSQL 5.0.0, so switch to that. Since MYSQL_TYPEs are enums and not defines, we need version checks instead. JSON was added in mysql 8.0.0 in mysql/mysql-server@c24045514581 VECTOR was added in mysql 9.0.0 in mysql/mysql-server@8cd51511de7d Replaces phpGH-20245.
The FIELD_TYPE constants are for BC. The JSON/VECTOR types are not defined in FIELD_TYPE for libmysqlclient. MYSQL_TYPE is available since MYSQL 5.0.0, so switch to that. Since MYSQL_TYPEs are enums and not defines, we need version checks instead. JSON was added in mysql 8.0.0 in mysql/mysql-server@c24045514581 JSON support was backported via mysql/mysql-server@3e14f9f in 5.7.8. VECTOR was added in mysql 9.0.0 in mysql/mysql-server@8cd51511de7d Replaces GH-20245.
FIELD_TYPE_JSON is a mysqlnd only feature.
See https://github.com/php/php-src/actions/runs/18639444525/job/53135588528#step:6:91.