You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
chore(codestyle): MCOL-5405: repace windows CRLF with virtious linux one
This commit is contained in:
committed by
Leonid Fedorov
parent
2e61c9909b
commit
13b23e8510
@ -14,19 +14,19 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/*
|
||||
* $Id: calremoveuserpriority.sql 8777 2012-08-01 21:52:34Z zzhu $
|
||||
*/
|
||||
|
||||
DELIMITER $$
|
||||
CREATE PROCEDURE infinidb_querystats.calRemoveUserPriority(IN host VARCHAR(50), IN usr VARCHAR(50))
|
||||
LANGUAGE SQL
|
||||
NOT DETERMINISTIC
|
||||
MODIFIES SQL DATA
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'Procedure to remove a given InfiniDB user user_priority'
|
||||
BEGIN
|
||||
delete from infinidb_querystats.user_priority where upper(user_priority.user) = upper(usr) and upper(user_priority.host) = upper(host);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
/*
|
||||
* $Id: calremoveuserpriority.sql 8777 2012-08-01 21:52:34Z zzhu $
|
||||
*/
|
||||
|
||||
DELIMITER $$
|
||||
CREATE PROCEDURE infinidb_querystats.calRemoveUserPriority(IN host VARCHAR(50), IN usr VARCHAR(50))
|
||||
LANGUAGE SQL
|
||||
NOT DETERMINISTIC
|
||||
MODIFIES SQL DATA
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'Procedure to remove a given InfiniDB user user_priority'
|
||||
BEGIN
|
||||
delete from infinidb_querystats.user_priority where upper(user_priority.user) = upper(usr) and upper(user_priority.host) = upper(host);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
@ -14,64 +14,64 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/*
|
||||
* $Id: calsetuserpriority.sql 9440 2013-04-24 21:07:42Z chao $
|
||||
*/
|
||||
|
||||
DELIMITER $$
|
||||
DROP PROCEDURE IF EXISTS infinidb_querystats.calSetUserPriority;
|
||||
CREATE PROCEDURE infinidb_querystats.calSetUserPriority(IN host VARCHAR(50), IN usr VARCHAR(50), IN pri VARCHAR(10))
|
||||
LANGUAGE SQL
|
||||
NOT DETERMINISTIC
|
||||
MODIFIES SQL DATA
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'Procedure to set a given InfiniDB user to the given priority'
|
||||
pri_validation: BEGIN
|
||||
IF upper(pri) not in ('HIGH', 'MEDIUM', 'LOW') THEN
|
||||
select "Priority can only be set to 'High', 'Medium', or 'Low'" Error;
|
||||
leave pri_validation;
|
||||
END IF;
|
||||
|
||||
IF INSTR(host, ":") != 0 THEN
|
||||
select "Port number cannot be used when setting user priority" Error;
|
||||
leave pri_validation;
|
||||
END IF;
|
||||
|
||||
user_validation: BEGIN
|
||||
DECLARE cnt,c INT;
|
||||
DECLARE cur_2 CURSOR for select count(*) from mysql.user where upper(user.host)=upper(host) and upper(user.user)=upper(usr);
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET c = 1;
|
||||
OPEN cur_2;
|
||||
SET cnt = 0;
|
||||
REPEAT
|
||||
FETCH cur_2 into cnt;
|
||||
until c = 1
|
||||
END REPEAT;
|
||||
IF cnt = 0 THEN
|
||||
select "User does not exist in MySQL" Error;
|
||||
LEAVE user_validation;
|
||||
END IF;
|
||||
|
||||
BEGIN
|
||||
DECLARE a, b INT;
|
||||
DECLARE cur_1 CURSOR FOR SELECT count(*) FROM infinidb_querystats.user_priority where upper(user)=upper(usr) and upper(user_priority.host)=upper(host);
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET b = 1;
|
||||
OPEN cur_1;
|
||||
SET a = 0;
|
||||
REPEAT
|
||||
FETCH cur_1 INTO a;
|
||||
UNTIL b = 1
|
||||
END REPEAT;
|
||||
CLOSE cur_1;
|
||||
IF a = 0 THEN
|
||||
insert into infinidb_querystats.user_priority values (host, usr, upper(pri));
|
||||
ELSE
|
||||
update infinidb_querystats.user_priority set priority=upper(pri) where upper(user)=upper(usr) and upper(user_priority.host)=upper(host);
|
||||
END IF;
|
||||
END;
|
||||
END;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
/*
|
||||
* $Id: calsetuserpriority.sql 9440 2013-04-24 21:07:42Z chao $
|
||||
*/
|
||||
|
||||
DELIMITER $$
|
||||
DROP PROCEDURE IF EXISTS infinidb_querystats.calSetUserPriority;
|
||||
CREATE PROCEDURE infinidb_querystats.calSetUserPriority(IN host VARCHAR(50), IN usr VARCHAR(50), IN pri VARCHAR(10))
|
||||
LANGUAGE SQL
|
||||
NOT DETERMINISTIC
|
||||
MODIFIES SQL DATA
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'Procedure to set a given InfiniDB user to the given priority'
|
||||
pri_validation: BEGIN
|
||||
IF upper(pri) not in ('HIGH', 'MEDIUM', 'LOW') THEN
|
||||
select "Priority can only be set to 'High', 'Medium', or 'Low'" Error;
|
||||
leave pri_validation;
|
||||
END IF;
|
||||
|
||||
IF INSTR(host, ":") != 0 THEN
|
||||
select "Port number cannot be used when setting user priority" Error;
|
||||
leave pri_validation;
|
||||
END IF;
|
||||
|
||||
user_validation: BEGIN
|
||||
DECLARE cnt,c INT;
|
||||
DECLARE cur_2 CURSOR for select count(*) from mysql.user where upper(user.host)=upper(host) and upper(user.user)=upper(usr);
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET c = 1;
|
||||
OPEN cur_2;
|
||||
SET cnt = 0;
|
||||
REPEAT
|
||||
FETCH cur_2 into cnt;
|
||||
until c = 1
|
||||
END REPEAT;
|
||||
IF cnt = 0 THEN
|
||||
select "User does not exist in MySQL" Error;
|
||||
LEAVE user_validation;
|
||||
END IF;
|
||||
|
||||
BEGIN
|
||||
DECLARE a, b INT;
|
||||
DECLARE cur_1 CURSOR FOR SELECT count(*) FROM infinidb_querystats.user_priority where upper(user)=upper(usr) and upper(user_priority.host)=upper(host);
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND
|
||||
SET b = 1;
|
||||
OPEN cur_1;
|
||||
SET a = 0;
|
||||
REPEAT
|
||||
FETCH cur_1 INTO a;
|
||||
UNTIL b = 1
|
||||
END REPEAT;
|
||||
CLOSE cur_1;
|
||||
IF a = 0 THEN
|
||||
insert into infinidb_querystats.user_priority values (host, usr, upper(pri));
|
||||
ELSE
|
||||
update infinidb_querystats.user_priority set priority=upper(pri) where upper(user)=upper(usr) and upper(user_priority.host)=upper(host);
|
||||
END IF;
|
||||
END;
|
||||
END;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
@ -14,36 +14,36 @@
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/*
|
||||
* $Id: calshowprocesslist.sql 9736 2013-08-02 18:49:52Z zzhu $
|
||||
*/
|
||||
|
||||
DELIMITER $$
|
||||
DROP PROCEDURE IF EXISTS infinidb_querystats.calShowProcessList;
|
||||
CREATE PROCEDURE infinidb_querystats.calShowProcessList()
|
||||
LANGUAGE SQL
|
||||
NOT DETERMINISTIC
|
||||
MODIFIES SQL DATA
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'Procedure to set a given InfiniDB user to the given priority'
|
||||
BEGIN
|
||||
SELECT id SESSION, processlist.user USER, upper(user_priority.priority) PRIORITY, processlist.host `HOST`,
|
||||
db `DB`, command `COMMAND`, (now() - interval time second) `START TIME`, time `EXEC TIME`, state `STATE`,
|
||||
info `INFO` FROM information_schema.processlist
|
||||
LEFT JOIN infinidb_querystats.user_priority ON
|
||||
(
|
||||
UPPER(CASE WHEN INSTR(processlist.host, ':') = 0
|
||||
THEN processlist.host
|
||||
ELSE SUBSTR(processlist.host, 1, INSTR(processlist.host, ':')-1 )
|
||||
END) =
|
||||
UPPER(CASE WHEN INSTR(user_priority.host, ':') = 0
|
||||
THEN user_priority.host
|
||||
ELSE SUBSTR(user_priority.host, 1, INSTR(user_priority.host, ':')-1 )
|
||||
END)
|
||||
AND
|
||||
UPPER(processlist.user) = UPPER(user_priority.user)
|
||||
)
|
||||
WHERE db != 'infinidb_querystats';
|
||||
END$$
|
||||
delimiter ;
|
||||
|
||||
/*
|
||||
* $Id: calshowprocesslist.sql 9736 2013-08-02 18:49:52Z zzhu $
|
||||
*/
|
||||
|
||||
DELIMITER $$
|
||||
DROP PROCEDURE IF EXISTS infinidb_querystats.calShowProcessList;
|
||||
CREATE PROCEDURE infinidb_querystats.calShowProcessList()
|
||||
LANGUAGE SQL
|
||||
NOT DETERMINISTIC
|
||||
MODIFIES SQL DATA
|
||||
SQL SECURITY INVOKER
|
||||
COMMENT 'Procedure to set a given InfiniDB user to the given priority'
|
||||
BEGIN
|
||||
SELECT id SESSION, processlist.user USER, upper(user_priority.priority) PRIORITY, processlist.host `HOST`,
|
||||
db `DB`, command `COMMAND`, (now() - interval time second) `START TIME`, time `EXEC TIME`, state `STATE`,
|
||||
info `INFO` FROM information_schema.processlist
|
||||
LEFT JOIN infinidb_querystats.user_priority ON
|
||||
(
|
||||
UPPER(CASE WHEN INSTR(processlist.host, ':') = 0
|
||||
THEN processlist.host
|
||||
ELSE SUBSTR(processlist.host, 1, INSTR(processlist.host, ':')-1 )
|
||||
END) =
|
||||
UPPER(CASE WHEN INSTR(user_priority.host, ':') = 0
|
||||
THEN user_priority.host
|
||||
ELSE SUBSTR(user_priority.host, 1, INSTR(user_priority.host, ':')-1 )
|
||||
END)
|
||||
AND
|
||||
UPPER(processlist.user) = UPPER(user_priority.user)
|
||||
)
|
||||
WHERE db != 'infinidb_querystats';
|
||||
END$$
|
||||
delimiter ;
|
||||
|
Reference in New Issue
Block a user