Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
10.4.7, 10.4(EOL), 10.5
-
Redhat Enterprise Linux 7
Description
Call stored procedure with IF NOT EXISTS AND NOT EXISTS condition crash the DB server.
The case can be reproduced as follows:
1. Create tables 'test' and 'test2' and insert values into them:
CREATE TABLE `test` ( |
`name` varchar(100) NOT NULL, |
`address` varchar(100) DEFAULT NULL, |
PRIMARY KEY (`name`)); |
|
CREATE TABLE `test2` ( |
`name` varchar(100) NOT NULL, |
`address` varchar(100) DEFAULT NULL, |
PRIMARY KEY (`name`)); |
|
INSERT INTO test VALUES ('a', 'aaa'); |
INSERT INTO test2 VALUES ('a', 'aaa'); |
2. Create stored procedure 'test_if':
DELIMITER ;;
|
DROP PROCEDURE IF EXISTS `test_if` ; |
CREATE PROCEDURE `test_if`( |
IN in_name NVARCHAR(20) |
)
|
BEGIN
|
|
If NOT EXISTS (select name from test where name = name) |
AND NOT EXISTS (select name from test2 where name = name) |
THEN |
select "NOT EXISTS"; |
ELSE |
select "EXISTS"; |
END IF; |
|
SELECT * FROM test; |
END ;; |
DELIMITER ;
|
3. Run: call test_if('a'); (OK, no error)
4. Run again: call test_if('a'); , it will crash the DB server
The error message 'error.txt' is attached for your reference.
Please investigate.
Thanks,
Chow King Tak
Attachments
Issue Links
- is duplicated by
-
MDEV-21199 Segfault
-
- Closed
-
-
MDEV-21729 Triggeraufruf fĂĽhrt zu Crash des Servers
-
- Closed
-
- relates to
-
MDEV-20284 Some pointers may be invalid and cause the dump to abort.
-
- Closed
-
-
MDEV-20290 Server crash in st_select_lex::cleanup or Assertion `sl->join == 0' failed in reinit_stmt_before_use
-
- Closed
-
-
MDEV-20858 Function crash server
-
- Closed
-
-
MDEV-21315 Server 10.4 sporadically crashes when issuing simple INSERT commands
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Component/s | Stored routines [ 13905 ] | |
Component/s | Server [ 13907 ] | |
Fix Version/s | 10.4 [ 22408 ] |
Status | Open [ 1 ] | Confirmed [ 10101 ] |
Link |
This issue relates to |
Assignee | Oleksandr Byelkin [ sanja ] |
Link |
This issue relates to |
Link |
This issue is duplicated by |
Link |
This issue is duplicated by |
Link |
This issue is duplicated by |
Link |
This issue relates to |
Link |
This issue is duplicated by |
Link |
This issue relates to |
Affects Version/s | 10.4 [ 22408 ] |
Description |
Call stored procedure with IF NOT EXISTS AND NOT EXISTS condition crash the DB server.
The case can be reproduced as follows: 1. Create tables 'test' and 'test2' and insert values into them: CREATE TABLE `test` ( `name` varchar(100) NOT NULL, `address` varchar(100) DEFAULT NULL, PRIMARY KEY (`name`)); CREATE TABLE `test2` ( `name` varchar(100) NOT NULL, `address` varchar(100) DEFAULT NULL, PRIMARY KEY (`name`)); INSERT INTO test VALUES ('a', 'aaa'); INSERT INTO test2 VALUES ('a', 'aaa'); 2. Create stored procedure 'test_if': DELIMITER ;; DROP PROCEDURE IF EXISTS `test_if` ; CREATE PROCEDURE `test_if`( IN in_name NVARCHAR(20) ) BEGIN If NOT EXISTS (select name from test where name = name) AND NOT EXISTS (select name from test2 where name = name) THEN select "NOT EXISTS"; ELSE select "EXISTS"; END IF; SELECT * FROM test; END ;; DELIMITER ; 3. Run: call test_if('a'); (OK, no error) 4. Run again: call test_if('a'); , it will crash the DB server The error message 'error.txt' is attached for your reference. Please investigate. Thanks, Chow King Tak |
Call stored procedure with IF NOT EXISTS AND NOT EXISTS condition crash the DB server.
The case can be reproduced as follows: 1. Create tables 'test' and 'test2' and insert values into them: {code:sql} CREATE TABLE `test` ( `name` varchar(100) NOT NULL, `address` varchar(100) DEFAULT NULL, PRIMARY KEY (`name`)); CREATE TABLE `test2` ( `name` varchar(100) NOT NULL, `address` varchar(100) DEFAULT NULL, PRIMARY KEY (`name`)); INSERT INTO test VALUES ('a', 'aaa'); INSERT INTO test2 VALUES ('a', 'aaa'); {code} 2. Create stored procedure 'test_if': {code:sql} DELIMITER ;; DROP PROCEDURE IF EXISTS `test_if` ; CREATE PROCEDURE `test_if`( IN in_name NVARCHAR(20) ) BEGIN If NOT EXISTS (select name from test where name = name) AND NOT EXISTS (select name from test2 where name = name) THEN select "NOT EXISTS"; ELSE select "EXISTS"; END IF; SELECT * FROM test; END ;; DELIMITER ; {code} 3. Run: call test_if('a'); (OK, no error) 4. Run again: call test_if('a'); , it will crash the DB server The error message 'error.txt' is attached for your reference. Please investigate. Thanks, Chow King Tak |
Affects Version/s | 10.5 [ 23123 ] |
Fix Version/s | 10.5 [ 23123 ] |
Fix Version/s | 10.5.4 [ 24264 ] | |
Fix Version/s | 10.4.13 [ 24223 ] | |
Fix Version/s | 10.4 [ 22408 ] | |
Fix Version/s | 10.5 [ 23123 ] | |
Resolution | Duplicate [ 3 ] | |
Status | Confirmed [ 10101 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 100349 ] | MariaDB v4 [ 156847 ] |
Zendesk Related Tickets | 169530 128337 |