http://dev.mysql.com/doc/refman/8.0/en/commit.html 页: 1 如下所示:
DELIMITER $$
CREATE PROCEDURE my_proc()
BEGIN
DECLARE v1 INT DEFAULT 2; -- v1 is 2
START TRANSACTION;
SELECT 5 INTO v1; -- v1 is 5
SELECT v1; -- v1 is 5
ROLLBACK; -- Here
SELECT v1; -- v1 is 5
END$$
DELIMITER ;
以下为实际结果<代码>v1 <代码>5:
mysql> CALL my_proc();
+------+
| v1 |
+------+
| 5 |
+------+
1 row in set (0.00 sec)
+------+
| v1 |
+------+
| 5 |
+------+
1 row in set (0.00 sec)
因此,我怎么能击退当地变量?