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_36798.phpt ('ODBC PDO Common: Bug #36798 (Error parsing named parameters with queries containing high-ascii chars)')

Script

1: <?php
2:
3:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
4: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
5:
$db PDOTest::factory();
6:
7: @
$db->exec("SET NAMES 'LATIN1'"); // needed for PostgreSQL
8:
$db->exec("CREATE TABLE test (id INTEGER)");
9:
$db->exec("INSERT INTO test (id) VALUES (1)");
10:
11:
$stmt $db->prepare("SELECT '' as test FROM test WHERE id = :id");
12:
$stmt->execute(array(":id" => 1));
13:
14:
$row $stmt->fetch(PDO::FETCH_NUM);
15:
var_dump$row );
16:
17:
?>
18:

Expected

array(1) {
  [0]=>
  string(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 '' 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/bug_36798.php on line 12
bool(false)

Diff

# original source file: ext/pdo/tests/bug_36798.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 '' 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/bug_36798.php on line 12
002+ bool(false)
001- array(1) {
002-   [0]=>
003-   string(1) ""
004- }

 

Generated at Wed, 16 Apr 2014 12:48:04 +0000 (6 hours ago)

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