@@ -220,6 +220,29 @@ r = query(db, "SELECT mycount(TrackId) FROM PlaylistTrack")
220
220
s = query (db, " SELECT count(TrackId) FROM PlaylistTrack" )
221
221
@test r[1 ] == s[1 ]
222
222
223
+ bigsum (p, c) = p + big (c)
224
+ register (db, big (0 ), bigsum)
225
+ r = query (db, " SELECT bigsum(TrackId) FROM PlaylistTrack" )
226
+ s = query (db, " SELECT TrackId FROM PlaylistTrack" )
227
+ @test r[1 ][1 ] == big (sum (s[1 ]))
228
+
229
+ query (db, " CREATE TABLE points (x INT, y INT, z INT)" )
230
+ query (db, " INSERT INTO points VALUES (?, ?, ?)" , [1 , 2 , 3 ])
231
+ query (db, " INSERT INTO points VALUES (?, ?, ?)" , [4 , 5 , 6 ])
232
+ query (db, " INSERT INTO points VALUES (?, ?, ?)" , [7 , 8 , 9 ])
233
+ type Point3D{T<: Number }
234
+ x:: T
235
+ y:: T
236
+ z:: T
237
+ end
238
+ == (a:: Point3D , b:: Point3D ) = a. x == b. x && a. y == b. y && a. z == b. z
239
+ + (a:: Point3D , b:: Point3D ) = Point3D (a. x + b. x, a. y + b. y, a. z + b. z)
240
+ sumpoint (p:: Point3D , x, y, z) = p + Point3D (x, y, z)
241
+ register (db, Point3D (0 , 0 , 0 ), sumpoint)
242
+ r = query (db, " SELECT sumpoint(x, y, z) FROM points" )
243
+ @test r[1 ][1 ] == Point3D (12 , 15 , 18 )
244
+ drop (db, " points" )
245
+
223
246
db2 = SQLiteDB ()
224
247
query (db2, " CREATE TABLE tab1 (r REAL, s INT)" )
225
248
@@ -237,7 +260,6 @@ drop(db2, "tab2", ifexists=true)
237
260
238
261
close (db2)
239
262
240
-
241
263
@test size (tables (db)) == (11 ,1 )
242
264
243
265
close (db)
0 commit comments