21 lines
591 B
MySQL
21 lines
591 B
MySQL
|
DELIMITER $$
|
||
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`debugAdd`(vVariable VARCHAR(255), vValue VARCHAR(255))
|
||
|
MODIFIES SQL DATA
|
||
|
BEGIN
|
||
|
/**
|
||
|
* Añade una entrada de depuración en la tabla @debug.
|
||
|
*
|
||
|
* @param vVariable Nombre de variable
|
||
|
* @param vValue Valor de la variable
|
||
|
*/
|
||
|
DECLARE vIndex INT DEFAULT INSTR(USER(), '@');
|
||
|
|
||
|
INSERT INTO debug SET
|
||
|
`connectionId` = CONNECTION_ID(),
|
||
|
`user` = LEFT(USER(), vIndex - 1),
|
||
|
`host` = RIGHT(USER(), CHAR_LENGTH(USER()) - vIndex),
|
||
|
`variable` = vVariable,
|
||
|
`value` = vValue;
|
||
|
END$$
|
||
|
DELIMITER ;
|