You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Forgive me for submitting the issue here, and I hope I can make a difference in the future, but since every time I pull a request, I report: continuous-integration / travis-ci / pr - The Travis CI build failed, I do not know why Cause.
The following is a mysqli database bug:
system/Database/MySQLi/Connection.php #869
public function execute($sql)
{
while($this->connID->more_results())
{
$this->connID->next_result();
if($res = $this->connID->store_result())
{
$res->free();
}
}
return $this->connID->query($this->prepQuery($sql));
}
The MySQL client does not allow you to execute a new query where there are still rows to be fetched from an in-progress query. See Commands out of sync in the MySQL doc on common errors.
You can use mysqli_store_result() to pre-fetch all the rows from the outer query. That will buffer them in the MySQL client, so from the server's point of view your app has fetched the full result set. Then you can execute more queries even in a loop of fetching rows from the now-buffered outer result set.
Or you mysqli_result::fetch_all() which returns the full result set as a PHP array, and then you can loop over that array.
Calling stored procedures is a special case, because a stored procedure has the potential for returning multiple result sets, each of which may have its own set of rows. That's why the answer from @A1ex07 mentions using mysqli_multi_query() and looping until mysqli_next_result() has no more result sets. This is necessary to satisfy the MySQL protocol, even if in your case your stored procedure has a single result set.
The text was updated successfully, but these errors were encountered:
I have the seen the issue you've raised. The errors in Travis are not from your code. If you click on the details next to the Travis error, it'll take you a place where you can investigate the errors happening. Basically, I broke the tests a couple of nights ago and haven't had a chance to fix all of them back up just yet.
Closing this issue since you've already got a PR for this.
Forgive me for submitting the issue here, and I hope I can make a difference in the future, but since every time I pull a request, I report: continuous-integration / travis-ci / pr - The Travis CI build failed, I do not know why Cause.
The following is a mysqli database bug:
system/Database/MySQLi/Connection.php
#869
public function execute($sql)
{
while($this->connID->more_results())
{
$this->connID->next_result();
if($res = $this->connID->store_result())
{
$res->free();
}
}
return $this->connID->query($this->prepQuery($sql));
}
The MySQL client does not allow you to execute a new query where there are still rows to be fetched from an in-progress query. See Commands out of sync in the MySQL doc on common errors.
You can use mysqli_store_result() to pre-fetch all the rows from the outer query. That will buffer them in the MySQL client, so from the server's point of view your app has fetched the full result set. Then you can execute more queries even in a loop of fetching rows from the now-buffered outer result set.
Or you mysqli_result::fetch_all() which returns the full result set as a PHP array, and then you can loop over that array.
Calling stored procedures is a special case, because a stored procedure has the potential for returning multiple result sets, each of which may have its own set of rows. That's why the answer from @A1ex07 mentions using mysqli_multi_query() and looping until mysqli_next_result() has no more result sets. This is necessary to satisfy the MySQL protocol, even if in your case your stored procedure has a single result set.
The text was updated successfully, but these errors were encountered: