1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
|
<?xml version="1.0" encoding="utf-8"?>
<test>
<name>Smart attribute deletes</name>
<skip_indexer/>
<config>
indexer
{
mem_limit = 16M
}
searchd
{
<searchd_settings/>
workers = threads
binlog_path = #
}
index rt
{
type = rt
path = <data_path/>/rt
docinfo = extern
rt_field = body
rt_attr_multi = mva1
rt_attr_uint = gid
rt_attr_multi = mva2
}
index rt1 : rt
{
path = <data_path/>/rt1
}
index rt2 : rt
{
path = <data_path/>/rt2
}
index rtd0
{
type = distributed
local = rt
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
index rtd1
{
type = distributed
local = rt1
local = rt2
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
index rtd2
{
type = distributed
agent = <my_address/>:rt1
local = rt2
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
index rtd3
{
type = distributed
local = rt1
agent = <my_address/>:rt2
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
index rtd4
{
type = distributed
agent = <my_address/>:rt1
agent = <my_address/>:rt2
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
index rtd5
{
type = distributed
agent = <my_address/>:rt
agent_connect_timeout = 1000
agent_query_timeout = 3000
}
index remap_test
{
type = rt
path = <data_path/>/remap_test
rt_field = text
rt_attr_uint = attr_uint
rt_attr_bigint = attr_bigint
rt_attr_float = attr_float
rt_attr_string = attr_str
}
index edge_ints
{
type = rt
path = <data_path/>/edge_ints
rt_field = text
rt_attr_bigint = attr_bigint
}
</config>
<metaindex name='META:all'>
<index>rt</index>
<index>rt1</index>
<index>rt2</index>
<index>rtd0</index>
<index>rtd1</index>
<index>rtd2</index>
<index>rtd3</index>
<index>rtd4</index>
<index>rtd5</index>
</metaindex>
<sphqueries>
<sphinxql>insert into rt (id, gid, mva1, mva2, body) values (1, 11, (1, 1), (2), 'dummy'), (2, 22, (2, 2), (23), 'dummy2')</sphinxql>
<sphinxql>insert into rt (id, gid, mva1, mva2, body) values (3, 33, (3, 3), (32), 'dummy3'), (4, 44, (4, 4), (43), 'dummy4')</sphinxql>
<sphinxql>insert into rt (id, gid, mva1, mva2, body) values (5, 55, (5, 5), (52), 'dummy5'), (6, 66, (6, 6), (63), 'dummy6')</sphinxql>
<sphinxql>insert into rt (id, gid, mva1, mva2, body) values (100, 1000, (100, 201), (100), 'dumy'), (101, 1001, (101, 202), (101), 'dumy'), (102, 1002, (102, 203), (102), 'dumy'), (103, 1003, (103, 204), (103), 'dumy'), (104, 1004, (104, 204, 205), (104), 'dumy'), (105, 1005, (105, 206), (105), 'dumy'), (106, 1006, (106, 207), (106), 'dumy'), (107, 1007, (107, 208), (107), 'dumy')</sphinxql>
<sphinxql>insert into rt1 (id, gid, mva1, mva2, body) values (7, 77, (17, 17), (17), 'dummy7'), (8, 88, (8, 8), (18), 'dummy8')</sphinxql>
<sphinxql>insert into rt1 (id, gid, mva1, mva2, body) values (9, 99, (9, 9), (9), 'dummy9'), (10, 1010, (10, 10), (10), 'dummy10')</sphinxql>
<sphinxql>insert into rt2 (id, gid, mva1, mva2, body) values (7, 77, (27, 27), (27), 'dummy7'), (8, 88, (8, 8), (28), 'dummy8')</sphinxql>
<sphinxql>insert into rt2 (id, gid, mva1, mva2, body) values (11, 1111, (11, 11), (11), 'dummy11'), (12, 1212, (12, 12), (12), 'dummy12')</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rt where id=1</sphinxql>
<sphinxql>delete from rt where gid=22</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rtd0 where id=3</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rtd5 where gid=44</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rtd1 where id=7</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rtd4 where gid=88</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rtd2 where id=9</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rtd2 where gid=1010</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<!-- OPTION clause will cause error. That is ok -->
<sphinxql>delete from rtd3 where match ('dummy11') option ignore_nonexistent_columns=1</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>delete from rt where mva1=204</sphinxql>
<sphinxql>select * from rt</sphinxql>
<!-- One more non-working statement with OPTION clause. That is ok -->
<sphinxql>delete from rt where match ('dumy') option max_matches=2</sphinxql>
<sphinxql>select * from rt</sphinxql>
<sphinxql>delete from rtd4 where id=12</sphinxql>
<sphinxql>select * from META:all</sphinxql>
<sphinxql>insert into remap_test values (1, 'text1', 1, 1, 1.0, 'one')</sphinxql>
<sphinxql>insert into remap_test values (2, 'text2', 2, 2, 2.0, 'two')</sphinxql>
<sphinxql>insert into remap_test values (3, 'text3', 3, 3, 3.0, 'three')</sphinxql>
<sphinxql>select * from remap_test</sphinxql>
<sphinxql>select remap(id, attr_uint, (1, 3), (11, 33)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_bigint, (1, 3), (11, 33)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_float, (1, 3), (11., 33.)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_uint, (1, 3), (11., 33)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_float, (1, 3), (11, 33)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_uint, (1., 3), (11, 33)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_uint, (1, 3), (11, 33, 44)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_uint, (5, 3, 1), (55, 33, 11)) from remap_test</sphinxql>
<sphinxql>select remap(id*2+3, attr_uint*2, (7), (777)) from remap_test</sphinxql>
<sphinxql>select remap(1.0, attr_uint, (5, 3, 1), (55, 33, 11)) from remap_test</sphinxql>
<sphinxql>select remap(id, attr_string, (5, 3, 1), (55, 33, 11)) from remap_test</sphinxql>
<sphinxql>select id e1, attr_str e2, remap(e1, e2, (5, 3, 1), (55, 33, 11)) from remap_test</sphinxql>
<sphinxql>select id e1, attr_str e2, remap(e2, e1, (5, 3, 1), (55, 33, 11)) from remap_test</sphinxql>
<sphinxql>insert into edge_ints values (1,'',9223372036854775807)</sphinxql>
<sphinxql>insert into edge_ints values (2,'',-9223372036854775808)</sphinxql>
<sphinxql>select attr_bigint from edge_ints</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint>0</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint>=0</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint<0</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint<=0</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint>9223372036854775807</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint>=9223372036854775807</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint<-9223372036854775808</sphinxql>
<sphinxql>select attr_bigint from edge_ints where attr_bigint<=-9223372036854775808</sphinxql>
</sphqueries>
</test>
|