<?xml version="1.0" encoding="utf-8"?>
<Test>
  <Name>RT: basic transactional syntax</Name>

<skip_indexer/>
<Config>
indexer
{
	mem_limit			= 16M
}

searchd
{
<Searchd_Settings/>
	workers				= threads
	binlog_path			=
}

index test
{
	type			= rt
	path			= data/test
	rt_attr_uint	= idd
	rt_field		= content
}

index test1
{
	type			= rt
	path			= data/test1
	rt_attr_uint	= idd
	rt_field		= content
}

index test2
{
	type			= rt
	path			= data/test2
	rt_attr_uint	= idd
	rt_field		= content
}

</Config>

<SPHQueries>
	<SPHinxQL>insert into test (id,content) values (1,'content')</SPHinxQL>
	<SPHinxQL>insert into test1 (id,content) values (1,'content')</SPHinxQL>
	<SPHinxQL>select * from test</SPHinxQL>
	<SPHinxQL>select * from test1</SPHinxQL>
	<SPHinxQL>set autocommit=0</SPHinxQL>
	<SPHinxQL>insert into test (id,content) values (2,'content')</SPHinxQL>
	<SPHinxQL>insert into test1 (id,content) values (2,'content')</SPHinxQL>
	<SPHinxQL>delete from test1 where id=1</SPHinxQL>
	<SPHinxQL>delete from test where id=1</SPHinxQL>
	<SPHinxQL>set autocommit=1</SPHinxQL>
	<SPHinxQL>select * from test</SPHinxQL>
	<SPHinxQL>select * from test1</SPHinxQL>
	<SPHinxQL>begin</SPHinxQL>
	<SPHinxQL>insert into test1 (id,content) values (2,'content')</SPHinxQL>
	<SPHinxQL>rollback</SPHinxQL>
	<SPHinxQL>select * from test1</SPHinxQL>
	<SPHinxQL>start transaction</SPHinxQL>
	<SPHinxQL>insert into test1 (id,content) values (2,'content')</SPHinxQL>
	<SPHinxQL>commit</SPHinxQL>
	<SPHinxQL>select * from test1</SPHinxQL>
	<SPHinxQL>set autocommit=0</SPHinxQL>
	<SPHinxQL>insert into test (id,content) values (3,'content')</SPHinxQL>
	<SPHinxQL>select * from test</SPHinxQL>
	<SPHinxQL>set autocommit=1</SPHinxQL>
	<SPHinxQL>select * from test</SPHinxQL>
	<SPHinxQL>select * from test1</SPHinxQL>
	
	<!-- regression failed insert got passed next time -->
	<SPHinxQL>insert into test2 values (1, 'test', 11)</SPHinxQL>
	<SPHinxQL>insert into test2 values (2, 'test of my things going well', 22), (1, 'test', 12)</SPHinxQL>
	<SPHinxQL>insert into test2 values (3, 'test', 22), (3, 'test', 12), (3, 'test', 23)</SPHinxQL>
	<SPHinxQL>select id from test2</SPHinxQL>
</SPHQueries>	
</Test>
