@@ -23,23 +23,23 @@ eval {$dbh= DBI->connect($test_dsn, $test_user, $test_password,
23
23
if ($@ ) {
24
24
plan skip_all => " no database connection" ;
25
25
}
26
- plan tests => 115 ;
26
+ plan tests => 117 ;
27
27
28
28
ok(defined $dbh , " Connected to database" );
29
29
30
30
ok($dbh -> do(" DROP TABLE IF EXISTS dbd_mysql_t35" ), " making slate clean" );
31
31
32
- ok($dbh -> do(" CREATE TABLE dbd_mysql_t35 (id INT(4), name VARCHAR(64), name_limit VARCHAR(64))" ), " creating table" );
32
+ ok($dbh -> do(" CREATE TABLE dbd_mysql_t35 (id INT(4), name VARCHAR(64), name_limit VARCHAR(64), limit_by VARCHAR(64) )" ), " creating table" );
33
33
34
- ok(($sth = $dbh -> prepare(" INSERT INTO dbd_mysql_t35 VALUES (?,?,?)" )));
34
+ ok(($sth = $dbh -> prepare(" INSERT INTO dbd_mysql_t35 VALUES (?,?,?,? )" )));
35
35
36
36
for my $i (0..99) {
37
37
my @chars = grep !/[0O1Iil]/, 0..9, ' A' ..' Z' , ' a' ..' z' ;
38
38
my $random_chars = join ' ' , map { $chars [rand @chars ] } 0 .. 16;
39
39
40
40
# save these values for later testing
41
41
$testInsertVals -> {$i } = $random_chars ;
42
- ok(($rows = $sth -> execute($i , $random_chars , $random_chars )));
42
+ ok(($rows = $sth -> execute($i , $random_chars , $random_chars , $random_chars )));
43
43
}
44
44
45
45
ok($sth = $dbh -> prepare(" SELECT * FROM dbd_mysql_t35 LIMIT ?, ?" ),
@@ -53,6 +53,11 @@ ok( (defined($array_ref = $sth->fetchall_arrayref) &&
53
53
54
54
ok(@$array_ref == 50);
55
55
56
+ ok($sth = $dbh -> prepare(" SELECT * FROM dbd_mysql_t35 WHERE limit_by > ?" ),
57
+ " testing prepare of select statement with started by 'limit' column" );
58
+
59
+ ok($sth -> execute(" foobar" ), ' testing exec of bind vars for placeholder' );
60
+
56
61
ok($sth -> finish);
57
62
58
63
ok($dbh -> do(" UPDATE dbd_mysql_t35 SET name_limit = ? WHERE id = ?" , undef , " updated_string" , 1));
0 commit comments