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

Test Failure Report for ext/odbc/tests/bug80147.phpt ('Bug #80147 (BINARY strings may not be properly zero-terminated)')

Script

1: <?php
2:
include 'config.inc';
3:
4:
$conn odbc_connect($dsn$user$pass);
5:
6:
odbc_exec($conn"CREATE TABLE bug80147 (id INT, whatever VARBINARY(50))");
7:
odbc_exec($conn"INSERT INTO bug80147 VALUES (1, CONVERT(VARBINARY(50), 'whatever'))");
8:
9:
$res odbc_exec($conn"SELECT * FROM bug80147");
10:
odbc_binmode($resODBC_BINMODE_RETURN);
11:
odbc_fetch_row($res);
12:
var_dump(odbc_result($res'whatever'));
13:
?>
14:

Expected

string(8) "whatever"

Output

Warning: odbc_exec(): SQL error: [unixODBC][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 'VARBINARY(50), 'whatever'))' at line 1, SQL state 37000 in SQLExecDirect in /var/php_gcov/PHP_7_3/ext/odbc/tests/bug80147.php on line 7
bool(false)

Diff

001+ Warning: odbc_exec(): SQL error: [unixODBC][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 'VARBINARY(50), 'whatever'))' at line 1, SQL state 37000 in SQLExecDirect in /var/php_gcov/PHP_7_3/ext/odbc/tests/bug80147.php on line 7
001- string(8) "whatever"
002+ bool(false)

 

Generated at Fri, 26 Nov 2021 01:14:57 +0000 (7 days ago)

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