@@ -294,11 +294,11 @@ def test_stat
294
294
end
295
295
296
296
def test_stat_fullscan_steps
297
- @db . execute ' CREATE TABLE test_table (id INTEGER PRIMARY KEY, name TEXT);'
297
+ @db . execute " CREATE TABLE test_table (id INTEGER PRIMARY KEY, name TEXT);"
298
298
10 . times do |i |
299
- @db . execute ' INSERT INTO test_table (name) VALUES (?)' , "name_#{ i } "
299
+ @db . execute " INSERT INTO test_table (name) VALUES (?)" , "name_#{ i } "
300
300
end
301
- @db . execute ' DROP INDEX IF EXISTS idx_test_table_id;'
301
+ @db . execute " DROP INDEX IF EXISTS idx_test_table_id;"
302
302
stmt = @db . prepare ( "SELECT * FROM test_table WHERE name LIKE 'name%'" )
303
303
stmt . execute . to_a
304
304
@@ -308,9 +308,9 @@ def test_stat_fullscan_steps
308
308
end
309
309
310
310
def test_stat_sorts
311
- @db . execute ' CREATE TABLE test1(a)'
312
- @db . execute ' INSERT INTO test1 VALUES (1)'
313
- stmt = @db . prepare ( ' select * from test1 order by a' )
311
+ @db . execute " CREATE TABLE test1(a)"
312
+ @db . execute " INSERT INTO test1 VALUES (1)"
313
+ stmt = @db . prepare ( " select * from test1 order by a" )
314
314
stmt . execute . to_a
315
315
316
316
assert_equal 1 , stmt . stat ( :sorts )
@@ -322,8 +322,8 @@ def test_stat_autoindexes
322
322
@db . execute "CREATE TABLE t1(a,b);"
323
323
@db . execute "CREATE TABLE t2(c,d);"
324
324
10 . times do |i |
325
- @db . execute ' INSERT INTO t1 (a, b) VALUES (?, ?)' , [ i , i . to_s ]
326
- @db . execute ' INSERT INTO t2 (c, d) VALUES (?, ?)' , [ i , i . to_s ]
325
+ @db . execute " INSERT INTO t1 (a, b) VALUES (?, ?)" , [ i , i . to_s ]
326
+ @db . execute " INSERT INTO t2 (c, d) VALUES (?, ?)" , [ i , i . to_s ]
327
327
end
328
328
stmt = @db . prepare ( "SELECT * FROM t1, t2 WHERE a=c;" )
329
329
stmt . execute . to_a
@@ -334,9 +334,9 @@ def test_stat_autoindexes
334
334
end
335
335
336
336
def test_stat_vm_steps
337
- @db . execute ' CREATE TABLE test1(a)'
338
- @db . execute ' INSERT INTO test1 VALUES (1)'
339
- stmt = @db . prepare ( ' select * from test1 order by a' )
337
+ @db . execute " CREATE TABLE test1(a)"
338
+ @db . execute " INSERT INTO test1 VALUES (1)"
339
+ stmt = @db . prepare ( " select * from test1 order by a" )
340
340
stmt . execute . to_a
341
341
342
342
assert_operator stmt . stat ( :vm_steps ) , :> , 0
@@ -345,12 +345,12 @@ def test_stat_vm_steps
345
345
end
346
346
347
347
def test_stat_reprepares
348
- @db . execute ' CREATE TABLE test_table (id INTEGER PRIMARY KEY, name TEXT);'
348
+ @db . execute " CREATE TABLE test_table (id INTEGER PRIMARY KEY, name TEXT);"
349
349
10 . times do |i |
350
- @db . execute ' INSERT INTO test_table (name) VALUES (?)' , "name_#{ i } "
350
+ @db . execute " INSERT INTO test_table (name) VALUES (?)" , "name_#{ i } "
351
351
end
352
352
stmt = @db . prepare ( "SELECT * FROM test_table WHERE name LIKE ?" )
353
- stmt . execute ( ' name%' ) . to_a
353
+ stmt . execute ( " name%" ) . to_a
354
354
355
355
if stmt . stat . key? ( :reprepares )
356
356
assert_equal 1 , stmt . stat ( :reprepares )
@@ -362,9 +362,9 @@ def test_stat_reprepares
362
362
end
363
363
364
364
def test_stat_runs
365
- @db . execute ' CREATE TABLE test1(a)'
366
- @db . execute ' INSERT INTO test1 VALUES (1)'
367
- stmt = @db . prepare ( ' select * from test1' )
365
+ @db . execute " CREATE TABLE test1(a)"
366
+ @db . execute " INSERT INTO test1 VALUES (1)"
367
+ stmt = @db . prepare ( " select * from test1" )
368
368
stmt . execute . to_a
369
369
370
370
if stmt . stat . key? ( :runs )
@@ -380,8 +380,8 @@ def test_stat_filter_misses
380
380
@db . execute "CREATE TABLE t1(a,b);"
381
381
@db . execute "CREATE TABLE t2(c,d);"
382
382
10 . times do |i |
383
- @db . execute ' INSERT INTO t1 (a, b) VALUES (?, ?)' , [ i , i . to_s ]
384
- @db . execute ' INSERT INTO t2 (c, d) VALUES (?, ?)' , [ i , i . to_s ]
383
+ @db . execute " INSERT INTO t1 (a, b) VALUES (?, ?)" , [ i , i . to_s ]
384
+ @db . execute " INSERT INTO t2 (c, d) VALUES (?, ?)" , [ i , i . to_s ]
385
385
end
386
386
stmt = @db . prepare ( "SELECT * FROM t1, t2 WHERE a=c;" )
387
387
stmt . execute . to_a
@@ -399,8 +399,8 @@ def test_stat_filter_hits
399
399
@db . execute "CREATE TABLE t1(a,b);"
400
400
@db . execute "CREATE TABLE t2(c,d);"
401
401
10 . times do |i |
402
- @db . execute ' INSERT INTO t1 (a, b) VALUES (?, ?)' , [ i , i . to_s ]
403
- @db . execute ' INSERT INTO t2 (c, d) VALUES (?, ?)' , [ i + 1 , i . to_s ]
402
+ @db . execute " INSERT INTO t1 (a, b) VALUES (?, ?)" , [ i , i . to_s ]
403
+ @db . execute " INSERT INTO t2 (c, d) VALUES (?, ?)" , [ i + 1 , i . to_s ]
404
404
end
405
405
stmt = @db . prepare ( "SELECT * FROM t1, t2 WHERE a=c AND b = '1' AND d = '1';" )
406
406
stmt . execute . to_a
@@ -415,9 +415,9 @@ def test_stat_filter_hits
415
415
end
416
416
417
417
def test_memused
418
- @db . execute ' CREATE TABLE test1(a)'
419
- @db . execute ' INSERT INTO test1 VALUES (1)'
420
- stmt = @db . prepare ( ' select * from test1' )
418
+ @db . execute " CREATE TABLE test1(a)"
419
+ @db . execute " INSERT INTO test1 VALUES (1)"
420
+ stmt = @db . prepare ( " select * from test1" )
421
421
422
422
skip ( "memused not defined" ) unless stmt . respond_to? ( :memused )
423
423
0 commit comments