remove unneeded calls, and very if internal relations are enabled before trying to create one
This commit is contained in:
@@ -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,
|
||||||
|
@@ -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
|
||||||
{
|
{
|
||||||
|
@@ -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']);
|
||||||
|
@@ -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,16 +57,20 @@ 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 {
|
||||||
// no need to recheck if the keys are primary or unique at this point,
|
if ($GLOBALS['cfgRelation']['relwork'] == false) {
|
||||||
// this was checked on the interface part
|
PMD_return(0, $strGeneralRelationFeat . ' : ' . $strDisabled);
|
||||||
|
} else {
|
||||||
|
// no need to recheck if the keys are primary or unique at this point,
|
||||||
|
// this was checked on the interface part
|
||||||
|
|
||||||
$q = "INSERT INTO ".PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation'])."
|
$q = "INSERT INTO ".PMA_backquote($GLOBALS['cfgRelation']['db']) . '.' . PMA_backquote($cfgRelation['relation'])."
|
||||||
(master_db, master_table, master_field, foreign_db, foreign_table, foreign_field)
|
(master_db, master_table, master_field, foreign_db, foreign_table, foreign_field)
|
||||||
VALUES ('".$db."','".$T2."','$F2','".
|
VALUES ('".$db."','".$T2."','$F2','".
|
||||||
$db."','".$T1."','$F1')";
|
$db."','".$T1."','$F1')";
|
||||||
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)
|
||||||
|
@@ -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 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
|
||||||
|
|
||||||
|
@@ -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();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user