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/bug65946.phpt ('ODBC Bug #65946 (pdo_sql_parser.c permanently converts values bound to strings)')

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:
$db->setAttribute(PDO::ATTR_EMULATE_PREPAREStrue);
6:
$db->exec('CREATE TABLE test(id int)');
7:
$db->exec('INSERT INTO test VALUES(1)');
8:
$stmt $db->prepare('SELECT * FROM test LIMIT :limit');
9:
$stmt->bindValue('limit'1PDO::PARAM_INT);
10: if(!(
$res $stmt->execute())) var_dump($stmt->errorInfo());
11: if(!(
$res $stmt->execute())) var_dump($stmt->errorInfo());
12:
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
13:
?>
14:

Expected

array(1) {
  [0]=>
  array(1) {
    ["id"]=>
    string(1) "1"
  }
}

Output

Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug65946.php on line 10
array(4) {
  [0]=>
  string(5) "42000"
  [1]=>
  int(1064)
  [2]=>
  string(262) "[MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254)"
  [3]=>
  string(5) "42000"
}

Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug65946.php on line 11
array(4) {
  [0]=>
  string(5) "42000"
  [1]=>
  int(1064)
  [2]=>
  string(262) "[MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254)"
  [3]=>
  string(5) "42000"
}
array(0) {
}

Diff

# original source file: ext/pdo/tests/bug65946.phpt
001+ Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug65946.php on line 10
002+ array(4) {
001- array(1) {
003-   array(1) {
004-     ["id"]=>
005-     string(1) "1"
006-   }
004+   string(5) "42000"
005+   [1]=>
006+   int(1064)
007+   [2]=>
008+   string(262) "[MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254)"
009+   [3]=>
010+   string(5) "42000"
012+ 
013+ Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_HEAD/ext/pdo_odbc/tests/bug65946.php on line 11
014+ array(4) {
015+   [0]=>
016+   string(5) "42000"
017+   [1]=>
018+   int(1064)
019+   [2]=>
020+   string(262) "[MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''1'' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_HEAD/ext/pdo_odbc/odbc_stmt.c:254)"
021+   [3]=>
022+   string(5) "42000"
023+ }
024+ array(0) {
025+ }

 

Generated at Mon, 04 Aug 2014 15:49:20 +0000 (15 days ago)

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