summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index 80cba4f85c..7b403dff08 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -354,7 +354,7 @@ PHP_FUNCTION(mysqli_stmt_bind_param)
RETURN_FALSE;
}
- if (types_len != argc - start) {
+ if (types_len != (size_t)(argc - start)) {
/* number of bind variables doesn't match number of elements in type definition string */
php_error_docref(NULL, E_WARNING, "Number of elements in type definition string doesn't match number of bind variables");
RETURN_FALSE;
@@ -596,7 +596,7 @@ PHP_FUNCTION(mysqli_stmt_bind_result)
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
- if (argc != mysql_stmt_field_count(stmt->stmt)) {
+ if ((uint)argc != mysql_stmt_field_count(stmt->stmt)) {
php_error_docref(NULL, E_WARNING, "Number of bind variables doesn't match number of fields in prepared statement");
RETURN_FALSE;
}
@@ -1267,7 +1267,11 @@ PHP_FUNCTION(mysqli_fetch_lengths)
MYSQL_RES *result;
zval *mysql_result;
unsigned int i;
- zend_ulong *ret;
+#if defined(MYSQLI_USE_MYSQLND)
+ const size_t *ret;
+#else
+ const zend_ulong *ret;
+#endif
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
return;
@@ -1326,7 +1330,7 @@ PHP_FUNCTION(mysqli_field_seek)
}
MYSQLI_FETCH_RESOURCE(result, MYSQL_RES *, mysql_result, "mysqli_result", MYSQLI_STATUS_VALID);
- if (fieldnr < 0 || fieldnr >= mysql_num_fields(result)) {
+ if (fieldnr < 0 || (uint)fieldnr >= mysql_num_fields(result)) {
php_error_docref(NULL, E_WARNING, "Invalid field offset");
RETURN_FALSE;
}
@@ -1693,10 +1697,6 @@ static int mysqli_options_get_option_zval_type(int option)
{
switch (option) {
#ifdef MYSQLI_USE_MYSQLND
-#if PHP_MAJOR_VERSION == 6
- /* PHP-7 doesn't supprt unicode */
- case MYSQLND_OPT_NUMERIC_AND_DATETIME_AS_UNICODE:
-#endif
case MYSQLND_OPT_NET_CMD_BUFFER_SIZE:
case MYSQLND_OPT_NET_READ_BUFFER_SIZE:
#ifdef MYSQLND_STRING_TO_INT_CONVERSION
@@ -1777,11 +1777,7 @@ PHP_FUNCTION(mysqli_options)
MYSQLI_FETCH_RESOURCE_CONN(mysql, mysql_link, MYSQLI_STATUS_INITIALIZED);
#if !defined(MYSQLI_USE_MYSQLND)
-#if PHP_API_VERSION < 20100412
- if ((PG(open_basedir) && PG(open_basedir)[0] != '\0') || PG(safe_mode)) {
-#else
if (PG(open_basedir) && PG(open_basedir)[0] != '\0') {
-#endif
if(mysql_option == MYSQL_OPT_LOCAL_INFILE) {
RETURN_FALSE;
}
@@ -2337,7 +2333,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);
if (mode_in < 0) {
- php_error_docref(NULL, E_WARNING, "mode should be non-negative, %pd passed", mode_in);
+ php_error_docref(NULL, E_WARNING, "mode should be non-negative, " ZEND_LONG_FMT " passed", mode_in);
RETURN_FALSE;
}