Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Zend/zend_portability.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,14 @@ char *alloca();

#if (defined(__GNUC__) && ZEND_GCC_VERSION >= 4003) || __has_attribute(cold)
# define ZEND_COLD __attribute__((cold))
# ifdef __OPTIMIZE__
# define ZEND_OPT_SIZE __attribute__((optimize("Os")))
# define ZEND_OPT_SPEED __attribute__((optimize("Ofast")))
# else
# define ZEND_OPT_SIZE
# define ZEND_OPT_SPEED
# endif
#else
# define ZEND_COLD
#endif

#if ((defined(__GNUC__) && ZEND_GCC_VERSION >= 4003) || __has_attribute(optimize)) && defined(__OPTIMIZE__)
# define ZEND_OPT_SIZE __attribute__((optimize("Os")))
# define ZEND_OPT_SPEED __attribute__((optimize("Ofast")))
#else
# define ZEND_OPT_SIZE
# define ZEND_OPT_SPEED
#endif
Expand Down
9 changes: 9 additions & 0 deletions ext/mysqli/mysqli_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,6 +1488,15 @@ PHP_FUNCTION(mysqli_stmt_data_seek)

MYSQLI_FETCH_RESOURCE_STMT(stmt, mysql_stmt, MYSQLI_STATUS_VALID);

if (!stmt->stmt->data || !stmt->stmt->data->result || !stmt->stmt->data->result->stored_data) {
if (hasThis()) {
zend_throw_error(NULL, "mysqli_stmt::data_seek(): No result set associated with the statement");
} else {
zend_throw_error(NULL, "mysqli_stmt_data_seek(): No result set associated with the statement");
}
RETURN_THROWS();
}

mysql_stmt_data_seek(stmt->stmt, offset);
}
/* }}} */
Expand Down
6 changes: 6 additions & 0 deletions ext/mysqli/tests/mysqli_stmt_data_seek.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ require_once 'skipifconnectfailure.inc';
if (true !== ($tmp = mysqli_stmt_execute($stmt)))
printf("[006] Expecting boolean/true, got %s/%s\n", gettype($tmp), $tmp);

try {
mysqli_stmt_data_seek($stmt, 1);
} catch (Error $exception) {
echo $exception->getMessage() . "\n";
}

$id = null;
if (!mysqli_stmt_bind_result($stmt, $id))
Expand Down Expand Up @@ -82,6 +87,7 @@ require_once 'skipifconnectfailure.inc';
?>
--EXPECT--
mysqli_stmt object is not fully initialized
mysqli_stmt_data_seek(): No result set associated with the statement
int(3)
int(1)
int(1)
Expand Down
2 changes: 1 addition & 1 deletion ext/phar/phar.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ PHP_INI_END()
*/
void phar_destroy_phar_data(phar_archive_data *phar) /* {{{ */
{
if (phar->alias && phar->alias != phar->fname) {
if (phar->alias) {
pefree(phar->alias, phar->is_persistent);
phar->alias = NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion ext/phar/phar_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -2631,7 +2631,7 @@ PHP_METHOD(Phar, getAlias)

PHAR_ARCHIVE_OBJECT();

if (phar_obj->archive->alias && phar_obj->archive->alias != phar_obj->archive->fname) {
if (phar_obj->archive->alias) {
RETURN_STRINGL(phar_obj->archive->alias, phar_obj->archive->alias_len);
}
}
Expand Down
Loading