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