1--source include/not_embedded.inc
2# Don't test this under valgrind, memory leaks will occur as we crash
3--source include/not_valgrind.inc
4# Binary must be compiled with debug for crash to occur
5--source include/have_debug.inc
6--source include/have_maria.inc
7--source include/have_geometry.inc
8--source include/default_charset.inc
9
10set global aria_log_file_size=4294967295;
11let $MARIA_LOG=../../tmp;
12
13--disable_warnings
14drop database if exists mysqltest;
15--enable_warnings
16create database mysqltest;
17let $mms_tname=t;
18
19# Include scripts can perform SQL. For it to not influence the main test
20# they use a separate connection. This way if they use a DDL it would
21# not autocommit in the main test.
22connect (admin, localhost, root,,mysqltest,,);
23--enable_reconnect
24
25connection default;
26use mysqltest;
27--enable_reconnect
28
29-- source include/maria_empty_logs.inc
30let $mms_tables=1;
31CREATE TABLE t1 (
32  i int,
33  shape GEOMETRY NOT NULL,
34  SPATIAL (shape)
35) ENGINE=ARIA;
36insert into t1 values(1,POINT(1, 1));
37-- source include/maria_make_snapshot_for_feeding_recovery.inc
38insert into t1 values(2,POINT(2, 2)), (3,POINT(3, 3)), (4,POINT(4, 4));
39-- source include/maria_make_snapshot_for_comparison.inc
40let $mvr_restore_old_snapshot=1;
41let $mms_compare_physically=0;
42let $mvr_debug_option="+d,maria_flush_whole_log,maria_crash";
43let $mvr_crash_statement= set global aria_checkpoint_interval=1;
44-- source include/maria_verify_recovery.inc
45show create table t1;
46
47# Test that UPDATE's effect on auto-increment is recovered
48--echo * TEST of UPDATE vs state.auto_increment
49-- source include/maria_make_snapshot_for_feeding_recovery.inc
50update t1 set shape=POINT(5, 5) where i=2;
51-- source include/maria_make_snapshot_for_comparison.inc
52let $mvr_restore_old_snapshot=1;
53let $mms_compare_physically=0;
54let $mvr_debug_option="+d,maria_flush_whole_log,maria_crash";
55let $mvr_crash_statement= set global aria_checkpoint_interval=1;
56-- source include/maria_verify_recovery.inc
57show create table t1;
58drop table t1;
59
60# clean up everything
61let $mms_purpose=feeding_recovery;
62eval drop database mysqltest_for_$mms_purpose;
63let $mms_purpose=comparison;
64eval drop database mysqltest_for_$mms_purpose;
65drop database mysqltest;
66