Skip to content

mysql related test cases are failing on big endian system #5380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
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
6 changes: 3 additions & 3 deletions ext/mysqli/mysqli_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,7 @@ PHP_FUNCTION(mysqli_stmt_attr_set)
#if MYSQL_VERSION_ID >= 50107
my_bool mode_b;
#endif
zend_ulong mode;
unsigned long mode;
zend_long attr;
void *mode_p;

Expand Down Expand Up @@ -2375,7 +2375,7 @@ PHP_FUNCTION(mysqli_stmt_attr_get)
{
MY_STMT *stmt;
zval *mysql_stmt;
zend_ulong value = 0;
unsigned long value = 0;
zend_long attr;
int rc;

Expand All @@ -2392,7 +2392,7 @@ PHP_FUNCTION(mysqli_stmt_attr_get)
if (attr == STMT_ATTR_UPDATE_MAX_LENGTH)
value = *((my_bool *)&value);
#endif
RETURN_LONG((zend_ulong)value);
RETURN_LONG((unsigned long)value);
}
/* }}} */

Expand Down
4 changes: 2 additions & 2 deletions ext/mysqli/mysqli_nonapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,8 @@ void mysqli_common_connect(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_real_conne
#if !defined(MYSQLI_USE_MYSQLND)
mysql->mysql->reconnect = MyG(reconnect);
#endif

mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&MyG(allow_local_infile));
unsigned int allow_local_infile = MyG(allow_local_infile);
mysql_options(mysql->mysql, MYSQL_OPT_LOCAL_INFILE, (char *)&allow_local_infile);

end:
if (!mysqli_resource) {
Expand Down
10 changes: 5 additions & 5 deletions ext/mysqlnd/mysqlnd_ps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1796,8 +1796,8 @@ MYSQLND_METHOD(mysqlnd_stmt, attr_set)(MYSQLND_STMT * const s,
break;
}
case STMT_ATTR_CURSOR_TYPE: {
unsigned int ival = *(unsigned int *) value;
if (ival > (zend_ulong) CURSOR_TYPE_READ_ONLY) {
unsigned long ival = *(unsigned long *) value;
if (ival > (unsigned long) CURSOR_TYPE_READ_ONLY) {
SET_CLIENT_ERROR(stmt->error_info, CR_NOT_IMPLEMENTED, UNKNOWN_SQLSTATE, "Not implemented");
DBG_INF("FAIL");
DBG_RETURN(FAIL);
Expand All @@ -1806,7 +1806,7 @@ MYSQLND_METHOD(mysqlnd_stmt, attr_set)(MYSQLND_STMT * const s,
break;
}
case STMT_ATTR_PREFETCH_ROWS: {
unsigned int ival = *(unsigned int *) value;
unsigned long ival = *(unsigned long *) value;
if (ival == 0) {
ival = MYSQLND_DEFAULT_PREFETCH_ROWS;
} else if (ival > 1) {
Expand Down Expand Up @@ -1845,10 +1845,10 @@ MYSQLND_METHOD(mysqlnd_stmt, attr_get)(const MYSQLND_STMT * const s,
*(zend_bool *) value= stmt->update_max_length;
break;
case STMT_ATTR_CURSOR_TYPE:
*(zend_ulong *) value= stmt->flags;
*(unsigned long *) value= stmt->flags;
break;
case STMT_ATTR_PREFETCH_ROWS:
*(zend_ulong *) value= stmt->prefetch_rows;
*(unsigned long *) value= stmt->prefetch_rows;
break;
default:
DBG_RETURN(FAIL);
Expand Down
4 changes: 2 additions & 2 deletions ext/pdo_mysql/mysql_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
/* handle MySQL options */
if (driver_options) {
zend_long connect_timeout = pdo_attr_lval(driver_options, PDO_ATTR_TIMEOUT, 30);
zend_long local_infile = pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0);
unsigned int local_infile = (unsigned int) pdo_attr_lval(driver_options, PDO_MYSQL_ATTR_LOCAL_INFILE, 0);
zend_string *init_cmd = NULL;
#ifndef PDO_USE_MYSQLND
zend_string *default_file = NULL, *default_group = NULL;
Expand Down Expand Up @@ -779,7 +779,7 @@ static int pdo_mysql_handle_factory(pdo_dbh_t *dbh, zval *driver_options)
} else {
#if defined(MYSQL_OPT_LOCAL_INFILE) || defined(PDO_USE_MYSQLND)
// in case there are no driver options disable 'local infile' explicitly
zend_long local_infile = 0;
unsigned int local_infile = 0;
if (mysql_options(H->server, MYSQL_OPT_LOCAL_INFILE, (const char *)&local_infile)) {
pdo_mysql_error(dbh);
goto cleanup;
Expand Down