summaryrefslogtreecommitdiff
path: root/mysql-test/suite
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-08-13 01:08:30 +0200
committerSergei Golubchik <serg@mariadb.org>2017-08-14 19:45:59 +0200
commit399e14f066a4007f50c0060fe55f9b35949651ba (patch)
tree948c77226bdf37c5ff932e73c542ab077338650c /mysql-test/suite
parentd924e0b993e76201a1670976860425ce73ecacf4 (diff)
downloadmariadb-git-399e14f066a4007f50c0060fe55f9b35949651ba.tar.gz
MDEV-13435 Crash when selecting virtual columns generated using JSON functions
don't allocate memory on thd->mem_root in every fix_fields(), do it once and reuse.
Diffstat (limited to 'mysql-test/suite')
-rw-r--r--mysql-test/suite/vcol/r/wrong_arena.result9
-rw-r--r--mysql-test/suite/vcol/t/wrong_arena.test11
2 files changed, 20 insertions, 0 deletions
diff --git a/mysql-test/suite/vcol/r/wrong_arena.result b/mysql-test/suite/vcol/r/wrong_arena.result
index e86026852e4..c105a069b7f 100644
--- a/mysql-test/suite/vcol/r/wrong_arena.result
+++ b/mysql-test/suite/vcol/r/wrong_arena.result
@@ -59,3 +59,12 @@ a b
Warnings:
Warning 1292 Incorrect datetime value: '1'
drop table t1;
+create table t1 (
+id int not null ,
+js varchar(1000) not null,
+t time AS (cast(json_value(json_extract(js,concat('$.singleDay."', dayname(curdate()),'"')),'$.start') as time)) virtual);
+insert into t1(id,js) values (0, '{"default" : {"start": "00:00:00", "end":"23:59:50"}}');
+select * from t1;
+id js t
+0 {"default" : {"start": "00:00:00", "end":"23:59:50"}} NULL
+drop table t1;
diff --git a/mysql-test/suite/vcol/t/wrong_arena.test b/mysql-test/suite/vcol/t/wrong_arena.test
index 340634422ae..3d65dac9219 100644
--- a/mysql-test/suite/vcol/t/wrong_arena.test
+++ b/mysql-test/suite/vcol/t/wrong_arena.test
@@ -37,3 +37,14 @@ disconnect con1;
connection default;
select * from t1;
drop table t1;
+
+#
+# MDEV-13435 Crash when selecting virtual columns generated using JSON functions
+#
+create table t1 (
+ id int not null ,
+ js varchar(1000) not null,
+ t time AS (cast(json_value(json_extract(js,concat('$.singleDay."', dayname(curdate()),'"')),'$.start') as time)) virtual);
+insert into t1(id,js) values (0, '{"default" : {"start": "00:00:00", "end":"23:59:50"}}');
+select * from t1;
+drop table t1;