Debian Codegraph @

mysql-test/suite/maria/range.test

raw
1 --source include/have_sequence.inc
2
3 --echo #
4 --echo # MDEV-22935 Erroneous Aria Index / Optimizer behaviour
5 --echo #
6
7 create table t1 (a char(255), b datetime, primary key(a,b)) engine=aria transactional=0 pack_keys=0;
8 insert into t1 select concat("hello world hello world", truncate(seq/100,0)),from_unixtime(seq+1) from seq_1_to_20000;
9
10 let $i= 200;
11 --disable_query_log
12 while ($i)
13 {
14 let $tmp= `select count(*) from t1 where a="hello world hello world$i" and b <= from_unixtime($i*100+1)`;
15 if (`SELECT $tmp != 1`)
16 {
17 --echo "Found $tmp rows, expected 1, for value $i"
18 }
19 dec $i;
20 }
21 --enable_query_log
22 drop table t1;