Index: third_party/sqlite/src/test/icu.test |
diff --git a/third_party/sqlite/src/test/icu.test b/third_party/sqlite/src/test/icu.test |
index 1138b3d252b34d5d61a2e7ca49cff4fcabf72492..73cb9b913e95b594440e861c353722ea6f05b954 100644 |
--- a/third_party/sqlite/src/test/icu.test |
+++ b/third_party/sqlite/src/test/icu.test |
@@ -26,12 +26,12 @@ execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)} |
execsql {INSERT INTO test1 VALUES(1,2,1.1,2.2,'hello','world')} |
proc test_expr {name settings expr result} { |
do_test $name [format { |
- db one { |
+ lindex [db eval { |
BEGIN; |
UPDATE test1 SET %s; |
SELECT %s FROM test1; |
ROLLBACK; |
- } |
+ }] 0 |
} $settings $expr] $result |
} |
@@ -114,4 +114,23 @@ do_test icu-4.3 { |
} |
} {apricot cherry chokecherry yamot peach plum} |
+#------------------------------------------------------------------------- |
+# Test that it is not possible to call the ICU regex() function with |
+# anything other than exactly two arguments. See also: |
+# |
+# http://src.chromium.org/viewvc/chrome/trunk/src/third_party/sqlite/icu-regexp.patch?revision=34807&view=markup |
+# |
+do_catchsql_test icu-5.1 { SELECT regexp('a[abc]c.*', 'abc') } {0 1} |
+do_catchsql_test icu-5.2 { |
+ SELECT regexp('a[abc]c.*') |
+} {1 {wrong number of arguments to function regexp()}} |
+do_catchsql_test icu-5.3 { |
+ SELECT regexp('a[abc]c.*', 'abc', 'c') |
+} {1 {wrong number of arguments to function regexp()}} |
+do_catchsql_test icu-5.4 { |
+ SELECT 'abc' REGEXP 'a[abc]c.*' |
+} {0 1} |
+do_catchsql_test icu-5.4 { SELECT 'abc' REGEXP } {1 {near " ": syntax error}} |
+do_catchsql_test icu-5.5 { SELECT 'abc' REGEXP, 1 } {1 {near ",": syntax error}} |
+ |
finish_test |