File: test.xml

package info (click to toggle)
sphinxsearch 2.2.11-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 25,720 kB
  • sloc: cpp: 102,259; xml: 85,608; sh: 9,259; php: 3,790; ansic: 3,158; yacc: 1,969; java: 1,336; ruby: 1,289; python: 1,062; pascal: 912; perl: 381; lex: 275; makefile: 150; sql: 77; cs: 35
file content (137 lines) | stat: -rw-r--r-- 3,612 bytes parent folder | download | duplicates (5)
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
<test>
<name>bigint attrs</name>

<config>
indexer
{
	mem_limit = 16M
}

searchd
{
	<searchd_settings/>
}

source test
{
	type = mysql
	<sql_settings/>

	sql_query = SELECT id, a, n, text FROM test_table;

	sql_attr_uint	= a
	sql_attr_bigint	= n
}

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

source test_flt
{
	type = mysql
	<sql_settings/>

	sql_query = SELECT id, n/1000000 as f, text FROM test_table;

	sql_attr_float	= f
}

index flt
{
	source	= test_flt
	path	= <data_path/>/flt
}

</config>

<db_create>
CREATE TABLE test_table
(
	id INT NOT NULL,
	a INT UNSIGNED NOT NULL,
	n BIGINT NOT NULL,
	text VARCHAR(255) NOT NULL DEFAULT 'text'
);
</db_create>

<db_drop>
DROP TABLE IF EXISTS test_table;
</db_drop>

<db_insert>
INSERT INTO test_table (id, a, n) VALUES
(   1,  10, -70000000000 ),
(   2,  20, -60000000000 ),
(   3,  30, -50000000000 ),
(   4,  40,  50000000000 ),
(   5,  50,  60000000000 ),
(   6,  60,  70000000000 ),
(   7,  70, -4611686018427387903 ),
(   8,  80, -9223372036854775807 ),
(   9,  90,  4611686018427387903 ),
(  10, 100,  9223372036854775807 ),
(  11, 110,  250000000000000000 ),
( 101,   0, -1 ),
( 102,   0, -2 );
</db_insert>

<query_attributes>
	<attr>a</attr>
	<attr>n</attr>
	<attr>sel</attr>
	<attr>@groupby</attr>
	<attr>@count</attr>
</query_attributes>

<queries>
	<query  index="test"/>

	<query sortmode="expr" sortby="-n" index="test"/>

	<query select="a, n, n + a as sel" index="test"/> <!-- doc_id=10 will warp-around -->

	<query groupfunc="attr" groupattr="n" index="test"/>
	<query select="abs(n) as sel, *" groupfunc="attr" groupattr="sel" index="test"/>

	<query select="idiv(abs(n), 10000000000) as sel, *"
		groupfunc="attr" groupattr="sel"
		id_range="1 6" index="test"/>

	<query select="idiv(70000000000, 10000000000) as sel, *"
		groupfunc="attr" groupattr="sel"
		id_range="1 6" index="test"/>

	<query select="min(a, n) as sel, *" index="test"/>

	<query filter="n" filter_value="-1" index="test" />
	<query filter="n" filter_value="-4611686018427387903" index="test" />
	<query filter="n" filter_value="4611686018427387903" index="test" />

	<query filter="n" filter_range="-100000000000 0" index="test"/>
	<query filter="n" filter_range="0 100000000000" index="test"/>
	<query filter="n" filter_range="-4611686018427387903 -4611686018427387900" index="test" />
</queries>

<!-- Regression for issue #1062 -->
<sphqueries>
<sphinxql>select *, -n as x from test order by x desc</sphinxql>
<sphinxql>select a, n, n+a as sel from test</sphinxql>
<sphinxql>select * from test group by n order by n desc</sphinxql>
<sphinxql>select abs(n) as sel, * from test group by sel order by sel desc</sphinxql>
<sphinxql>select idiv(abs(n), 10000000000) as sel, * from test where id between 1 and 6 group by sel</sphinxql>
<sphinxql>select idiv(70000000000, 10000000000) as sel, * from test where id between 1 and 6 group by sel</sphinxql>
<sphinxql>select min(a,n) as sel, * from test</sphinxql>
<sphinxql>select * from test where n=-1</sphinxql>
<sphinxql>select * from test where n=-4611686018427387903</sphinxql>
<sphinxql>select * from test where n=4611686018427387903</sphinxql>
<sphinxql>select * from test where n between -100000000000 and 0</sphinxql>
<sphinxql>select * from test where n between 0 and 100000000000</sphinxql>
<sphinxql>select * from test where n between -4611686018427387903 and -4611686018427387900</sphinxql>
<!-- regression BETWEEN int with float mixed -->
<sphinxql>select * from flt where f between -1.1 and 70001</sphinxql>
<sphinxql>select * from flt where f between 1 and 70000.1</sphinxql>
</sphqueries>
</test>