| 1 |
SET sql_mode=oracle; |
| 2 |
|
| 3 |
--echo # |
| 4 |
--echo # MDEV-10411 Providing compatibility for basic PL/SQL constructs |
| 5 |
--echo # Part 6: Assignment operator |
| 6 |
--echo # |
| 7 |
|
| 8 |
max_sort_length:=1030; |
| 9 |
SELECT @@max_sort_length; |
| 10 |
max_sort_length:=DEFAULT; |
| 11 |
|
| 12 |
--echo # |
| 13 |
--echo # Testing that SP variables shadow global variables in assignments |
| 14 |
--echo # |
| 15 |
|
| 16 |
DELIMITER $$; |
| 17 |
CREATE PROCEDURE p1 |
| 18 |
AS |
| 19 |
BEGIN |
| 20 |
max_sort_length:=1030; |
| 21 |
DECLARE |
| 22 |
max_sort_length INT DEFAULT 1031; |
| 23 |
BEGIN |
| 24 |
SELECT @@max_sort_length, max_sort_length; |
| 25 |
max_sort_length:=1032; |
| 26 |
SELECT @@max_sort_length, max_sort_length; |
| 27 |
END; |
| 28 |
SELECT @@max_sort_length; |
| 29 |
max_sort_length:= DEFAULT; |
| 30 |
END; |
| 31 |
$$ |
| 32 |
DELIMITER ;$$ |
| 33 |
CALL p1(); |
| 34 |
DROP PROCEDURE p1; |
| 35 |
|
| 36 |
--echo # |
| 37 |
--echo # End of MDEV-10411 Providing compatibility for basic PL/SQL constructs (part 6) |
| 38 |
--echo # |