|
|
@@ -131,7 +131,7 @@ function start_dig($tables) {
|
|
|
while($h=$db->fetch($res)) {
|
|
|
$hist_loop[$Y][]=$h;
|
|
|
$hist_time[][$Y]=$h;
|
|
|
- dig_next($hist_loop,$t,$h,1,$hist_time,$Y);
|
|
|
+ dig_next($hist_loop,$t,$h,1,$hist_time,$Y,add_path($path,$Y));
|
|
|
unset($hist_time);
|
|
|
}
|
|
|
}
|
|
|
@@ -139,9 +139,13 @@ function start_dig($tables) {
|
|
|
|
|
|
|
|
|
|
|
|
+function add_path($path='/',$last_tbl) {
|
|
|
+ $path.="/".$last_tbl;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
|
|
|
-function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop,$hist_time,$last_tbl='n/s') {
|
|
|
+function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop,$hist_time,$last_tbl='n/s',$path='/') {
|
|
|
global $db,$tables;
|
|
|
$loop++;
|
|
|
echo "\n<hr>###LOOP ".$loop;
|
|
|
@@ -222,7 +226,7 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop,$hist_time,$last_tbl='n/s
|
|
|
}
|
|
|
}
|
|
|
$sql_rel_and_sql[$T][$z_rel_and_name].=" ; " ;
|
|
|
- dig_arr_cur($hist_loop,$T,$sql_rel_and_sql[$T][$z_rel_and_name],$hist_time,$loop,$last_tbl);
|
|
|
+ dig_arr_cur($hist_loop,$T,$sql_rel_and_sql[$T][$z_rel_and_name],$hist_time,$loop,$last_tbl,$path);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -368,13 +372,13 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop,$hist_time,$last_tbl='n/s
|
|
|
*/
|
|
|
if( isset($sql_t)) {
|
|
|
foreach($sql_t as $T => $sql_ext) {
|
|
|
- dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop,$last_tbl);
|
|
|
+ dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop,$last_tbl,$path);
|
|
|
}
|
|
|
}
|
|
|
//todo look in Y and die()
|
|
|
|
|
|
} else {
|
|
|
- echo "\n<hr> #377 Przekroczony limit zagnieżdzeń dla wątku: <pre>\n";
|
|
|
+ echo "\n<hr> #377 Przekroczony limit zagnieżdzeń dla wątku: path=".$path."; <pre>\n";
|
|
|
print_r($hist_time);
|
|
|
echo "</pre>";
|
|
|
}
|
|
|
@@ -382,7 +386,7 @@ function dig_next($hist_loop,$prev_tbl,$prev_dig,$loop,$hist_time,$last_tbl='n/s
|
|
|
}
|
|
|
|
|
|
|
|
|
-function dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop,$last_tbl) {
|
|
|
+function dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop,$last_tbl,$path) {
|
|
|
global $db,$tables;
|
|
|
|
|
|
echo "\n<br>216: from:".$last_tbl." Querying :T ".$T." ext: ".$sql_ext ;//$sql_ext
|
|
|
@@ -397,7 +401,7 @@ function dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop,$last_tbl) {
|
|
|
$hist_time[][$T]=$h;
|
|
|
// print_r($hist_loop);
|
|
|
|
|
|
- dig_next($hist_loop, $tables['Z'][$T],$h,$loop,$hist_time,$last_tbl);
|
|
|
+ dig_next($hist_loop, $tables['Z'][$T],$h,$loop,$hist_time,$last_tbl,add_path($path,$T));
|
|
|
//rel dzieci $tables['Z']['BI_audit_CEIDG']['ref'][19]='BI_audit_CEIDG_pelnomocnicy';
|
|
|
if(isset($tables['Z'][$T]['ref'])) {
|
|
|
// echo "<br>#296 try to ref tables for T ".$T."<pre>";
|
|
|
@@ -417,7 +421,7 @@ function dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop,$last_tbl) {
|
|
|
$hist_loop[$ref_table][]=$h_rel_rec;
|
|
|
$hist_time[][$ref_table]=$sql_rel_rec;
|
|
|
$hist_time[][$ref_table]=$h_rel_rec;
|
|
|
- dig_next($hist_loop,$tables['Z'][$ref_table],$h_rel_rec,$loop,$hist_time);
|
|
|
+ dig_next($hist_loop,$tables['Z'][$ref_table],$h_rel_rec,$loop,$hist_time,$ref_table,add_path($path,$ref_table));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -442,7 +446,7 @@ function dig_arr_cur($hist_loop,$T,$sql_ext,$hist_time,$loop,$last_tbl) {
|
|
|
$hist_loop[$ref_table][]=$h_rel_rec;
|
|
|
$hist_time[][$ref_table]=$sql_rel_rec;
|
|
|
$hist_time[][$ref_table]=$h_rel_rec;
|
|
|
- dig_next($hist_loop,$tables['Z'][$ref_table],$h_rel_rec,$loop,$hist_time);
|
|
|
+ dig_next($hist_loop,$tables['Z'][$ref_table],$h_rel_rec,$loop,$hist_time,$ref_table,add_path($path,$ref_table));
|
|
|
}
|
|
|
}
|
|
|
}
|