Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0(EOL), 10.1(EOL)
-
None
-
10.0.28
Description
This script crashes the server:
CREATE TABLE IF NOT EXISTS t1 (i INT); |
DROP FUNCTION IF EXISTS f1; |
DELIMITER $$
|
CREATE FUNCTION f1() RETURNS VARCHAR(16383) |
BEGIN
|
RETURN 'test'; |
END; |
$$
|
DELIMITER ;
|
CREATE OR REPLACE TABLE t1 AS SELECT f1(); |
Note, if I replace CREATE OR REPLACE to a DROP followed by CREATE, it works fine:
CREATE TABLE IF NOT EXISTS t1 (i INT); |
DROP FUNCTION IF EXISTS f1; |
DELIMITER $$
|
CREATE FUNCTION f1() RETURNS VARCHAR(16383) |
BEGIN
|
RETURN 'test'; |
END; |
$$
|
DELIMITER ;
|
DROP TABLE IF EXISTS t1; |
CREATE TABLE t1 AS SELECT f1(); |
Attachments
Issue Links
- relates to
-
MDEV-11129 CREATE OR REPLACE TABLE t1 AS SELECT spfunc() crashes if spfunc() references t1
-
- Closed
-
-
MDEV-9496 Crash in CREATE OR REPLACE TABLE t1 AS SELECT stored_function()
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Description |
This script crashes the server:
{code:sql} DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; CREATE OR REPLACE TABLE t1 AS SELECT f1(); {code} Note, if I replace {{CREATE OR REPLACE}} to a {{DROP}} followed by {{CREATE}}, it works fine: {code:sql} DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; DROP TABLE IF EXISTS t1; CREATE TABLE t1 AS SELECT f1(); CREATE OR REPLACE TABLE t1 AS SELECT f1(); {code} |
This script crashes the server:
{code:sql} DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; CREATE OR REPLACE TABLE t1 AS SELECT f1(); {code} Note, if I replace {{CREATE OR REPLACE}} to a {{DROP}} followed by {{CREATE}}, it works fine: {code:sql} DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; DROP TABLE IF EXISTS t1; CREATE TABLE t1 AS SELECT f1(); {code} |
Description |
This script crashes the server:
{code:sql} DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; CREATE OR REPLACE TABLE t1 AS SELECT f1(); {code} Note, if I replace {{CREATE OR REPLACE}} to a {{DROP}} followed by {{CREATE}}, it works fine: {code:sql} DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; DROP TABLE IF EXISTS t1; CREATE TABLE t1 AS SELECT f1(); {code} |
This script crashes the server:
{code:sql} CREATE TABLE IF NOT EXISTS t1 (i INT); DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; CREATE OR REPLACE TABLE t1 AS SELECT f1(); {code} Note, if I replace {{CREATE OR REPLACE}} to a {{DROP}} followed by {{CREATE}}, it works fine: {code:sql} CREATE TABLE IF NOT EXISTS t1 (i INT); DROP FUNCTION IF EXISTS f1; DELIMITER $$ CREATE FUNCTION f1() RETURNS VARCHAR(16383) BEGIN RETURN 'test'; END; $$ DELIMITER ; DROP TABLE IF EXISTS t1; CREATE TABLE t1 AS SELECT f1(); {code} |
Assignee | Sergey Vojtovich [ svoj ] |
Fix Version/s | 10.1 [ 16100 ] |
Affects Version/s | 10.2 [ 14601 ] |
Sprint | 10.0.28 [ 107 ] |
Rank | Ranked lower |
Assignee | Sergey Vojtovich [ svoj ] | Sergei Golubchik [ serg ] |
Status | Open [ 1 ] | In Review [ 10002 ] |
Link |
This issue relates to |
Assignee | Sergei Golubchik [ serg ] | Sergey Vojtovich [ svoj ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Component/s | OTHER [ 10125 ] | |
Fix Version/s | 10.0.28 [ 22107 ] | |
Fix Version/s | 10.1.19 [ 22111 ] | |
Fix Version/s | 10.0 [ 16000 ] | |
Fix Version/s | 10.1 [ 16100 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |
Component/s | Locking [ 10900 ] | |
Component/s | OTHER [ 10125 ] |
Workflow | MariaDB v3 [ 77121 ] | MariaDB v4 [ 150925 ] |