@@ -136,6 +136,7 @@ method run-tests {
136
136
137
137
is $ rc , 1 , " execute one with one integer parameter should return 1 row affected" ;
138
138
is $ sth . rows, 1 , ' $sth.rows for execute one with one integer parameter should report 1 row affected' ;
139
+ $ sth . dispose;
139
140
140
141
ok $ sth = $ dbh . prepare( "
141
142
INSERT INTO nom (price)
@@ -144,6 +145,7 @@ method run-tests {
144
145
ok $ rc = $ sth . execute(4.85 ), " execute one with one float parameter" ;
145
146
is $ rc , 1 , " execute one with one float parameter should return 1 row affected" ;
146
147
is $ sth . rows, 1 , ' $sth.rows for execute one with one float parameter should report 1 row affected' ;
148
+ $ sth . dispose;
147
149
148
150
ok $ sth = $ dbh . prepare( "
149
151
INSERT INTO nom (name, description, quantity, price)
@@ -337,30 +339,37 @@ method run-tests {
337
339
}
338
340
else { skip ' fetchrow_arrayref not implemented' , 2 }
339
341
340
- $ sth . finish ;
342
+ $ sth . dispose ;
341
343
342
344
# test quotes and so on
343
345
{
344
346
$ sth = $ dbh . prepare(q [ INSERT INTO nom (name, description) VALUES (?, ?) ] );
345
347
my $ lived ;
346
- lives-ok { $ sth . execute(" quot" , q [ "'; ] ); $ lived = 1 }, ' can insert single and double quotes' ;
348
+ lives-ok {
349
+ $ sth . execute(" quot" , q [ "'; ] ); $ lived = 1
350
+ }, ' can insert single and double quotes' ;
351
+ $ sth . dispose;
347
352
if $ lived {
348
- $ sth = $ dbh . prepare(q [ SELECT description FROM nom where name = ? ] );
349
- lives-ok { $ sth . execute(' quot' ) }, ' lived while retrieving result' ;
353
+ $ sth = $ dbh . prepare(q [ SELECT description FROM nom WHERE name = ? ] );
354
+ lives-ok {
355
+ $ sth . execute(' quot' );
356
+ }, ' lived while retrieving result' ;
350
357
is $ sth . fetchrow. join , q [ "'; ] , ' got the right string back' ;
351
- $ sth . finish ;
358
+ $ sth . dispose ;
352
359
}
353
360
else {
354
361
skip (' dependent tests' , 2 );
355
362
}
356
363
357
364
$ lived = 0 ;
358
- lives-ok { $ dbh . do(q [ INSERT INTO nom (name, description) VALUES(?, '?"') ] , ' mark' ); $ lived = 1 }, ' can use question mark in quoted strings' ;
365
+ lives-ok {
366
+ $ dbh . do(q [ INSERT INTO nom (name, description) VALUES(?, '?"') ] , ' mark' ); $ lived = 1
367
+ }, ' can use question mark in quoted strings' ;
359
368
if $ lived {
360
369
my $ sth = $ dbh . prepare(q [ SELECT description FROM nom WHERE name = 'mark' ] );
361
370
$ sth . execute;
362
371
is $ sth . fetchrow. join , ' ?"' , ' correctly retrieved question mark' ;
363
- $ sth . finish ;
372
+ $ sth . dispose ;
364
373
}
365
374
else {
366
375
skip (' dependent test' , 1 );
@@ -375,6 +384,7 @@ method run-tests {
375
384
my $ row = $ sth . fetchrow-hash;
376
385
377
386
ok !? $ row , ' a query with no results should have a falsy value' ;
387
+ $ sth . dispose;
378
388
}
379
389
380
390
# test that a query that's exhausted its result set has a falsy value
@@ -386,6 +396,7 @@ method run-tests {
386
396
$ row = $ sth . fetchrow-hash;
387
397
388
398
ok !? $ row , ' a query with no more results should have a falsy value' ;
399
+ $ sth . dispose;
389
400
}
390
401
391
402
# test that an integer >= 2**31 still works as an argument to execute
@@ -402,7 +413,7 @@ method run-tests {
402
413
is $ row [1 ], ' many' , ' The contents of the row fetched via a large integer are correct' ;
403
414
is $ row [2 ], $ large-int , ' The contents of the row fetched via a large integer are correct' ;
404
415
405
- $ sth . finish ;
416
+ $ sth . dispose ;
406
417
}
407
418
408
419
# Drop the table when finished, and disconnect
0 commit comments