1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#29363867: LOST CONNECTION TO MYSQL SERVER DURING QUERY

The problem is that sharing default expression among set instruction
leads to attempt access result field of function created in
other instruction runtime MEM_ROOT and already freed
(a bit different then MySQL problem).

Fix is the same as in MySQL (but no optimisation for constant), turn
DECLARE a, b, c type DEFAULT expr;
to
DECLARE a type DEFAULT expr, b type DEFAULT a, c type DEFAULT a;
This commit is contained in:
Oleksandr Byelkin
2021-04-27 16:08:33 +02:00
parent e85b389b76
commit 24693c6fcf
4 changed files with 71 additions and 17 deletions

View File

@ -7125,7 +7125,7 @@ CALL sp1();
x y z
000 000 000
Warnings:
Warning 1264 Out of range value for column 'z' at row 1
Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7163,7 +7163,7 @@ CALL sp1();
x y z
00000 00000 00000
Warnings:
Warning 1264 Out of range value for column 'z' at row 1
Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7201,7 +7201,7 @@ CALL sp1();
x y z
00000000 00000000 00000000
Warnings:
Warning 1264 Out of range value for column 'z' at row 1
Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7239,7 +7239,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Warning 1264 Out of range value for column 'z' at row 1
Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7277,7 +7277,7 @@ CALL sp1();
x y z
00000000000000000000 00000000000000000000 00000000000000000000
Warnings:
Warning 1264 Out of range value for column 'z' at row 1
Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7297,7 +7297,7 @@ CALL sp1();
x y z
-9999999999 -9999999999 -9999999999
Warnings:
Warning 1264 Out of range value for column 'z' at row 1
Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7308,7 +7308,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
Note 1265 Data truncated for column 'z' at row 1
Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7319,7 +7319,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Warning 1264 Out of range value for column 'z' at row 1
Warning 1264 Out of range value for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7330,7 +7330,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Note 1265 Data truncated for column 'z' at row 1
Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7341,7 +7341,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
Note 1265 Data truncated for column 'z' at row 1
Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7352,7 +7352,7 @@ CALL sp1();
x y z
0 0 0
Warnings:
Note 1265 Data truncated for column 'z' at row 1
Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7363,7 +7363,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Note 1265 Data truncated for column 'z' at row 1
Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN
@ -7374,7 +7374,7 @@ CALL sp1();
x y z
0000000000 0000000000 0000000000
Warnings:
Note 1265 Data truncated for column 'z' at row 1
Note 1265 Data truncated for column 'x' at row 1
DROP PROCEDURE IF EXISTS sp1;
CREATE PROCEDURE sp1( )
BEGIN