"cant create an index without fields (was observed in broken backups)"

This commit is contained in:
Ralf Becker 2009-08-17 07:30:47 +00:00
parent 8d60b25ccf
commit 8c8d1e7b8c

View File

@ -193,6 +193,10 @@ class schema_proc
// creating unique indices/constrains
foreach ($aTableDef['uc'] as $name => $mFields)
{
if (empty($mFields))
{
continue; // cant create an index without fields (was observed in broken backups)
}
if ($this->_in_index($mFields,array($aTableDef['pk'])))
{
continue; // is already created as primary key
@ -210,6 +214,10 @@ class schema_proc
// creation indices
foreach ($aTableDef['ix'] as $name => $mFields)
{
if (empty($mFields))
{
continue; // cant create an index without fields (was observed in broken backups)
}
if ($this->_in_index($mFields,array($aTableDef['pk'])) ||
$this->_in_index($mFields,$aTableDef['uc']))
{