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

This commit is contained in:
Ralf Becker 2009-08-17 07:32:24 +00:00
parent a7f5776ae3
commit 1423948060

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']))
{