remove unneeded calls, and very if internal relations are enabled before trying to create one

This commit is contained in:
Marc Delisle
2006-11-23 17:25:57 +00:00
parent 84ce8d7017
commit 19a5d15d30
6 changed files with 17 additions and 15 deletions

View File

@@ -7,6 +7,9 @@ $HeadURL$
2006-11-23 Marc Delisle <lem9@users.sourceforge.net> 2006-11-23 Marc Delisle <lem9@users.sourceforge.net>
* pmd/scripts/move.js: fix a few js errors * pmd/scripts/move.js: fix a few js errors
* pmd*.php: remove unneeded calls to getRelationsParam();
verify if the internal relations are enabled before trying to
create one
2006-11-22 Marc Delisle <lem9@users.sourceforge.net> 2006-11-22 Marc Delisle <lem9@users.sourceforge.net>
* Designer: get rid of pmd_config.php and pmd_get_info.php, * Designer: get rid of pmd_config.php and pmd_get_info.php,

View File

@@ -10,6 +10,8 @@ require_once './libraries/common.lib.php';
$GLOBALS['PMD']['STYLE'] = 'default'; $GLOBALS['PMD']['STYLE'] = 'default';
require_once './libraries/relation.lib.php'; require_once './libraries/relation.lib.php';
$cfgRelation = PMA_getRelationsParam();
function get_tabs() // PMA_DBI function get_tabs() // PMA_DBI
{ {
global $db; global $db;
@@ -56,7 +58,6 @@ function get_script_contr() {
global $db; global $db;
PMA_DBI_select_db($db); PMA_DBI_select_db($db);
$con["C_NAME"] = array(); $con["C_NAME"] = array();
PMA_getRelationsParam();
$i = 0; $i = 0;
$alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db), NULL, PMA_DBI_QUERY_STORE); $alltab_rs = PMA_DBI_query('SHOW TABLES FROM ' . PMA_backquote($db), NULL, PMA_DBI_QUERY_STORE);
while ($val = @PMA_DBI_fetch_row($alltab_rs)) { while ($val = @PMA_DBI_fetch_row($alltab_rs)) {
@@ -159,7 +160,6 @@ function get_script_tabs() {
} }
function get_tab_pos() { function get_tab_pos() {
PMA_getRelationsParam();
$stmt = PMA_query_as_cu("SELECT * FROM " . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']), FALSE, PMA_DBI_QUERY_STORE); $stmt = PMA_query_as_cu("SELECT * FROM " . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']), FALSE, PMA_DBI_QUERY_STORE);
if ( $stmt ) // exist table repository if ( $stmt ) // exist table repository
{ {

View File

@@ -13,7 +13,6 @@ if (isset($scale)) {
if (empty($pdf_page_number)) { if (empty($pdf_page_number)) {
die("<script>alert('Pages not found!');history.go(-2);</script>"); die("<script>alert('Pages not found!');history.go(-2);</script>");
} }
$cfgRelation = PMA_getRelationsParam();
$pmd_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']); $pmd_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($GLOBALS['cfgRelation']['designer_coords']);
$pma_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']); $pma_table = PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['table_coords']);

View File

@@ -7,7 +7,6 @@ $die_save_pos = 0;
include_once 'pmd_save_pos.php'; include_once 'pmd_save_pos.php';
require_once './libraries/relation.lib.php'; require_once './libraries/relation.lib.php';
extract($_POST); extract($_POST);
PMA_getRelationsParam();
$tables = PMA_DBI_get_tables_full($db, $T1); $tables = PMA_DBI_get_tables_full($db, $T1);
$type_T1 = strtoupper($tables[$T1]['ENGINE']); $type_T1 = strtoupper($tables[$T1]['ENGINE']);
@@ -58,6 +57,9 @@ if ($type_T1 == 'INNODB' and $type_T2 == 'INNODB') {
// n o n - I n n o D B // n o n - I n n o D B
} else { } else {
if ($GLOBALS['cfgRelation']['relwork'] == false) {
PMD_return(0, $strGeneralRelationFeat . ' : ' . $strDisabled);
} else {
// no need to recheck if the keys are primary or unique at this point, // no need to recheck if the keys are primary or unique at this point,
// this was checked on the interface part // this was checked on the interface part
@@ -68,6 +70,7 @@ if ($type_T1 == 'INNODB' and $type_T2 == 'INNODB') {
PMA_query_as_cu( $q , true, PMA_DBI_QUERY_STORE);// or PMD_return(0,'ERROR : Relation not added!'); PMA_query_as_cu( $q , true, PMA_DBI_QUERY_STORE);// or PMD_return(0,'ERROR : Relation not added!');
PMD_return(1, $strInternalRelationAdded); PMD_return(1, $strInternalRelationAdded);
}
} }
function PMD_return($b,$ret) function PMD_return($b,$ret)

View File

@@ -11,8 +11,6 @@ include_once 'pmd_save_pos.php';
list($DB1,$T1) = explode(".",$T1); list($DB1,$T1) = explode(".",$T1);
list($DB2,$T2) = explode(".",$T2); list($DB2,$T2) = explode(".",$T2);
PMA_getRelationsParam();
//++++++++++++++++++++++++++++++++++++++++++++++++++++ InnoDB ++++++++++++++++++++++++++++++++++++++++++++++++++++ //++++++++++++++++++++++++++++++++++++++++++++++++++++ InnoDB ++++++++++++++++++++++++++++++++++++++++++++++++++++

View File

@@ -4,7 +4,6 @@
include_once 'pmd_common.php'; include_once 'pmd_common.php';
require_once './libraries/relation.lib.php'; require_once './libraries/relation.lib.php';
PMA_getRelationsParam();
$alltab_rs = PMA_query_as_cu('SHOW TABLES FROM '.PMA_backquote($cfg['Server']['pmadb']),FALSE,PMA_DBI_QUERY_STORE) or PMD_err_sav(); $alltab_rs = PMA_query_as_cu('SHOW TABLES FROM '.PMA_backquote($cfg['Server']['pmadb']),FALSE,PMA_DBI_QUERY_STORE) or PMD_err_sav();