forked from extern/egroupware
remove while loop since there should be only one record
This commit is contained in:
parent
876d87227f
commit
df41d8f9c4
@ -374,17 +374,15 @@
|
||||
$sql = "SELECT pg_catalog.pg_get_indexdef(i.indexrelid) as pg_get_indexdef FROM pg_catalog.pg_class c, pg_catalog.pg_class c2, pg_catalog.pg_index i WHERE c.relname = '$sTableName' AND pg_catalog.pg_table_is_visible(c.oid) AND c.oid = i.indrelid AND i.indexrelid = c2.oid AND NOT EXISTS ( SELECT 1 FROM pg_catalog.pg_depend d JOIN pg_catalog.pg_constraint c ON (d.refclassid = c.tableoid AND d.refobjid = c.oid) WHERE d.classid = c2.tableoid AND d.objid = c2.oid AND d.deptype = 'i' AND c.contype IN ('u', 'p') ) ORDER BY c2.relname";
|
||||
|
||||
@$oProc->m_odb->query($sql);
|
||||
while($oProc->m_odb->next_record())
|
||||
$oProc->m_odb->next_record();
|
||||
$indexfields = ereg_replace("^CREATE.+\(",'',$oProc->m_odb->f(0));
|
||||
$indexfields = ereg_replace("\)$",'',$indexfields);
|
||||
$aIx = explode(',',$indexfields);
|
||||
$i = 0;
|
||||
foreach($aIx as $ix)
|
||||
{
|
||||
$indexfields = ereg_replace("^CREATE.+\(",'',$oProc->m_odb->f(0));
|
||||
$indexfields = ereg_replace("\)$",'',$indexfields);
|
||||
$aIx = explode(',',$indexfields);
|
||||
$i = 0;
|
||||
foreach($aIx as $ix)
|
||||
{
|
||||
$aIx[$i] = trim($ix);
|
||||
$i++;
|
||||
}
|
||||
$aIx[$i] = trim($ix);
|
||||
$i++;
|
||||
}
|
||||
/* Restore original value */
|
||||
$oProc->Halt_On_Error = $tmp;
|
||||
|
Loading…
Reference in New Issue
Block a user