Skip to content

Commit e1a64ff

Browse files
committed
Revert "Remove MYSQLI_IS_MARIADB"
This reverts commit 062d0b7.
1 parent 062d0b7 commit e1a64ff

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

ext/mysqli/mysqli.stub.php

+6
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,12 @@
610610
*/
611611
const MYSQLI_TRANS_COR_NO_RELEASE = UNKNOWN;
612612

613+
/**
614+
* @var bool
615+
* @cname MYSQLI_IS_MARIADB
616+
*/
617+
const MYSQLI_IS_MARIADB = UNKNOWN;
618+
613619
final class mysqli_driver
614620
{
615621
/** @readonly */

ext/mysqli/mysqli_arginfo.h

+2-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/mysqli/mysqli_priv.h

+6
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ PHP_MYSQLI_EXPORT(zend_object *) mysqli_objects_new(zend_class_entry *);
107107
#define MYSQLI_REPORT_CLOSE 8
108108
#define MYSQLI_REPORT_ALL 255
109109

110+
#ifdef MARIADB_BASE_VERSION
111+
#define MYSQLI_IS_MARIADB 1
112+
#else
113+
#define MYSQLI_IS_MARIADB 0
114+
#endif
115+
110116
#define MYSQLI_REPORT_MYSQL_ERROR(mysql) \
111117
if ((MyG(report_mode) & MYSQLI_REPORT_ERROR) && mysql_errno(mysql)) { \
112118
php_mysqli_report_error(mysql_sqlstate(mysql), mysql_errno(mysql), mysql_error(mysql)); \

ext/mysqli/tests/mysqli_constants.phpt

+5-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ $expected_constants = array(
4747
"MYSQLI_GROUP_FLAG" => true,
4848
"MYSQLI_SERVER_QUERY_NO_GOOD_INDEX_USED"=> true,
4949
"MYSQLI_SERVER_QUERY_NO_INDEX_USED" => true,
50+
"MYSQLI_IS_MARIADB" => true,
5051

5152
"MYSQLI_TYPE_DECIMAL" => true,
5253
"MYSQLI_TYPE_TINY" => true,
@@ -99,7 +100,6 @@ $expected_constants = array(
99100
"MYSQLI_TRANS_COR_AND_NO_CHAIN" => true,
100101
"MYSQLI_TRANS_COR_RELEASE" => true,
101102
"MYSQLI_TRANS_COR_NO_RELEASE" => true,
102-
"MYSQLI_OPT_LOAD_DATA_LOCAL_DIR" => true,
103103
);
104104

105105
/* depends on the build - experimental */
@@ -181,6 +181,10 @@ if ($IS_MYSQLND) {
181181
$expected_constants["MYSQLI_TYPE_JSON"] = true;
182182
}
183183

184+
if (($version > 80021 && $constants['mysqli']['MYSQLI_IS_MARIADB']) || $IS_MYSQLND) {
185+
$expected_constants['MYSQLI_OPT_LOAD_DATA_LOCAL_DIR'] = true;
186+
}
187+
184188
$unexpected_constants = array();
185189

186190
foreach ($constants as $group => $consts) {

0 commit comments

Comments
 (0)