summaryrefslogtreecommitdiff
path: root/dev-db
diff options
context:
space:
mode:
authorArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-11-01 19:38:59 +0000
committerArfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>2010-11-01 19:38:59 +0000
commit1df8d0ca4369f4d73490047bb8bf5823e5b86b4a (patch)
tree70367644fc43e4bec669c1aa7b2a0031b0b90e10 /dev-db
parentRespect CC by Christian Franke (bug #235768). (diff)
downloadgentoo-2-1df8d0ca4369f4d73490047bb8bf5823e5b86b4a.tar.gz
gentoo-2-1df8d0ca4369f4d73490047bb8bf5823e5b86b4a.tar.bz2
gentoo-2-1df8d0ca4369f4d73490047bb8bf5823e5b86b4a.zip
Fix tests with USE="icu" (bug #342469).
(Portage version: 2.2.0_alpha3/cvs/Linux x86_64)
Diffstat (limited to 'dev-db')
-rw-r--r--dev-db/sqlite/ChangeLog6
-rw-r--r--dev-db/sqlite/files/sqlite-3.7.3-icu_tests.patch284
-rw-r--r--dev-db/sqlite/sqlite-3.7.3.ebuild7
3 files changed, 291 insertions, 6 deletions
diff --git a/dev-db/sqlite/ChangeLog b/dev-db/sqlite/ChangeLog
index 9510e51906f6..d67871dec757 100644
--- a/dev-db/sqlite/ChangeLog
+++ b/dev-db/sqlite/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for dev-db/sqlite
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/sqlite/ChangeLog,v 1.354 2010/10/31 09:27:03 betelgeuse Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/sqlite/ChangeLog,v 1.355 2010/11/01 19:38:59 arfrever Exp $
+
+ 01 Nov 2010; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org>
+ sqlite-3.7.3.ebuild, +files/sqlite-3.7.3-icu_tests.patch:
+ Fix tests with USE="icu" (bug #342469).
*sqlite-3.7.3 (31 Oct 2010)
diff --git a/dev-db/sqlite/files/sqlite-3.7.3-icu_tests.patch b/dev-db/sqlite/files/sqlite-3.7.3-icu_tests.patch
new file mode 100644
index 000000000000..9e8b77a21efa
--- /dev/null
+++ b/dev-db/sqlite/files/sqlite-3.7.3-icu_tests.patch
@@ -0,0 +1,284 @@
+--- test/e_expr.test
++++ test/e_expr.test
+@@ -937,8 +937,14 @@
+ # 'a'&nbsp;LIKE&nbsp;'A' is TRUE but
+ # '&aelig;'&nbsp;LIKE&nbsp;'&AElig;' is FALSE.
+ #
++# The restriction to ASCII characters does not apply if the ICU
++# library is compiled in. When ICU is enabled SQLite does not act
++# as it does "by default".
++#
+ do_execsql_test e_expr-14.5.1 { SELECT 'A' LIKE 'a' } 1
+-do_execsql_test e_expr-14.5.2 "SELECT '\u00c6' LIKE '\u00e6'" 0
++ifcapable !icu {
++ do_execsql_test e_expr-14.5.2 "SELECT '\u00c6' LIKE '\u00e6'" 0
++}
+
+ # EVIDENCE-OF: R-56683-13731 If the optional ESCAPE clause is present,
+ # then the expression following the ESCAPE keyword must evaluate to a
+@@ -985,7 +991,8 @@
+ eval lappend ::likeargs $args
+ return 1
+ }
+-db func like likefunc
++db func like -argcount 2 likefunc
++db func like -argcount 3 likefunc
+ set ::likeargs [list]
+ do_execsql_test e_expr-15.1.1 { SELECT 'abc' LIKE 'def' } 1
+ do_test e_expr-15.1.2 { set likeargs } {def abc}
+@@ -1056,12 +1063,16 @@
+ # default and so use of the REGEXP operator will normally result in an
+ # error message.
+ #
+-do_catchsql_test e_expr-18.1.1 {
+- SELECT regexp('abc', 'def')
+-} {1 {no such function: regexp}}
+-do_catchsql_test e_expr-18.1.2 {
+- SELECT 'abc' REGEXP 'def'
+-} {1 {no such function: REGEXP}}
++# There is a regexp function if ICU is enabled though.
++#
++ifcapable !icu {
++ do_catchsql_test e_expr-18.1.1 {
++ SELECT regexp('abc', 'def')
++ } {1 {no such function: regexp}}
++ do_catchsql_test e_expr-18.1.2 {
++ SELECT 'abc' REGEXP 'def'
++ } {1 {no such function: REGEXP}}
++}
+
+ # EVIDENCE-OF: R-33693-50180 The REGEXP operator is a special syntax for
+ # the regexp() user function.
+--- test/like.test
++++ test/like.test
+@@ -115,7 +115,7 @@
+ proc test_regexp {a b} {
+ return [regexp $a $b]
+ }
+- db function regexp test_regexp
++ db function regexp -argcount 2 test_regexp
+ execsql {
+ SELECT x FROM t1 WHERE x REGEXP 'abc' ORDER BY 1;
+ }
+@@ -608,7 +608,7 @@
+ } {1 abcdef 1 ghijkl 1 mnopqr 2 abcdef 2 ghijkl 2 mnopqr}
+
+
+-ifcapable like_opt {
++ifcapable like_opt&&!icu {
+ # Evaluate SQL. Return the result set followed by the
+ # and the number of full-scan steps.
+ #
+@@ -673,110 +673,110 @@
+ regexp {INDEX i2} $res
+ } {1}
+ }
+-}
+-
+-# Do an SQL statement. Append the search count to the end of the result.
+-#
+-proc count sql {
+- set ::sqlite_search_count 0
+- set ::sqlite_like_count 0
+- return [concat [execsql $sql] scan $::sqlite_search_count \
+- like $::sqlite_like_count]
+-}
+
+-# The LIKE and GLOB optimizations do not work on columns with
+-# affinity other than TEXT.
+-# Ticket #3901
+-#
+-do_test like-10.1 {
+- db close
+- sqlite3 db test.db
+- execsql {
+- CREATE TABLE t10(
+- a INTEGER PRIMARY KEY,
+- b INTEGER COLLATE nocase UNIQUE,
+- c NUMBER COLLATE nocase UNIQUE,
+- d BLOB COLLATE nocase UNIQUE,
+- e COLLATE nocase UNIQUE,
+- f TEXT COLLATE nocase UNIQUE
+- );
+- INSERT INTO t10 VALUES(1,1,1,1,1,1);
+- INSERT INTO t10 VALUES(12,12,12,12,12,12);
+- INSERT INTO t10 VALUES(123,123,123,123,123,123);
+- INSERT INTO t10 VALUES(234,234,234,234,234,234);
+- INSERT INTO t10 VALUES(345,345,345,345,345,345);
+- INSERT INTO t10 VALUES(45,45,45,45,45,45);
+- }
+- count {
+- SELECT a FROM t10 WHERE b LIKE '12%' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.2 {
+- count {
+- SELECT a FROM t10 WHERE c LIKE '12%' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.3 {
+- count {
+- SELECT a FROM t10 WHERE d LIKE '12%' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.4 {
+- count {
+- SELECT a FROM t10 WHERE e LIKE '12%' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.5 {
+- count {
+- SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY a;
+- }
+-} {12 123 scan 3 like 0}
+-do_test like-10.6 {
+- count {
+- SELECT a FROM t10 WHERE a LIKE '12%' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.10 {
+- execsql {
+- CREATE TABLE t10b(
+- a INTEGER PRIMARY KEY,
+- b INTEGER UNIQUE,
+- c NUMBER UNIQUE,
+- d BLOB UNIQUE,
+- e UNIQUE,
+- f TEXT UNIQUE
+- );
+- INSERT INTO t10b SELECT * FROM t10;
+- }
+- count {
+- SELECT a FROM t10b WHERE b GLOB '12*' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.11 {
+- count {
+- SELECT a FROM t10b WHERE c GLOB '12*' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.12 {
+- count {
+- SELECT a FROM t10b WHERE d GLOB '12*' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.13 {
+- count {
+- SELECT a FROM t10b WHERE e GLOB '12*' ORDER BY a;
+- }
+-} {12 123 scan 5 like 6}
+-do_test like-10.14 {
+- count {
+- SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY a;
+- }
+-} {12 123 scan 3 like 0}
+-do_test like-10.15 {
+- count {
+- SELECT a FROM t10b WHERE a GLOB '12*' ORDER BY a;
++ # Do an SQL statement. Append the search count to the end of the result.
++ #
++ proc count sql {
++ set ::sqlite_search_count 0
++ set ::sqlite_like_count 0
++ return [concat [execsql $sql] scan $::sqlite_search_count \
++ like $::sqlite_like_count]
+ }
+-} {12 123 scan 5 like 6}
++
++ # The LIKE and GLOB optimizations do not work on columns with
++ # affinity other than TEXT.
++ # Ticket #3901
++ #
++ do_test like-10.1 {
++ db close
++ sqlite3 db test.db
++ execsql {
++ CREATE TABLE t10(
++ a INTEGER PRIMARY KEY,
++ b INTEGER COLLATE nocase UNIQUE,
++ c NUMBER COLLATE nocase UNIQUE,
++ d BLOB COLLATE nocase UNIQUE,
++ e COLLATE nocase UNIQUE,
++ f TEXT COLLATE nocase UNIQUE
++ );
++ INSERT INTO t10 VALUES(1,1,1,1,1,1);
++ INSERT INTO t10 VALUES(12,12,12,12,12,12);
++ INSERT INTO t10 VALUES(123,123,123,123,123,123);
++ INSERT INTO t10 VALUES(234,234,234,234,234,234);
++ INSERT INTO t10 VALUES(345,345,345,345,345,345);
++ INSERT INTO t10 VALUES(45,45,45,45,45,45);
++ }
++ count {
++ SELECT a FROM t10 WHERE b LIKE '12%' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.2 {
++ count {
++ SELECT a FROM t10 WHERE c LIKE '12%' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.3 {
++ count {
++ SELECT a FROM t10 WHERE d LIKE '12%' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.4 {
++ count {
++ SELECT a FROM t10 WHERE e LIKE '12%' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.5 {
++ count {
++ SELECT a FROM t10 WHERE f LIKE '12%' ORDER BY a;
++ }
++ } {12 123 scan 3 like 0}
++ do_test like-10.6 {
++ count {
++ SELECT a FROM t10 WHERE a LIKE '12%' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.10 {
++ execsql {
++ CREATE TABLE t10b(
++ a INTEGER PRIMARY KEY,
++ b INTEGER UNIQUE,
++ c NUMBER UNIQUE,
++ d BLOB UNIQUE,
++ e UNIQUE,
++ f TEXT UNIQUE
++ );
++ INSERT INTO t10b SELECT * FROM t10;
++ }
++ count {
++ SELECT a FROM t10b WHERE b GLOB '12*' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.11 {
++ count {
++ SELECT a FROM t10b WHERE c GLOB '12*' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.12 {
++ count {
++ SELECT a FROM t10b WHERE d GLOB '12*' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.13 {
++ count {
++ SELECT a FROM t10b WHERE e GLOB '12*' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++ do_test like-10.14 {
++ count {
++ SELECT a FROM t10b WHERE f GLOB '12*' ORDER BY a;
++ }
++ } {12 123 scan 3 like 0}
++ do_test like-10.15 {
++ count {
++ SELECT a FROM t10b WHERE a GLOB '12*' ORDER BY a;
++ }
++ } {12 123 scan 5 like 6}
++}
+
+ # LIKE and GLOB where the default collating sequence is not appropriate
+ # but an index with the appropriate collating sequence exists.
diff --git a/dev-db/sqlite/sqlite-3.7.3.ebuild b/dev-db/sqlite/sqlite-3.7.3.ebuild
index 0728ffb0dadb..c2cc45722ec9 100644
--- a/dev-db/sqlite/sqlite-3.7.3.ebuild
+++ b/dev-db/sqlite/sqlite-3.7.3.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/sqlite/sqlite-3.7.3.ebuild,v 1.1 2010/10/31 09:27:03 betelgeuse Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/sqlite/sqlite-3.7.3.ebuild,v 1.2 2010/11/01 19:38:59 arfrever Exp $
EAPI="3"
@@ -32,13 +32,10 @@ DEPEND="${RDEPEND}
doc? ( app-arch/unzip )"
src_prepare() {
- if use icu; then
- rm -f test/like.test
- fi
-
if use tcl || use test; then
epatch "${FILESDIR}/${PN}-3.6.22-interix-fixes.patch"
epatch "${FILESDIR}/${PN}-3.6.22-dlopen.patch" # bug 300836
+ epatch "${FILESDIR}/${P}-icu_tests.patch"
eautoreconf # dlopen.patch patches configure.ac
else
epatch "${FILESDIR}/${PN}-3.6.22-interix-fixes-amalgamation.patch"