<?xml version="1.0" encoding="utf-8"?>
<test>

<name>index format backwards compatibility pt.2</name>

<requires>
<non-rt/>
</requires>

<config>
indexer
{
	mem_limit = 16M
}

searchd
{
	<searchd_settings/>
	workers = threads
	<dynamic>
	  <variant>seamless_rotate = 0</variant>
	  <variant>seamless_rotate = 1</variant>
	</dynamic>
}

source test
{
	type = mysql
	<sql_settings/>
	sql_query = select 1, 'dummy' dummy
}

index plain
{
	source	= test
	path	= <data_path/>/plain
}

source dummy_rot
{
	type = mysql
	<sql_settings/>
	sql_query = select 1, 'dummy' body
}

index dummy_rot
{
	source	= dummy_rot
	path	= <data_path/>/dummy_rot
}

</config>

<custom_test><![CDATA[

$results[] = $client->Query ( 'dummy', 'plain' );
$results[] = $client->Query ( 'something', 'plain' );

$files = array ( 'spa', 'spd', 'sph', 'spi', 'spk', 'spm', 'spp', 'sps' );
foreach ( $files as $ext )
	copy ( "test_212/refdata/plain.new.$ext", "data/plain.new.$ext" );

RunIndexer ( $errors, '--rotate dummy_rot' ); // just to send SIGHUP to daemon	
sleep(2);

$results[] = $client->Query ( 'dummy', 'plain' );
$results[] = $client->Query ( 'something', 'plain' );

for ( $i=0; $i<count($results); $i++ )
	if ( is_array( $results[$i]) )
		unset ( $results[$i]["time"] );
]]></custom_test>


</test>
