-
Notifications
You must be signed in to change notification settings - Fork 8k
Use MYSQL_TYPE constants instead of FIELD_TYPE #20249
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: PHP-8.3
Are you sure you want to change the base?
Conversation
switch (type) { | ||
PDO_MYSQL_NATIVE_TYPE_NAME(STRING) | ||
PDO_MYSQL_NATIVE_TYPE_NAME(VAR_STRING) | ||
#ifdef FIELD_TYPE_TINY |
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.
Don't you need to replace these as well?
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.
My bad, of course
Ah darn it, those are part of an enum so you can't ifdef them... |
a854305
to
e0f5635
Compare
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.
e0f5635
to
0c81682
Compare
ext/pdo_mysql/mysql_statement.c
Outdated
PDO_MYSQL_NATIVE_TYPE_NAME(VECTOR) | ||
#endif | ||
#ifdef FIELD_TYPE_JSON | ||
#if MYSQL_VERSION_ID >= 80000 || defined(PDO_USE_MYSQLND) |
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 JSON
type was added in MySQL 5.7.8.
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.
Huh indeed. Thanks. Looks like it got backported in mysql/mysql-server@3e14f9f in 5.7.8, adjusting again...
JSON support was backported via mysql/mysql-server@3e14f9f in 5.7.8.
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 GH-20245.