Gentoo Archives: gentoo-commits

From: "Arfrever Frehtes Taifersar Arahesis (arfrever)" <arfrever@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-db/sqlite/files: sqlite-3.7.3-icu_tests.patch
Date: Mon, 01 Nov 2010 19:39:05
Message-Id: 20101101193859.D51DA20051@flycatcher.gentoo.org
1 arfrever 10/11/01 19:38:59
2
3 Added: sqlite-3.7.3-icu_tests.patch
4 Log:
5 Fix tests with USE="icu" (bug #342469).
6
7 (Portage version: 2.2.0_alpha3/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.1 dev-db/sqlite/files/sqlite-3.7.3-icu_tests.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/sqlite/files/sqlite-3.7.3-icu_tests.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-db/sqlite/files/sqlite-3.7.3-icu_tests.patch?rev=1.1&content-type=text/plain
14
15 Index: sqlite-3.7.3-icu_tests.patch
16 ===================================================================
17 --- test/e_expr.test
18 +++ test/e_expr.test
19 @@ -937,8 +937,14 @@
20 # 'a'&nbsp;LIKE&nbsp;'A' is TRUE but
21 # '&aelig;'&nbsp;LIKE&nbsp;'&AElig;' is FALSE.
22 #
23 +# The restriction to ASCII characters does not apply if the ICU
24 +# library is compiled in. When ICU is enabled SQLite does not act
25 +# as it does "by default".
26 +#
27 do_execsql_test e_expr-14.5.1 { SELECT 'A' LIKE 'a' } 1
28 -do_execsql_test e_expr-14.5.2 "SELECT '\u00c6' LIKE '\u00e6'" 0
29 +ifcapable !icu {
30 + do_execsql_test e_expr-14.5.2 "SELECT '\u00c6' LIKE '\u00e6'" 0
31 +}
32
33 # EVIDENCE-OF: R-56683-13731 If the optional ESCAPE clause is present,
34 # then the expression following the ESCAPE keyword must evaluate to a
35 @@ -985,7 +991,8 @@
36 eval lappend ::likeargs $args
37 return 1
38 }
39 -db func like likefunc
40 +db func like -argcount 2 likefunc
41 +db func like -argcount 3 likefunc
42 set ::likeargs [list]
43 do_execsql_test e_expr-15.1.1 { SELECT 'abc' LIKE 'def' } 1
44 do_test e_expr-15.1.2 { set likeargs } {def abc}
45 @@ -1056,12 +1063,16 @@
46 # default and so use of the REGEXP operator will normally result in an
47 # error message.
48 #
49 -do_catchsql_test e_expr-18.1.1 {
50 - SELECT regexp('abc', 'def')
51 -} {1 {no such function: regexp}}
52 -do_catchsql_test e_expr-18.1.2 {
53 - SELECT 'abc' REGEXP 'def'
54 -} {1 {no such function: REGEXP}}
55 +# There is a regexp function if ICU is enabled though.
56 +#
57 +ifcapable !icu {
58 + do_catchsql_test e_expr-18.1.1 {
59 + SELECT regexp('abc', 'def')
60 + } {1 {no such function: regexp}}
61 + do_catchsql_test e_expr-18.1.2 {
62 + SELECT 'abc' REGEXP 'def'
63 + } {1 {no such function: REGEXP}}
64 +}
65
66 # EVIDENCE-OF: R-33693-50180 The REGEXP operator is a special syntax for
67 # the regexp() user function.
68 --- test/like.test
69 +++ test/like.test
70 @@ -115,7 +115,7 @@
71 proc test_regexp {a b} {
72 return [regexp $a $b]
73 }
74 - db function regexp test_regexp
75 + db function regexp -argcount 2 test_regexp
76 execsql {
77 SELECT x FROM t1 WHERE x REGEXP 'abc' ORDER BY 1;
78 }
79 @@ -608,7 +608,7 @@
80 } {1 abcdef 1 ghijkl 1 mnopqr 2 abcdef 2 ghijkl 2 mnopqr}
81
82
83 -ifcapable like_opt {
84 +ifcapable like_opt&&!icu {
85 # Evaluate SQL. Return the result set followed by the
86 # and the number of full-scan steps.
87 #
88 @@ -673,110 +673,110 @@
89 regexp {INDEX i2} $res
90 } {1}
91 }
92 -}
93 -
94 -# Do an SQL statement. Append the search count to the end of the result.
95 -#
96 -proc count sql {
97 - set ::sqlite_search_count 0
98 - set ::sqlite_like_count 0
99 - return [concat [execsql $sql] scan $::sqlite_search_count \
100 - like $::sqlite_like_count]
101 -}
102
103 -# The LIKE and GLOB optimizations do not work on columns with
104 -# affinity other than TEXT.
105 -# Ticket #3901
106 -#
107 -do_test like-10.1 {
108 - db close
109 - sqlite3 db test.db
110 - execsql {
111 - CREATE TABLE t10(
112 - a INTEGER PRIMARY KEY,
113 - b INTEGER COLLATE nocase UNIQUE,
114 - c NUMBER COLLATE nocase UNIQUE,
115 - d BLOB COLLATE nocase UNIQUE,
116 - e COLLATE nocase UNIQUE,
117 - f TEXT COLLATE nocase UNIQUE
118 - );
119 - INSERT INTO t10 VALUES(1,1,1,1,1,1);
120 - INSERT INTO t10 VALUES(12,12,12,12,12,12);
121 - INSERT INTO t10 VALUES(123,123,123,123,123,123);
122 - INSERT INTO t10 VALUES(234,234,234,234,234,234);
123 - INSERT INTO t10 VALUES(345,345,345,345,345,345);
124 - INSERT INTO t10 VALUES(45,45,45,45,45,45);
125 - }
126 - count {
127 - SELECT a FROM t10 WHERE b LIKE '12%' ORDER BY a;
128 - }
129 -} {12 123 scan 5 like 6}
130 -do_test like-10.2 {
131 - count {
132 - SELECT a FROM t10 WHERE c LIKE '12%' ORDER BY a;
133 - }
134 -} {12 123 scan 5 like 6}
135 -do_test like-10.3 {
136 - count {
137 - SELECT a FROM t10 WHERE d LIKE '12%' ORDER BY a;
138 - }
139 -} {12 123 scan 5 like 6}
140 -do_test like-10.4 {
141 - count {
142 - SELECT a FROM t10 WHERE e LIKE '12%' ORDER BY a;
143 - }
144 -} {12 123 scan 5 like 6}
145 -do_test like-10.5 {
146 - count {
147 - SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY a;
148 - }
149 -} {12 123 scan 3 like 0}
150 -do_test like-10.6 {
151 - count {
152 - SELECT a FROM t10 WHERE a LIKE '12%' ORDER BY a;
153 - }
154 -} {12 123 scan 5 like 6}
155 -do_test like-10.10 {
156 - execsql {
157 - CREATE TABLE t10b(
158 - a INTEGER PRIMARY KEY,
159 - b INTEGER UNIQUE,
160 - c NUMBER UNIQUE,
161 - d BLOB UNIQUE,
162 - e UNIQUE,
163 - f TEXT UNIQUE
164 - );
165 - INSERT INTO t10b SELECT * FROM t10;
166 - }
167 - count {
168 - SELECT a FROM t10b WHERE b GLOB '12*' ORDER BY a;
169 - }
170 -} {12 123 scan 5 like 6}
171 -do_test like-10.11 {
172 - count {
173 - SELECT a FROM t10b WHERE c GLOB '12*' ORDER BY a;
174 - }
175 -} {12 123 scan 5 like 6}
176 -do_test like-10.12 {
177 - count {
178 - SELECT a FROM t10b WHERE d GLOB '12*' ORDER BY a;
179 - }
180 -} {12 123 scan 5 like 6}
181 -do_test like-10.13 {
182 - count {
183 - SELECT a FROM t10b WHERE e GLOB '12*' ORDER BY a;
184 - }
185 -} {12 123 scan 5 like 6}
186 -do_test like-10.14 {
187 - count {
188 - SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY a;
189 - }
190 -} {12 123 scan 3 like 0}
191 -do_test like-10.15 {
192 - count {
193 - SELECT a FROM t10b WHERE a GLOB '12*' ORDER BY a;
194 + # Do an SQL statement. Append the search count to the end of the result.
195 + #
196 + proc count sql {
197 + set ::sqlite_search_count 0
198 + set ::sqlite_like_count 0
199 + return [concat [execsql $sql] scan $::sqlite_search_count \
200 + like $::sqlite_like_count]
201 }
202 -} {12 123 scan 5 like 6}
203 +
204 + # The LIKE and GLOB optimizations do not work on columns with
205 + # affinity other than TEXT.
206 + # Ticket #3901
207 + #
208 + do_test like-10.1 {
209 + db close
210 + sqlite3 db test.db
211 + execsql {
212 + CREATE TABLE t10(
213 + a INTEGER PRIMARY KEY,
214 + b INTEGER COLLATE nocase UNIQUE,
215 + c NUMBER COLLATE nocase UNIQUE,
216 + d BLOB COLLATE nocase UNIQUE,
217 + e COLLATE nocase UNIQUE,
218 + f TEXT COLLATE nocase UNIQUE
219 + );
220 + INSERT INTO t10 VALUES(1,1,1,1,1,1);
221 + INSERT INTO t10 VALUES(12,12,12,12,12,12);
222 + INSERT INTO t10 VALUES(123,123,123,123,123,123);
223 + INSERT INTO t10 VALUES(234,234,234,234,234,234);
224 + INSERT INTO t10 VALUES(345,345,345,345,345,345);
225 + INSERT INTO t10 VALUES(45,45,45,45,45,45);
226 + }
227 + count {
228 + SELECT a FROM t10 WHERE b LIKE '12%' ORDER BY a;
229 + }
230 + } {12 123 scan 5 like 6}
231 + do_test like-10.2 {
232 + count {
233 + SELECT a FROM t10 WHERE c LIKE '12%' ORDER BY a;
234 + }
235 + } {12 123 scan 5 like 6}
236 + do_test like-10.3 {
237 + count {
238 + SELECT a FROM t10 WHERE d LIKE '12%' ORDER BY a;
239 + }
240 + } {12 123 scan 5 like 6}
241 + do_test like-10.4 {
242 + count {
243 + SELECT a FROM t10 WHERE e LIKE '12%' ORDER BY a;
244 + }
245 + } {12 123 scan 5 like 6}
246 + do_test like-10.5 {
247 + count {
248 + SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY a;
249 + }
250 + } {12 123 scan 3 like 0}
251 + do_test like-10.6 {
252 + count {
253 + SELECT a FROM t10 WHERE a LIKE '12%' ORDER BY a;
254 + }
255 + } {12 123 scan 5 like 6}
256 + do_test like-10.10 {
257 + execsql {
258 + CREATE TABLE t10b(
259 + a INTEGER PRIMARY KEY,
260 + b INTEGER UNIQUE,
261 + c NUMBER UNIQUE,
262 + d BLOB UNIQUE,
263 + e UNIQUE,
264 + f TEXT UNIQUE
265 + );
266 + INSERT INTO t10b SELECT * FROM t10;
267 + }
268 + count {
269 + SELECT a FROM t10b WHERE b GLOB '12*' ORDER BY a;
270 + }
271 + } {12 123 scan 5 like 6}
272 + do_test like-10.11 {
273 + count {
274 + SELECT a FROM t10b WHERE c GLOB '12*' ORDER BY a;
275 + }
276 + } {12 123 scan 5 like 6}
277 + do_test like-10.12 {
278 + count {
279 + SELECT a FROM t10b WHERE d GLOB '12*' ORDER BY a;
280 + }
281 + } {12 123 scan 5 like 6}
282 + do_test like-10.13 {
283 + count {
284 + SELECT a FROM t10b WHERE e GLOB '12*' ORDER BY a;
285 + }
286 + } {12 123 scan 5 like 6}
287 + do_test like-10.14 {
288 + count {
289 + SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY a;
290 + }
291 + } {12 123 scan 3 like 0}
292 + do_test like-10.15 {
293 + count {
294 + SELECT a FROM t10b WHERE a GLOB '12*' ORDER BY a;
295 + }
296 + } {12 123 scan 5 like 6}
297 +}
298
299 # LIKE and GLOB where the default collating sequence is not appropriate
300 # but an index with the appropriate collating sequence exists.