Texy! - Allow export of geometry and binary fields
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
This commit is contained in:
parent
c51f5f72fe
commit
2c8a74bae9
@ -8,6 +8,7 @@ declare(strict_types=1);
|
||||
namespace PhpMyAdmin\Plugins\Export;
|
||||
|
||||
use PhpMyAdmin\DatabaseInterface;
|
||||
use PhpMyAdmin\FieldMetadata;
|
||||
use PhpMyAdmin\Plugins\ExportPlugin;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup;
|
||||
use PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup;
|
||||
@ -18,6 +19,7 @@ use PhpMyAdmin\Properties\Plugins\ExportPluginProperties;
|
||||
use PhpMyAdmin\Util;
|
||||
|
||||
use function __;
|
||||
use function bin2hex;
|
||||
use function htmlspecialchars;
|
||||
use function in_array;
|
||||
use function str_replace;
|
||||
@ -185,6 +187,8 @@ class ExportTexytext extends ExportPlugin
|
||||
// Gets the data from the database
|
||||
$result = $dbi->query($sqlQuery, DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_UNBUFFERED);
|
||||
$fields_cnt = $result->numFields();
|
||||
/** @var FieldMetadata[] $fieldsMeta */
|
||||
$fieldsMeta = $dbi->getFieldsMeta($result);
|
||||
|
||||
// If required, get fields name at the first line
|
||||
if (isset($GLOBALS[$what . '_columns'])) {
|
||||
@ -212,6 +216,10 @@ class ExportTexytext extends ExportPlugin
|
||||
$value = $GLOBALS[$what . '_null'];
|
||||
} elseif ($row[$j] == '0' || $row[$j] != '') {
|
||||
$value = $row[$j];
|
||||
|
||||
if ($fieldsMeta[$j]->isMappedTypeGeometry || $fieldsMeta[$j]->isBinary) {
|
||||
$value = '0x' . bin2hex($value);
|
||||
}
|
||||
} else {
|
||||
$value = ' ';
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user