Skip to content

Commit e096674

Browse files
committed
Nits
1 parent 234868f commit e096674

11 files changed

+19
-15
lines changed

ext/mysqli/mysqli.stub.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ function mysqli_stmt_bind_result(mysqli_stmt $mysql_stmt, mixed &...$vars): bool
682682

683683
function mysqli_stmt_close(mysqli_stmt $mysql_stmt): bool {}
684684

685-
function mysqli_stmt_data_seek(mysqli_stmt $mysql_stmt, int $offset): ?bool {}
685+
function mysqli_stmt_data_seek(mysqli_stmt $mysql_stmt, int $offset): void {}
686686

687687
function mysqli_stmt_errno(mysqli_stmt $mysql_stmt): int {}
688688

ext/mysqli/mysqli_api.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,11 @@ PHP_FUNCTION(mysqli_data_seek)
739739
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
740740

741741
if (mysqli_result_is_unbuffered(result)) {
742-
zend_throw_error(NULL, "Function cannot be used with MYSQL_USE_RESULT");
742+
if (getThis()) {
743+
zend_throw_error(NULL, "mysqli_result::data_seek() cannot be used with MYSQL_USE_RESULT");
744+
} else {
745+
zend_throw_error(NULL, "mysqli_data_seek() cannot be used with MYSQL_USE_RESULT");
746+
}
743747
RETURN_THROWS();
744748
}
745749

@@ -1622,7 +1626,7 @@ PHP_FUNCTION(mysqli_num_rows)
16221626
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
16231627

16241628
if (mysqli_result_is_unbuffered_and_not_everything_is_fetched(result)) {
1625-
zend_throw_error(NULL, "Function cannot be used with MYSQL_USE_RESULT");
1629+
zend_throw_error(NULL, "mysqli_num_rows() cannot be used with MYSQL_USE_RESULT");
16261630
RETURN_THROWS();
16271631
}
16281632

ext/mysqli/mysqli_arginfo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* This is a generated file, edit the .stub.php file instead.
2-
* Stub hash: f2ff49a9cefcd31a990989b1c1ff525f9fb4d3de */
2+
* Stub hash: beb821b6e0b26f798d88f7b726a39084d856251f */
33

44
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mysqli_affected_rows, 0, 1, MAY_BE_LONG|MAY_BE_STRING)
55
ZEND_ARG_OBJ_INFO(0, mysql_link, mysqli, 0)
@@ -309,7 +309,7 @@ ZEND_END_ARG_INFO()
309309

310310
#define arginfo_mysqli_stmt_close arginfo_mysqli_stmt_execute
311311

312-
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_data_seek, 0, 2, _IS_BOOL, 1)
312+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mysqli_stmt_data_seek, 0, 2, IS_VOID, 0)
313313
ZEND_ARG_OBJ_INFO(0, mysql_stmt, mysqli_stmt, 0)
314314
ZEND_ARG_TYPE_INFO(0, offset, IS_LONG, 0)
315315
ZEND_END_ARG_INFO()

ext/mysqli/mysqli_nonapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ PHP_FUNCTION(mysqli_query)
640640
) {
641641
zend_argument_value_error(ERROR_ARG_POS(3), "must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT"
642642
#ifdef MYSQLI_USE_MYSQLND
643-
" with MYSQLI_ASYNC as an optional bitmask flags"
643+
" with MYSQLI_ASYNC as an optional bitmask flag"
644644
#endif
645645
);
646646
RETURN_THROWS();
@@ -1167,7 +1167,7 @@ PHP_FUNCTION(mysqli_begin_transaction)
11671167
}
11681168
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_VALID);
11691169
if (flags < 0) {
1170-
zend_argument_value_error(ERROR_ARG_POS(2), "must be one of the MYSQLI_TRANS_* constant");
1170+
zend_argument_value_error(ERROR_ARG_POS(2), "must be one of the MYSQLI_TRANS_* constants");
11711171
RETURN_THROWS();
11721172
}
11731173
if (!name_len) {

ext/mysqli/tests/bug55582.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ require_once("connect.inc");
3434
?>
3535
--EXPECT--
3636
bool(true)
37-
Function cannot be used with MYSQL_USE_RESULT
37+
mysqli_num_rows() cannot be used with MYSQL_USE_RESULT
3838
array(1) {
3939
[1]=>
4040
string(1) "1"
4141
}
42-
Function cannot be used with MYSQL_USE_RESULT
42+
mysqli_num_rows() cannot be used with MYSQL_USE_RESULT
4343
NULL
4444
int(1)
4545
done

ext/mysqli/tests/mysqli_begin_transaction.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ if (!have_innodb($link))
101101
?>
102102
--EXPECT--
103103
NULL
104-
mysqli_begin_transaction(): Argument #2 ($flags) must be one of the MYSQLI_TRANS_* constant
104+
mysqli_begin_transaction(): Argument #2 ($flags) must be one of the MYSQLI_TRANS_* constants
105105
done!

ext/mysqli/tests/mysqli_data_seek.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ require_once('skipifconnectfailure.inc');
6666
?>
6767
--EXPECT--
6868
mysqli_data_seek(): Argument #2 ($offset) must be greater than or equal to 0
69-
Function cannot be used with MYSQL_USE_RESULT
69+
mysqli_data_seek() cannot be used with MYSQL_USE_RESULT
7070
mysqli_result object is already closed
7171
done!

ext/mysqli/tests/mysqli_data_seek_oo.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ require_once('skipifconnectfailure.inc');
7878
--EXPECT--
7979
mysqli_result object is already closed
8080
mysqli_result::data_seek(): Argument #1 ($offset) must be greater than or equal to 0
81-
Function cannot be used with MYSQL_USE_RESULT
81+
mysqli_result::data_seek() cannot be used with MYSQL_USE_RESULT
8282
mysqli_result object is already closed
8383
done!

ext/mysqli/tests/mysqli_num_rows.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@ mysqli_result object is already closed
8080
mysqli_result object is already closed
8181
mysqli_result object is already closed
8282
run_tests.php don't fool me with your 'ungreedy' expression '.+?'!
83-
Function cannot be used with MYSQL_USE_RESULT
83+
mysqli_num_rows() cannot be used with MYSQL_USE_RESULT
8484
done!

ext/mysqli/tests/mysqli_query.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,6 @@ array(1) {
126126
string(1) "a"
127127
}
128128
string(1) "a"
129-
mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT with MYSQLI_ASYNC as an optional bitmask flags
129+
mysqli_query(): Argument #3 ($result_mode) must be either MYSQLI_USE_RESULT, or MYSQLI_STORE_RESULT with MYSQLI_ASYNC as an optional bitmask flag
130130
mysqli object is already closed
131131
done!

ext/mysqli/tests/mysqli_use_result.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ require_once('skipifconnectfailure.inc');
5656
require_once("clean_table.inc");
5757
?>
5858
--EXPECT--
59-
Function cannot be used with MYSQL_USE_RESULT
59+
mysqli_data_seek() cannot be used with MYSQL_USE_RESULT
6060
mysqli object is already closed
6161
done!

0 commit comments

Comments
 (0)