Skip to content
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
3 changes: 2 additions & 1 deletion libraries/joomla/database/exporter/mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function buildXmlStructure()

// Get the details columns information.
$fields = $this->db->getTableColumns($table, false);
$keys = $this->db->getTableKeys($table);
$keys = $this->db->getTableKeys($table);

$buffer[] = ' <table_structure name="' . $table . '">';

Expand All @@ -74,6 +74,7 @@ protected function buildXmlStructure()
{
$buffer[] = ' <key Table="' . $table . '"' . ' Non_unique="' . $key->Non_unique . '"' . ' Key_name="' . $key->Key_name . '"' .
' Seq_in_index="' . $key->Seq_in_index . '"' . ' Column_name="' . $key->Column_name . '"' . ' Collation="' . $key->Collation . '"' .
' Sub_part ="' . $key->Sub_part . '"' .
' Null="' . $key->Null . '"' . ' Index_type="' . $key->Index_type . '"' . ' Comment="' . htmlspecialchars($key->Comment) . '"' .
' />';
}
Expand Down
6 changes: 4 additions & 2 deletions libraries/joomla/database/importer/mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,8 @@ protected function getKeySql($columns)
$kNonUnique = (string) $columns[0]['Non_unique'];
$kName = (string) $columns[0]['Key_name'];
$kColumn = (string) $columns[0]['Column_name'];
$kLength = (string) $columns[0]['Sub_part'];
$kLength = $kLength == '' ? '' : '(' . $kLength . ')';

$prefix = '';

Expand All @@ -433,13 +435,13 @@ protected function getKeySql($columns)

if ($nColumns == 1)
{
$kColumns[] = $this->db->quoteName($kColumn);
$kColumns[] = $this->db->quoteName($kColumn) . $kLength;
}
else
{
foreach ($columns as $column)
{
$kColumns[] = (string) $column['Column_name'];
$kColumns[] = (string) $column['Column_name'] . $kLength;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$kLength = (string) $column['Sub_part'];
$kLength = $kLength == '' ? '' : '(' . $kLength . ')';

}
}

Expand Down