如题,将会导致的结果就是参数的值将不会是你传入的值,而是变成每条记录的那个字段的值。
这样的后果,是灰常严重的。比如执行删除操作,它能把整个表的记录全删了。这个是我的血淋淋的代价啊。 死坑如下,勿跳:-
- DELIMITER $$
- USE `b10k`$$
- DROP PROCEDURE IF EXISTS `sp_delete_species`$$
- CREATE DEFINER=`luth`@`%` PROCEDURE `sp_delete_species`(
- IN species_id INT, /*物种ID*/
- OUT out_rows INT /*受影响行数*/
- )
- BEGIN
- DELETE FROM `sample` WHERE `species_ID` = species_id ;
- DELETE FROM `filepath` WHERE `species_ID` = species_id ;
- DELETE FROM `species` WHERE `species_ID` = species_id ;
- SET out_rows = ROW_COUNT();
- END$$
- DELIMITER ;