merge from 1.5.3.2 (~r11225)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@11226 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2012-09-13 06:14:45 +00:00
parent 54e3a72065
commit 77f5aa2671
313 changed files with 8058 additions and 14251 deletions

View file

@ -217,8 +217,14 @@
$stmt = $result;
$meta = mysqli_stmt_result_metadata($stmt);
$fields = mysqli_fetch_fields($meta);
foreach($fields as $field)
/**
* Mysqli has a bug that causes LONGTEXT columns not to get loaded
* Unless store_result is called before
* MYSQLI_TYPE for longtext is 252
*/
$longtext_exists = false;
foreach($fields as $field)
{
if(isset($resultArray[$field->name])) // When joined tables are used and the same column name appears twice, we should add it separately, otherwise bind_result fails
$field->name = 'repeat_' . $field->name;
@ -226,9 +232,16 @@
// Array passed needs to contain references, not values
$row[$field->name] = "";
$resultArray[$field->name] = &$row[$field->name];
if($field->type == 252) $longtext_exists = true;
}
$resultArray = array_merge(array($stmt), $resultArray);
if($longtext_exists)
{
mysqli_stmt_store_result($stmt);
}
call_user_func_array('mysqli_stmt_bind_result', $resultArray);
$rows = array();
@ -370,6 +383,4 @@
return mysqli_free_result($result);
}
}
return new DBMysqli;
?>