Skip to content
Permalink
Browse files

Connectivity: fixed order fixing for tables errors after db-check

  • Loading branch information...
tvannini committed Jul 1, 2019
1 parent cf5fdba commit a9ac43914705714bf0c831895cd4f498c61d5c74
Showing with 52 additions and 29 deletions.
  1. +51 −28 lib/prgs/jxconnectivity.prf
  2. +1 −1 lib/prgs/jxconnectivity.prg
@@ -4630,42 +4630,65 @@ return ((o2val('prg
} //|o2_fine_exp|

function jxconnectivity_exp_237() {
$errors_tab = o2tree_get_nodes("result");
$in = (o2val('prg�_�var','node_type') == "db");
$errors_tab = o2tree_get_nodes('result');
$in = (o2val('prg�_�var','node_type') == 'db');
$list = array();
$img_path = "<jx>/img/tabadmin/tree/";
$img_path = '<jx>/img/tabadmin/tree/';
$tabs = 0;
$tot = 0;
if ($in) {
// ___________________________________ Fix record layout errors (rebuild) ___
foreach ($errors_tab as $tab) {
if ($tab[0] === "jxresultset") {
switch ($tab[3]) {
case 'index':
o2tab_indexes_setoff($tab[1]);
if (o2tab_indexes_seton($tab[1])) {
$list[$tab[1]] = array("jxresultset", $tab[1], $img_path."tab.png");
$tabs++;
}
break;
case 'fkey':
o2tab_fkeys_setoff($tab[1]);
if (o2tab_fkeys_seton($tab[1])) {
$list[$tab[1]] = array("jxresultset", $tab[1], $img_path."tab.png");
$tabs++;
}
break;
case 'error':
default:
if (o2tab_rebuild($tab[1])) {
$list[$tab[1]] = array("jxresultset", $tab[1], $img_path."tab.png");
$tabs++;
}
break;
if ($tab[0] === 'jxresultset' && $tab[3] == 'error') {
o2tab_fkeys_setoff($tab[1]);
if (o2tab_rebuild($tab[1])) {
$list[$tab[1]] = array('jxresultset', $tab[1], $img_path.'tab.png');
$tabs++;
$tot++;
}
else {
$list[$tab[1]] = array('jxresultset', $tab[1], $img_path.
'tab_error.png');
$tot++;
}
}
}
// ___________________________________________________ Fix indexes errors ___
foreach ($errors_tab as $tab) {
if ($tab[0] === 'jxresultset' && $tab[3] == 'index') {
o2tab_indexes_setoff($tab[1]);
if (o2tab_indexes_seton($tab[1])) {
$list[$tab[1]] = array('jxresultset', $tab[1], $img_path.'tab.png');
$tabs++;
$tot++;
}
else {
$list[$tab[1]] = array('jxresultset', $tab[1], $img_path.
'tab_error.png');
$tot++;
}
}
}
// _____________________________________________ Fix foreign keysa errors ___
foreach ($errors_tab as $tab) {
if ($tab[0] === 'jxresultset' &&
($tab[3] == 'fkey' || $tab[3] == 'error')) {
o2tab_fkeys_setoff($tab[1]);
if (o2tab_fkeys_seton($tab[1])) {
$list[$tab[1]] = array('jxresultset', $tab[1], $img_path.'tab.png');
$tabs++;
$tot++;
}
else {
$list[$tab[1]] = array('jxresultset', $tab[1], $img_path.
'tab_error.png');
$tot++;
}
}
}
}
$list["jxresultset"] = array(0, $tabs." tables with errors fixed", $img_path."folder.png");
o2tree_def("result", $list, 1, "result_select");
$list['jxresultset'] = array(0, $tabs.' of '.$tot.' tables with errors fixed', $img_path.'folder.png');
o2tree_def('result', $list, 1, 'result_select');
return ("Rebuild");
} //|o2_fine_exp|

@@ -1,5 +1,5 @@
<?php
//2.4
//2.5
//o2def::module("");
//o2def::folder("[root]");
/*

0 comments on commit a9ac439

Please sign in to comment.
You can’t perform that action at this time.