summaryrefslogtreecommitdiff
path: root/mysql-test/suite/vcol
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-01-14 20:55:33 +0100
committerSergei Golubchik <serg@mariadb.org>2017-01-15 00:11:50 +0100
commit798fcb541698cbf51f1ee33f44b023c11dc2b784 (patch)
tree12a47741ef63500d339a1e076cafa500a03498b0 /mysql-test/suite/vcol
parent67e2028161d1f653a852f1a4679ff5e523296218 (diff)
downloadmariadb-git-798fcb541698cbf51f1ee33f44b023c11dc2b784.tar.gz
bugfix: cmp_item_row::alloc_comparators() allocated on the wrong arena
it used current_thd->alloc() and allocated on the thd's execution arena, not on table->expr_arena. Remove THD::arena_for_cached_items that is temporarily set in update_virtual_fields(), and replaces THD arena in get_datetime_value(). Instead set THD arena to table->expr_arena for the whole duration of update_virtual_fields()
Diffstat (limited to 'mysql-test/suite/vcol')
-rw-r--r--mysql-test/suite/vcol/r/wrong_arena.result19
-rw-r--r--mysql-test/suite/vcol/t/wrong_arena.test4
2 files changed, 16 insertions, 7 deletions
diff --git a/mysql-test/suite/vcol/r/wrong_arena.result b/mysql-test/suite/vcol/r/wrong_arena.result
index d542c82458e..af41ea89ab5 100644
--- a/mysql-test/suite/vcol/r/wrong_arena.result
+++ b/mysql-test/suite/vcol/r/wrong_arena.result
@@ -2,7 +2,9 @@ create table t1 (a datetime,
# get_datetime_value
b int as (a > 1), # Arg_comparator
c int as (a in (1,2,3)), # in_datetime
-d int as ((a,a) in ((1,1),(2,1),(NULL,1))) # cmp_item_datetime
+d int as ((a,a) in ((1,1),(2,1),(NULL,1))), # cmp_item_datetime
+# other issues
+e int as ((a,1) in ((1,1),(2,1),(NULL,1))) # cmp_item_row::alloc_comparators()
);
Warnings:
Warning 1292 Incorrect datetime value: '1'
@@ -14,7 +16,8 @@ t1 CREATE TABLE `t1` (
`a` datetime DEFAULT NULL,
`b` int(11) AS (a > 1) VIRTUAL,
`c` int(11) AS (a in (1,2,3)) VIRTUAL,
- `d` int(11) AS ((a,a) in ((1,1),(2,1),(NULL,1))) VIRTUAL
+ `d` int(11) AS ((a,a) in ((1,1),(2,1),(NULL,1))) VIRTUAL,
+ `e` int(11) AS ((a,1) in ((1,1),(2,1),(NULL,1))) VIRTUAL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
Warnings:
Warning 1292 Incorrect datetime value: '1'
@@ -22,18 +25,22 @@ Warning 1292 Incorrect datetime value: '2'
Warning 1292 Incorrect datetime value: '3'
insert t1 (a) values ('2010-10-10 10:10:10');
select * from t1;
-a b c d
-2010-10-10 10:10:10 1 0 0
+a b c d e
+2010-10-10 10:10:10 1 0 0 NULL
Warnings:
Warning 1292 Incorrect datetime value: '1'
Warning 1292 Incorrect datetime value: '1'
Warning 1292 Incorrect datetime value: '2'
Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '2'
select * from t1;
-a b c d
-2010-10-10 10:10:10 1 0 0
+a b c d e
+2010-10-10 10:10:10 1 0 0 NULL
Warnings:
Warning 1292 Incorrect datetime value: '1'
Warning 1292 Incorrect datetime value: '2'
Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '1'
+Warning 1292 Incorrect datetime value: '2'
drop table t1;
diff --git a/mysql-test/suite/vcol/t/wrong_arena.test b/mysql-test/suite/vcol/t/wrong_arena.test
index 8bf06bdb9bd..4276437f446 100644
--- a/mysql-test/suite/vcol/t/wrong_arena.test
+++ b/mysql-test/suite/vcol/t/wrong_arena.test
@@ -10,7 +10,9 @@ create table t1 (a datetime,
# get_datetime_value
b int as (a > 1), # Arg_comparator
c int as (a in (1,2,3)), # in_datetime
- d int as ((a,a) in ((1,1),(2,1),(NULL,1))) # cmp_item_datetime
+ d int as ((a,a) in ((1,1),(2,1),(NULL,1))), # cmp_item_datetime
+ # other issues
+ e int as ((a,1) in ((1,1),(2,1),(NULL,1))) # cmp_item_row::alloc_comparators()
);
show create table t1;
connect con1, localhost, root;