Browse Source

added definer to create procedure

Piotr Labudda 9 years ago
parent
commit
8fe12e884b

+ 5 - 5
SE/se-lib/Route/FixCrmProcesInitIdx.php

@@ -266,7 +266,7 @@ SQL;
 //	SET @conf_last_exec_end_key   = 'tbl_indexer_CRM_PROCES_last_exec_end';
 		$sqlList['0-prepare-fill_idx_INIT-rm'] = "DROP PROCEDURE if exists `update_proces_init_idx__loop__fill_idx_INIT`";
 		$sqlList['0-prepare-fill_idx_INIT-create'] = <<<SQL
-CREATE PROCEDURE `update_proces_init_idx__loop__fill_idx_INIT`()
+CREATE DEFINER=`root`@`localhost` PROCEDURE `update_proces_init_idx__loop__fill_idx_INIT`()
 BEGIN
 
 		SET @i = 0;
@@ -288,7 +288,7 @@ END
 SQL;
 		$sqlList['0-prepare-while-1-rm'] = "DROP PROCEDURE if exists `update_proces_init_idx_rec__while1`";
 		$sqlList['0-prepare-while-1-create'] = <<<SQL
-CREATE PROCEDURE `update_proces_init_idx_rec__while1`()
+CREATE DEFINER=`root`@`localhost` PROCEDURE `update_proces_init_idx_rec__while1`()
 BEGIN
 
 		-- update `CRM_PROCES_idx_TEMP` as i set i.`idx_PROCES_INIT_ID`=IF(i.`TYPE`='PROCES_INIT', i.`ID_PROCES`, 0);
@@ -309,7 +309,7 @@ END
 SQL;
 		$sqlList['0-prepare-while-2-rm'] = "DROP PROCEDURE if exists `update_proces_init_idx_rec__while2`";
 		$sqlList['0-prepare-while-2-create'] = <<<SQL
-CREATE PROCEDURE `update_proces_init_idx_rec__while2`()
+CREATE DEFINER=`root`@`localhost` PROCEDURE `update_proces_init_idx_rec__while2`()
 BEGIN
 
 		SET @i = 0;
@@ -333,7 +333,7 @@ END
 
 SQL;
 		$sqlList__TEST_PERF_NO_DIFF['0-prepare-while-2-create'] = <<<SQL
-CREATE PROCEDURE `update_proces_init_idx_rec__while2`()
+CREATE DEFINER=`root`@`localhost` PROCEDURE `update_proces_init_idx_rec__while2`()
 BEGIN
 
 		SET @i = 0;
@@ -888,7 +888,7 @@ SQL;
 		// throws errors:
 		//  #1146 - Table '{DATABASE_NAME}.P5-MSG:Route_FixCrmProcesInitIdx:ERROR: Already executed' doesn't exist
 		$sqlList['CreateProcedure'] = <<<SQL
-CREATE PROCEDURE `update_proces_init_idx_rec`()
+CREATE DEFINER=`root`@`localhost` PROCEDURE `update_proces_init_idx_rec`()
 BEGIN
 	SET @enabled = FALSE;
 	SET @conf_last_exec_lock_key = 'tbl_indexer_CRM_PROCES_last_exec_lock_date';

+ 2 - 2
SE/se-lib/Route/FixProjectPath.php

@@ -138,7 +138,7 @@ jQuery(document).ready(function () {
 		";
 		$sqlList['RemoveProcedure'] = "DROP PROCEDURE if exists `update_project_path_idx_rec`";
 		$sqlList['CreateProcedure'] = "
-			CREATE PROCEDURE `update_project_path_idx_rec`()
+			CREATE DEFINER=`root`@`localhost` PROCEDURE `update_project_path_idx_rec`()
 			BEGIN
 				SET @conf_last_exec_key = 'tbl_indexer_project_last_exec';
 				replace into `CRM_CONFIG` (`conf_key`, `conf_val`) values (@conf_last_exec_key, NOW());
@@ -191,7 +191,7 @@ jQuery(document).ready(function () {
 							, (select AUTO_INCREMENT from information_schema.TABLES where TABLE_SCHEMA=DATABASE() AND TABLE_NAME='IN7_MK_BAZA_DYSTRYBUCJI')
 						));
 				END
-		";//jak sa tabulatory to sie nie da wkleic do mysqla 
+		";//jak sa tabulatory to sie nie da wkleic do mysqla
 		$sqlList['RemoveTrigger_BeforeUpdateProject'] = "DROP TRIGGER IF EXISTS `_IN7_MK_BAZA_DYSTRYBUCJI_tree_UPDATE`";
 		// throws errors:
 		//  #1146 - Table '{DATABASE_NAME}.ERROR: Loop detected ID=P_ID' doesn't exist

+ 1 - 1
SE/se-lib/Route/FixZasobPath.php

@@ -138,7 +138,7 @@ jQuery(document).ready(function () {
 		";
 		$sqlList['RemoveProcedure'] = "DROP PROCEDURE if exists `update_zasob_path_idx_rec`";
 		$sqlList['CreateProcedure'] = "
-			CREATE PROCEDURE `update_zasob_path_idx_rec`()
+			CREATE DEFINER=`root`@`localhost` PROCEDURE `update_zasob_path_idx_rec`()
 			BEGIN
 				SET @conf_last_exec_key = 'tbl_indexer_zasob_last_exec';
 				replace into `CRM_CONFIG` (`conf_key`, `conf_val`) values (@conf_last_exec_key, NOW());