show pdf schema also if there are no relations
(still only works if there are no relations at all if there are some tables that don't have relations and some that do it is still not ok...) also now it checks if a page does have any tables in table_coords table though it will only die saying 'no tables' if it doesn't (i don't want to introd a new string now before 2.3.0 and this case shouldn't happen anyway)
This commit is contained in:
@@ -852,7 +852,9 @@ class PMA_RT
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND pdf_page_number = ' . $which_rel;
|
||||
$tab_rs = PMA_query_as_cu($tab_sql);
|
||||
|
||||
if(!mysql_num_rows($tab_rs)>0){
|
||||
die('no tables');
|
||||
}
|
||||
while ($curr_table = @PMA_mysql_fetch_array($tab_rs)) {
|
||||
$alltables[] = PMA_sqlAddslashes($curr_table['table_name']);
|
||||
$intable = '\'' . implode('\', \'', $alltables) . '\'';
|
||||
@@ -865,11 +867,24 @@ class PMA_RT
|
||||
. ' AND foreign_table IN (' . $intable . ')';
|
||||
$result = PMA_query_as_cu($sql);
|
||||
|
||||
/*
|
||||
mikebeck: maybe we can show tables without relations if i comment that out
|
||||
if (!$result || !mysql_num_rows($result)) {
|
||||
$pdf->PMA_PDF_die($GLOBALS['strPdfInvalidPageNum']);
|
||||
}
|
||||
while ($row = PMA_mysql_fetch_array($result)) {
|
||||
$this->PMA_RT_addRelation($row['master_table'] , $row['master_field'], $row['foreign_table'], $row['foreign_field']);
|
||||
*/
|
||||
if(isset($result) && $result && mysql_num_rows($result)>0){
|
||||
while ($row = PMA_mysql_fetch_array($result)) {
|
||||
$this->PMA_RT_addRelation($row['master_table'] , $row['master_field'], $row['foreign_table'], $row['foreign_field']);
|
||||
}
|
||||
$norelations=FALSE;
|
||||
}else{
|
||||
reset ($alltables);
|
||||
while (list(, $table) = each ($alltables)) {
|
||||
$this->tables[$table] = new PMA_RT_Table($table, $this->ff);
|
||||
$this->PMA_RT_setMinMax($this->tables[$table]);
|
||||
}
|
||||
$norelations=TRUE;
|
||||
}
|
||||
|
||||
// Defines the scale factor
|
||||
@@ -889,7 +904,9 @@ class PMA_RT
|
||||
$this->PMA_RT_strokeGrid();
|
||||
}
|
||||
$pdf->PMA_PDF_setFontSizeScale(14);
|
||||
$this->PMA_RT_drawRelations($change_color);
|
||||
if($norelations==FALSE){
|
||||
$this->PMA_RT_drawRelations($change_color);
|
||||
}
|
||||
$this->PMA_RT_drawTables($show_info);
|
||||
|
||||
$this->PMA_RT_showRt();
|
||||
|
Reference in New Issue
Block a user