Fix #14291 - Incorrect linkage from one table's value to another table
Fixes: #14291 Pull-request: #15414 Signed-off-by: William Desportes <williamdes@wdes.fr>
This commit is contained in:
commit
62a17fea45
@ -3629,7 +3629,7 @@ class Results
|
||||
|
||||
$cell = $this->_getRowData(
|
||||
'right ' . $class, $condition_field,
|
||||
$analyzed_sql_results, $meta, $map, $column,
|
||||
$analyzed_sql_results, $meta, $map, $column, $column,
|
||||
$transformation_plugin, $default_function, $nowrap,
|
||||
$where_comparison, $transform_options,
|
||||
$is_field_truncated, ''
|
||||
@ -3706,13 +3706,14 @@ class Results
|
||||
$wktval = Util::asWKT($column);
|
||||
list(
|
||||
$is_field_truncated,
|
||||
$wktval,
|
||||
$displayedColumn,
|
||||
// skip 3rd param
|
||||
) = $this->_getPartialText($wktval);
|
||||
|
||||
$cell = $this->_getRowData(
|
||||
$class, $condition_field, $analyzed_sql_results, $meta, $map,
|
||||
$wktval, $transformation_plugin, $default_function, '',
|
||||
$wktval, $displayedColumn, $transformation_plugin,
|
||||
$default_function, '',
|
||||
$where_comparison, $transform_options,
|
||||
$is_field_truncated, ''
|
||||
);
|
||||
@ -3727,13 +3728,13 @@ class Results
|
||||
$wkbval = substr(bin2hex($column), 8);
|
||||
list(
|
||||
$is_field_truncated,
|
||||
$wkbval,
|
||||
$displayedColumn,
|
||||
// skip 3rd param
|
||||
) = $this->_getPartialText($wkbval);
|
||||
|
||||
$cell = $this->_getRowData(
|
||||
$class, $condition_field,
|
||||
$analyzed_sql_results, $meta, $map, $wkbval,
|
||||
$analyzed_sql_results, $meta, $map, $wkbval, $displayedColumn,
|
||||
$transformation_plugin, $default_function, '',
|
||||
$where_comparison, $transform_options,
|
||||
$is_field_truncated, ''
|
||||
@ -3828,13 +3829,14 @@ class Results
|
||||
|
||||
// Cut all fields to $GLOBALS['cfg']['LimitChars']
|
||||
// (unless it's a link-type transformation or binary)
|
||||
$displayedColumn = $column;
|
||||
if (!(gettype($transformation_plugin) === "object"
|
||||
&& strpos($transformation_plugin->getName(), 'Link') !== false)
|
||||
&& !stristr($field_flags, self::BINARY_FIELD)
|
||||
) {
|
||||
list(
|
||||
$is_field_truncated,
|
||||
$column,
|
||||
$displayedColumn,
|
||||
$original_length
|
||||
) = $this->_getPartialText($column);
|
||||
}
|
||||
@ -3842,8 +3844,8 @@ class Results
|
||||
$formatted = false;
|
||||
if (isset($meta->_type) && $meta->_type === MYSQLI_TYPE_BIT) {
|
||||
|
||||
$column = Util::printableBitValue(
|
||||
$column, $meta->length
|
||||
$displayedColumn = Util::printableBitValue(
|
||||
$displayedColumn, $meta->length
|
||||
);
|
||||
|
||||
// some results of PROCEDURE ANALYSE() are reported as
|
||||
@ -3858,8 +3860,8 @@ class Results
|
||||
if ($meta->type === self::STRING_FIELD) {
|
||||
$binary_or_blob = self::BINARY_FIELD;
|
||||
}
|
||||
$column = $this->_handleNonPrintableContents(
|
||||
$binary_or_blob, $column, $transformation_plugin,
|
||||
$displayedColumn = $this->_handleNonPrintableContents(
|
||||
$binary_or_blob, $displayedColumn, $transformation_plugin,
|
||||
$transform_options, $default_function,
|
||||
$meta, $_url_params, $is_field_truncated
|
||||
);
|
||||
@ -3878,7 +3880,7 @@ class Results
|
||||
|
||||
if ($formatted) {
|
||||
$cell = $this->_buildValueDisplay(
|
||||
$class, $condition_field, $column
|
||||
$class, $condition_field, $displayedColumn
|
||||
);
|
||||
return $cell;
|
||||
}
|
||||
@ -3901,7 +3903,7 @@ class Results
|
||||
|
||||
$cell = $this->_getRowData(
|
||||
$class, $condition_field,
|
||||
$analyzed_sql_results, $meta, $map, $column,
|
||||
$analyzed_sql_results, $meta, $map, $column, $displayedColumn,
|
||||
$transformation_plugin, $default_function, $nowrap,
|
||||
$where_comparison, $transform_options,
|
||||
$is_field_truncated, $original_length
|
||||
@ -5223,6 +5225,7 @@ class Results
|
||||
* field
|
||||
* @param array $map the list of relations
|
||||
* @param string $data data
|
||||
* @param string $displayedData data that will be displayed (maybe be chunked)
|
||||
* @param object|string $transformation_plugin transformation plugin.
|
||||
* Can also be the default function:
|
||||
* Core::mimeDefaultFunction
|
||||
@ -5243,7 +5246,8 @@ class Results
|
||||
*
|
||||
*/
|
||||
private function _getRowData(
|
||||
$class, $condition_field, array $analyzed_sql_results, $meta, array $map, $data,
|
||||
$class, $condition_field, array $analyzed_sql_results, $meta,
|
||||
array $map, $data, $displayedData,
|
||||
$transformation_plugin, $default_function, $nowrap, $where_comparison,
|
||||
array $transform_options, $is_field_truncated, $original_length=''
|
||||
) {
|
||||
@ -5333,7 +5337,7 @@ class Results
|
||||
if ($transformation_plugin != $default_function) {
|
||||
// always apply a transformation on the real data,
|
||||
// not on the display field
|
||||
$message = $transformation_plugin->applyTransformation(
|
||||
$displayedData = $transformation_plugin->applyTransformation(
|
||||
$data,
|
||||
$transform_options,
|
||||
$meta
|
||||
@ -5345,10 +5349,10 @@ class Results
|
||||
) {
|
||||
// user chose "relational display field" in the
|
||||
// display options, so show display field in the cell
|
||||
$message = $default_function($dispval);
|
||||
$displayedData = $default_function($dispval);
|
||||
} else {
|
||||
// otherwise display data in the cell
|
||||
$message = $default_function($data);
|
||||
$displayedData = $default_function($displayedData);
|
||||
}
|
||||
|
||||
}
|
||||
@ -5359,7 +5363,7 @@ class Results
|
||||
}
|
||||
$result .= Util::linkOrButton(
|
||||
'sql.php' . Url::getCommon($_url_params),
|
||||
$message, $tag_params
|
||||
$displayedData, $tag_params
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user