Skip to content

Commit 6c7ff08

Browse files
Drop MYSQLI_CURSOR_TYPE_FOR_UPDATE & MYSQLI_CURSOR_TYPE_SCROLLABLE (php#15486)
1 parent 4baf6a6 commit 6c7ff08

File tree

8 files changed

+4
-33
lines changed

8 files changed

+4
-33
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,9 @@ PHP 8.4 UPGRADE NOTES
876876
has been removed.
877877
. The MYSQLI_STMT_ATTR_PREFETCH_ROWS constant has been removed.
878878
The feature is unavailable with mysqlnd.
879+
. The MYSQLI_CURSOR_TYPE_FOR_UPDATE and MYSQLI_CURSOR_TYPE_SCROLLABLE
880+
constants have been removed. This functionality was never implemented,
881+
neither with mysqlnd nor with libmysql.
879882

880883
- OpenSSL:
881884
. The OpenSSL extension now requires at least OpenSSL 1.1.1.

ext/mysqli/mysqli.stub.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,16 +181,6 @@
181181
* @cvalue CURSOR_TYPE_READ_ONLY
182182
*/
183183
const MYSQLI_CURSOR_TYPE_READ_ONLY = UNKNOWN;
184-
/**
185-
* @var int
186-
* @cvalue CURSOR_TYPE_FOR_UPDATE
187-
*/
188-
const MYSQLI_CURSOR_TYPE_FOR_UPDATE = UNKNOWN;
189-
/**
190-
* @var int
191-
* @cvalue CURSOR_TYPE_SCROLLABLE
192-
*/
193-
const MYSQLI_CURSOR_TYPE_SCROLLABLE = UNKNOWN;
194184

195185
/* column information */
196186
/**

ext/mysqli/mysqli_api.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,8 +1740,6 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
17401740
switch (mode_in) {
17411741
case CURSOR_TYPE_NO_CURSOR:
17421742
case CURSOR_TYPE_READ_ONLY:
1743-
case CURSOR_TYPE_FOR_UPDATE:
1744-
case CURSOR_TYPE_SCROLLABLE:
17451743
break;
17461744
default:
17471745
zend_argument_value_error(ERROR_ARG_POS(3), "must be one of the MYSQLI_CURSOR_TYPE_* constants "

ext/mysqli/mysqli_arginfo.h

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/mysqli/tests/mysqli_constants.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ $expected_constants = array_merge($expected_constants, array(
133133
"MYSQLI_STMT_ATTR_CURSOR_TYPE" => true,
134134
"MYSQLI_CURSOR_TYPE_NO_CURSOR" => true,
135135
"MYSQLI_CURSOR_TYPE_READ_ONLY" => true,
136-
"MYSQLI_CURSOR_TYPE_FOR_UPDATE" => true,
137-
"MYSQLI_CURSOR_TYPE_SCROLLABLE" => true,
138136
));
139137

140138
$expected_constants['MYSQLI_OPT_SSL_VERIFY_SERVER_CERT'] = true;

ext/mysqli/tests/mysqli_report.phpt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,6 @@ require_once 'skipifconnectfailure.inc';
5959
}
6060
mysqli_next_result($link);
6161

62-
$stmt = mysqli_prepare($link, "SELECT 1");
63-
mysqli_stmt_attr_set($stmt, MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_FOR_UPDATE);
64-
6562
// Check that none of the above would have caused any error messages if MYSQL_REPORT_ERROR would
6663
// not have been set. If that would be the case, the test would be broken.
6764
mysqli_report(MYSQLI_REPORT_OFF);
@@ -89,9 +86,6 @@ require_once 'skipifconnectfailure.inc';
8986
}
9087
mysqli_next_result($link);
9188

92-
$stmt = mysqli_prepare($link, "SELECT 1");
93-
mysqli_stmt_attr_set($stmt, MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_FOR_UPDATE);
94-
9589
/*
9690
Internal macro MYSQL_REPORT_STMT_ERROR
9791
*/
@@ -330,8 +324,6 @@ Warning: mysqli_next_result(): (%s/%d): You have an error in your SQL syntax; ch
330324

331325
Warning: mysqli_store_result(): (%s/%d): You have an error in your SQL syntax; check the manual that corresponds to your %s server version for the right syntax to use near 'FOO' at line 1 in %s on line %d
332326

333-
Warning: mysqli_stmt_attr_set(): (%s/%d): Not implemented in %s on line %d
334-
335327
Deprecated: Function mysqli_kill() is deprecated since 8.4, use KILL CONNECTION/QUERY SQL statement instead in %s
336328
mysqli_kill(): Argument #2 ($process_id) must be greater than 0
337329

ext/mysqli/tests/mysqli_stmt_attr_set.phpt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,6 @@ require_once 'skipifconnectfailure.inc';
100100
echo $e->getMessage() . \PHP_EOL;
101101
}
102102

103-
if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_FOR_UPDATE)))
104-
printf("[011] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
105-
106-
if (false !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_SCROLLABLE)))
107-
printf("[012] Expecting boolean/false, got %s/%s\n", gettype($tmp), $tmp);
108-
109103
if (true !== ($tmp = $stmt->attr_set(MYSQLI_STMT_ATTR_CURSOR_TYPE, MYSQLI_CURSOR_TYPE_NO_CURSOR)))
110104
printf("[013] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);
111105

ext/mysqlnd/mysqlnd_enum_n_def.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,8 +406,6 @@ enum myslqnd_cursor_type
406406
{
407407
CURSOR_TYPE_NO_CURSOR= 0,
408408
CURSOR_TYPE_READ_ONLY= 1,
409-
CURSOR_TYPE_FOR_UPDATE= 2,
410-
CURSOR_TYPE_SCROLLABLE= 4
411409
};
412410

413411
typedef enum mysqlnd_connection_close_type

0 commit comments

Comments
 (0)