PHP  
 PHP_HEAD
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_odbc/tests/bug_43130.phpt ('ODBC PDO Common: Bug #43130 (Bound parameters cannot have - in their name)')

Script

1: <?php
2:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
3: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4:
$db PDOTest::factory();
5:
6: if (
$db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql')
7:     
$db->setAttribute(PDO::ATTR_EMULATE_PREPARES1);
8:
9:
$db->exec("CREATE TABLE test (a varchar(100), b varchar(100), c varchar(100))");
10:
11: for (
$i 0$i 5$i++) {
12:     
$db->exec("INSERT INTO test (a,b,c) VALUES('test".$i."','".$i."','".$i."')");
13: }
14:
15:
$stmt $db->prepare("SELECT a FROM test WHERE b=:id-value");
16:
$stmt->bindParam(':id-value'$id);
17:
$id '1';
18:
$stmt->execute();
19:
var_dump($stmt->fetch(PDO::FETCH_COLUMN));
20:
?>
21:

Expected

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in %s on line %d

Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d
bool(false)

Output

Warning: PDOStatement::bindParam(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_43130.php on line 16

Warning: PDOStatement::execute(): SQLSTATE[07001]: <<Unknown error>>: 506 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]SQLBindParameter not used for all parameters (SQLExecute[506] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:260) in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_43130.php on line 18
bool(false)

Diff

# original source file: ext/pdo/tests/bug_43130.phpt
001+ Warning: PDOStatement::bindParam(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_43130.php on line 16
001- Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number: parameter was not defined in %s on line %d
003+ Warning: PDOStatement::execute(): SQLSTATE[07001]: <<Unknown error>>: 506 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]SQLBindParameter not used for all parameters (SQLExecute[506] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:260) in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug_43130.php on line 18
003- Warning: PDOStatement::execute(): SQLSTATE[HY093]: Invalid parameter number in %s on line %d

 

Generated at Sat, 27 Sep 2014 16:43:25 +0000 (4 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.