drh | b19a2bc | 2001-09-16 00:13:26 +0000 | [diff] [blame] | 1 | # 2001 September 15 |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 2 | # |
drh | b19a2bc | 2001-09-16 00:13:26 +0000 | [diff] [blame] | 3 | # The author disclaims copyright to this source code. In place of |
| 4 | # a legal notice, here is a blessing: |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 5 | # |
drh | b19a2bc | 2001-09-16 00:13:26 +0000 | [diff] [blame] | 6 | # May you do good and not evil. |
| 7 | # May you find forgiveness for yourself and forgive others. |
| 8 | # May you share freely, never taking more than you give. |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 9 | # |
| 10 | #*********************************************************************** |
| 11 | # This file implements regression tests for SQLite library. The |
| 12 | # focus of this file is testing built-in functions. |
| 13 | # |
danielk1977 | 6d88bad | 2004-05-27 14:23:36 +0000 | [diff] [blame^] | 14 | # $Id: func.test,v 1.19 2004/05/27 14:23:36 danielk1977 Exp $ |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 15 | |
| 16 | set testdir [file dirname $argv0] |
| 17 | source $testdir/tester.tcl |
| 18 | |
| 19 | # Create a table to work with. |
| 20 | # |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 21 | do_test func-0.0 { |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 22 | execsql {CREATE TABLE tbl1(t1 text)} |
| 23 | foreach word {this program is free software} { |
| 24 | execsql "INSERT INTO tbl1 VALUES('$word')" |
| 25 | } |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 26 | execsql {SELECT t1 FROM tbl1 ORDER BY t1} |
| 27 | } {free is program software this} |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 28 | do_test func-0.1 { |
| 29 | execsql { |
| 30 | CREATE TABLE t2(a); |
| 31 | INSERT INTO t2 VALUES(1); |
| 32 | INSERT INTO t2 VALUES(NULL); |
| 33 | INSERT INTO t2 VALUES(345); |
| 34 | INSERT INTO t2 VALUES(NULL); |
| 35 | INSERT INTO t2 VALUES(67890); |
| 36 | SELECT * FROM t2; |
| 37 | } |
| 38 | } {1 {} 345 {} 67890} |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 39 | |
| 40 | # Check out the length() function |
| 41 | # |
| 42 | do_test func-1.0 { |
| 43 | execsql {SELECT length(t1) FROM tbl1 ORDER BY t1} |
| 44 | } {4 2 7 8 4} |
| 45 | do_test func-1.1 { |
| 46 | set r [catch {execsql {SELECT length(*) FROM tbl1 ORDER BY t1}} msg] |
| 47 | lappend r $msg |
drh | 89425d5 | 2002-02-28 03:04:48 +0000 | [diff] [blame] | 48 | } {1 {wrong number of arguments to function length()}} |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 49 | do_test func-1.2 { |
| 50 | set r [catch {execsql {SELECT length(t1,5) FROM tbl1 ORDER BY t1}} msg] |
| 51 | lappend r $msg |
drh | 89425d5 | 2002-02-28 03:04:48 +0000 | [diff] [blame] | 52 | } {1 {wrong number of arguments to function length()}} |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 53 | do_test func-1.3 { |
| 54 | execsql {SELECT length(t1), count(*) FROM tbl1 GROUP BY length(t1) |
| 55 | ORDER BY length(t1)} |
| 56 | } {2 1 4 2 7 1 8 1} |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 57 | do_test func-1.4 { |
drh | bb11351 | 2002-05-27 01:04:51 +0000 | [diff] [blame] | 58 | execsql {SELECT coalesce(length(a),-1) FROM t2} |
| 59 | } {1 -1 3 -1 5} |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 60 | |
| 61 | # Check out the substr() function |
| 62 | # |
| 63 | do_test func-2.0 { |
| 64 | execsql {SELECT substr(t1,1,2) FROM tbl1 ORDER BY t1} |
| 65 | } {fr is pr so th} |
| 66 | do_test func-2.1 { |
| 67 | execsql {SELECT substr(t1,2,1) FROM tbl1 ORDER BY t1} |
| 68 | } {r s r o h} |
| 69 | do_test func-2.2 { |
| 70 | execsql {SELECT substr(t1,3,3) FROM tbl1 ORDER BY t1} |
| 71 | } {ee {} ogr ftw is} |
| 72 | do_test func-2.3 { |
| 73 | execsql {SELECT substr(t1,-1,1) FROM tbl1 ORDER BY t1} |
| 74 | } {e s m e s} |
| 75 | do_test func-2.4 { |
| 76 | execsql {SELECT substr(t1,-1,2) FROM tbl1 ORDER BY t1} |
| 77 | } {e s m e s} |
| 78 | do_test func-2.5 { |
| 79 | execsql {SELECT substr(t1,-2,1) FROM tbl1 ORDER BY t1} |
| 80 | } {e i a r i} |
| 81 | do_test func-2.6 { |
| 82 | execsql {SELECT substr(t1,-2,2) FROM tbl1 ORDER BY t1} |
| 83 | } {ee is am re is} |
| 84 | do_test func-2.7 { |
| 85 | execsql {SELECT substr(t1,-4,2) FROM tbl1 ORDER BY t1} |
| 86 | } {fr {} gr wa th} |
| 87 | do_test func-2.8 { |
| 88 | execsql {SELECT t1 FROM tbl1 ORDER BY substr(t1,2,20)} |
| 89 | } {this software free program is} |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 90 | do_test func-2.9 { |
| 91 | execsql {SELECT substr(a,1,1) FROM t2} |
| 92 | } {1 {} 3 {} 6} |
| 93 | do_test func-2.10 { |
| 94 | execsql {SELECT substr(a,2,2) FROM t2} |
| 95 | } {{} {} 45 {} 78} |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 96 | |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 97 | # Only do the following tests if TCL has UTF-8 capabilities and |
| 98 | # the UTF-8 encoding is turned on in the SQLite library. |
| 99 | # |
drh | fbc3eab | 2001-04-06 16:13:42 +0000 | [diff] [blame] | 100 | if {[sqlite -encoding]=="UTF-8" && "\u1234"!="u1234"} { |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 101 | |
| 102 | # Put some UTF-8 characters in the database |
| 103 | # |
| 104 | do_test func-3.0 { |
| 105 | execsql {DELETE FROM tbl1} |
| 106 | foreach word "contains UTF-8 characters hi\u1234ho" { |
| 107 | execsql "INSERT INTO tbl1 VALUES('$word')" |
| 108 | } |
| 109 | execsql {SELECT t1 FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 110 | } "UTF-8 characters contains hi\u1234ho" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 111 | do_test func-3.1 { |
| 112 | execsql {SELECT length(t1) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 113 | } {5 10 8 5} |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 114 | do_test func-3.2 { |
| 115 | execsql {SELECT substr(t1,1,2) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 116 | } {UT ch co hi} |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 117 | do_test func-3.3 { |
| 118 | execsql {SELECT substr(t1,1,3) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 119 | } "UTF cha con hi\u1234" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 120 | do_test func-3.4 { |
| 121 | execsql {SELECT substr(t1,2,2) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 122 | } "TF ha on i\u1234" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 123 | do_test func-3.5 { |
| 124 | execsql {SELECT substr(t1,2,3) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 125 | } "TF- har ont i\u1234h" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 126 | do_test func-3.6 { |
| 127 | execsql {SELECT substr(t1,3,2) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 128 | } "F- ar nt \u1234h" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 129 | do_test func-3.7 { |
| 130 | execsql {SELECT substr(t1,4,2) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 131 | } "-8 ra ta ho" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 132 | do_test func-3.8 { |
| 133 | execsql {SELECT substr(t1,-1,1) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 134 | } "8 s s o" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 135 | do_test func-3.9 { |
| 136 | execsql {SELECT substr(t1,-3,2) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 137 | } "F- er in \u1234h" |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 138 | do_test func-3.10 { |
| 139 | execsql {SELECT substr(t1,-4,3) FROM tbl1 ORDER BY t1} |
drh | a9e99ae | 2002-08-13 23:02:57 +0000 | [diff] [blame] | 140 | } "TF- ter ain i\u1234h" |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 141 | do_test func-3.99 { |
| 142 | execsql {DELETE FROM tbl1} |
| 143 | foreach word {this program is free software} { |
| 144 | execsql "INSERT INTO tbl1 VALUES('$word')" |
| 145 | } |
| 146 | execsql {SELECT t1 FROM tbl1} |
| 147 | } {this program is free software} |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 148 | |
drh | fbc3eab | 2001-04-06 16:13:42 +0000 | [diff] [blame] | 149 | } ;# End [sqlite -encoding]==UTF-8 and \u1234!=u1234 |
drh | 297ecf1 | 2001-04-05 15:57:13 +0000 | [diff] [blame] | 150 | |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 151 | # Test the abs() and round() functions. |
| 152 | # |
| 153 | do_test func-4.1 { |
| 154 | execsql { |
| 155 | CREATE TABLE t1(a,b,c); |
| 156 | INSERT INTO t1 VALUES(1,2,3); |
| 157 | INSERT INTO t1 VALUES(2,1.2345678901234,-12345.67890); |
| 158 | INSERT INTO t1 VALUES(3,-2,-5); |
| 159 | } |
| 160 | catchsql {SELECT abs(a,b) FROM t1} |
drh | 89425d5 | 2002-02-28 03:04:48 +0000 | [diff] [blame] | 161 | } {1 {wrong number of arguments to function abs()}} |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 162 | do_test func-4.2 { |
| 163 | catchsql {SELECT abs() FROM t1} |
drh | 89425d5 | 2002-02-28 03:04:48 +0000 | [diff] [blame] | 164 | } {1 {wrong number of arguments to function abs()}} |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 165 | do_test func-4.3 { |
| 166 | catchsql {SELECT abs(b) FROM t1 ORDER BY a} |
| 167 | } {0 {2 1.2345678901234 2}} |
| 168 | do_test func-4.4 { |
| 169 | catchsql {SELECT abs(c) FROM t1 ORDER BY a} |
danielk1977 | 3d1bfea | 2004-05-14 11:00:53 +0000 | [diff] [blame] | 170 | } {0 {3 12345.6789 5}} |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 171 | do_test func-4.4.1 { |
| 172 | execsql {SELECT abs(a) FROM t2} |
| 173 | } {1 {} 345 {} 67890} |
| 174 | do_test func-4.4.2 { |
| 175 | execsql {SELECT abs(t1) FROM tbl1} |
danielk1977 | f93bbbe | 2004-05-27 10:30:52 +0000 | [diff] [blame] | 176 | } {0 0 0 0 0} |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 177 | |
| 178 | do_test func-4.5 { |
| 179 | catchsql {SELECT round(a,b,c) FROM t1} |
drh | 89425d5 | 2002-02-28 03:04:48 +0000 | [diff] [blame] | 180 | } {1 {wrong number of arguments to function round()}} |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 181 | do_test func-4.6 { |
drh | 8aff101 | 2001-12-22 14:49:24 +0000 | [diff] [blame] | 182 | catchsql {SELECT round(b,2) FROM t1 ORDER BY b} |
| 183 | } {0 {-2.00 1.23 2.00}} |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 184 | do_test func-4.7 { |
| 185 | catchsql {SELECT round(b,0) FROM t1 ORDER BY a} |
| 186 | } {0 {2 1 -2}} |
| 187 | do_test func-4.8 { |
| 188 | catchsql {SELECT round(c) FROM t1 ORDER BY a} |
| 189 | } {0 {3 -12346 -5}} |
| 190 | do_test func-4.9 { |
| 191 | catchsql {SELECT round(c,a) FROM t1 ORDER BY a} |
| 192 | } {0 {3.0 -12345.68 -5.000}} |
| 193 | do_test func-4.10 { |
drh | 01a3466 | 2001-10-20 12:30:10 +0000 | [diff] [blame] | 194 | catchsql {SELECT 'x' || round(c,a) || 'y' FROM t1 ORDER BY a} |
| 195 | } {0 {x3.0y x-12345.68y x-5.000y}} |
| 196 | do_test func-4.11 { |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 197 | catchsql {SELECT round() FROM t1 ORDER BY a} |
drh | 89425d5 | 2002-02-28 03:04:48 +0000 | [diff] [blame] | 198 | } {1 {wrong number of arguments to function round()}} |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 199 | do_test func-4.12 { |
drh | bb11351 | 2002-05-27 01:04:51 +0000 | [diff] [blame] | 200 | execsql {SELECT coalesce(round(a,2),'nil') FROM t2} |
| 201 | } {1.00 nil 345.00 nil 67890.00} |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 202 | do_test func-4.13 { |
| 203 | execsql {SELECT round(t1,2) FROM tbl1} |
| 204 | } {0.00 0.00 0.00 0.00 0.00} |
| 205 | |
| 206 | # Test the upper() and lower() functions |
| 207 | # |
| 208 | do_test func-5.1 { |
| 209 | execsql {SELECT upper(t1) FROM tbl1} |
| 210 | } {THIS PROGRAM IS FREE SOFTWARE} |
| 211 | do_test func-5.2 { |
| 212 | execsql {SELECT lower(upper(t1)) FROM tbl1} |
| 213 | } {this program is free software} |
| 214 | do_test func-5.3 { |
| 215 | execsql {SELECT upper(a), lower(a) FROM t2} |
| 216 | } {1 1 {} {} 345 345 {} {} 67890 67890} |
| 217 | do_test func-5.4 { |
| 218 | catchsql {SELECT upper(a,5) FROM t2} |
| 219 | } {1 {wrong number of arguments to function upper()}} |
| 220 | do_test func-5.5 { |
| 221 | catchsql {SELECT upper(*) FROM t2} |
| 222 | } {1 {wrong number of arguments to function upper()}} |
| 223 | |
drh | a9f9d1c | 2002-06-29 02:20:08 +0000 | [diff] [blame] | 224 | # Test the coalesce() and nullif() functions |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 225 | # |
| 226 | do_test func-6.1 { |
| 227 | execsql {SELECT coalesce(a,'xyz') FROM t2} |
| 228 | } {1 xyz 345 xyz 67890} |
| 229 | do_test func-6.2 { |
| 230 | execsql {SELECT coalesce(upper(a),'nil') FROM t2} |
| 231 | } {1 nil 345 nil 67890} |
drh | a9f9d1c | 2002-06-29 02:20:08 +0000 | [diff] [blame] | 232 | do_test func-6.3 { |
| 233 | execsql {SELECT coalesce(nullif(1,1),'nil')} |
| 234 | } {nil} |
| 235 | do_test func-6.4 { |
| 236 | execsql {SELECT coalesce(nullif(1,2),'nil')} |
| 237 | } {1} |
| 238 | do_test func-6.5 { |
| 239 | execsql {SELECT coalesce(nullif(1,NULL),'nil')} |
| 240 | } {1} |
| 241 | |
drh | 832508b | 2002-03-02 17:04:07 +0000 | [diff] [blame] | 242 | |
drh | 6ed41ad | 2002-04-06 14:10:47 +0000 | [diff] [blame] | 243 | # Test the last_insert_rowid() function |
| 244 | # |
| 245 | do_test func-7.1 { |
| 246 | execsql {SELECT last_insert_rowid()} |
| 247 | } [db last_insert_rowid] |
| 248 | |
drh | 739105c | 2002-05-29 23:22:23 +0000 | [diff] [blame] | 249 | # Tests for aggregate functions and how they handle NULLs. |
| 250 | # |
| 251 | do_test func-8.1 { |
| 252 | execsql { |
| 253 | SELECT sum(a), count(a), round(avg(a),2), min(a), max(a), count(*) FROM t2; |
| 254 | } |
| 255 | } {68236 3 22745.33 1 67890 5} |
drh | a9f9d1c | 2002-06-29 02:20:08 +0000 | [diff] [blame] | 256 | do_test func-8.2 { |
| 257 | execsql { |
| 258 | SELECT max('z+'||a||'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP') FROM t2; |
| 259 | } |
| 260 | } {z+67890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP} |
| 261 | do_test func-8.3 { |
| 262 | execsql { |
| 263 | CREATE TEMP TABLE t3 AS SELECT a FROM t2 ORDER BY a DESC; |
| 264 | SELECT min('z+'||a||'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP') FROM t3; |
| 265 | } |
| 266 | } {z+1abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP} |
drh | 739105c | 2002-05-29 23:22:23 +0000 | [diff] [blame] | 267 | |
drh | a9f9d1c | 2002-06-29 02:20:08 +0000 | [diff] [blame] | 268 | # How do you test the random() function in a meaningful, deterministic way? |
| 269 | # |
| 270 | do_test func-9.1 { |
| 271 | execsql { |
| 272 | SELECT random() is not null; |
| 273 | } |
| 274 | } {1} |
drh | bf4133c | 2001-10-13 02:59:08 +0000 | [diff] [blame] | 275 | |
drh | 6cbe1f1 | 2002-07-01 00:31:36 +0000 | [diff] [blame] | 276 | # Use the "sqlite_register_test_function" TCL command which is part of |
| 277 | # the text fixture in order to verify correct operation of some of |
| 278 | # the user-defined SQL function APIs that are not used by the built-in |
| 279 | # functions. |
| 280 | # |
| 281 | db close |
| 282 | set ::DB [sqlite db test.db] |
| 283 | sqlite_register_test_function $::DB testfunc |
| 284 | do_test func-10.1 { |
| 285 | catchsql { |
| 286 | SELECT testfunc(NULL,NULL); |
| 287 | } |
danielk1977 | 6d88bad | 2004-05-27 14:23:36 +0000 | [diff] [blame^] | 288 | } {1 {first argument should be one of: int int64 string double null value}} |
drh | 6cbe1f1 | 2002-07-01 00:31:36 +0000 | [diff] [blame] | 289 | do_test func-10.2 { |
| 290 | execsql { |
| 291 | SELECT testfunc( |
| 292 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 293 | 'int', 1234 |
| 294 | ); |
| 295 | } |
| 296 | } {1234} |
| 297 | do_test func-10.3 { |
| 298 | execsql { |
| 299 | SELECT testfunc( |
| 300 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 301 | 'string', NULL |
| 302 | ); |
| 303 | } |
| 304 | } {{}} |
| 305 | do_test func-10.4 { |
| 306 | execsql { |
| 307 | SELECT testfunc( |
| 308 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 309 | 'double', 1.234 |
| 310 | ); |
| 311 | } |
| 312 | } {1.234} |
| 313 | do_test func-10.5 { |
| 314 | execsql { |
| 315 | SELECT testfunc( |
| 316 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 317 | 'int', 1234, |
| 318 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 319 | 'string', NULL, |
| 320 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 321 | 'double', 1.234, |
| 322 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 323 | 'int', 1234, |
| 324 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 325 | 'string', NULL, |
| 326 | 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', |
| 327 | 'double', 1.234 |
| 328 | ); |
| 329 | } |
| 330 | } {1.234} |
| 331 | |
drh | 647cb0e | 2002-11-04 19:32:25 +0000 | [diff] [blame] | 332 | # Test the built-in sqlite_version(*) SQL function. |
| 333 | # |
| 334 | do_test func-11.1 { |
| 335 | execsql { |
| 336 | SELECT sqlite_version(*); |
| 337 | } |
| 338 | } [sqlite -version] |
| 339 | |
drh | ff6e911 | 2000-08-28 16:21:58 +0000 | [diff] [blame] | 340 | finish_test |