Bug #67495 [Com]: pdo_dblib incorrectly escapes binary and unicode values

From: Date: Sun, 22 Jun 2014 21:01:58 +0000
Subject: Bug #67495 [Com]: pdo_dblib incorrectly escapes binary and unicode values
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-186292@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67495&edit=1 ID: 67495 Comment by: sdfghjk at fff dot lt Reported by: vytas dot LT at gmail dot com Summary: pdo_dblib incorrectly escapes binary and unicode values Status: Open Type: Bug Package: PDO DBlib PHP Version: 5.6Git-2014-06-22 (Git) Block user comment: N Private report: N New Comment: e ble Previous Comments: ------------------------------------------------------------------------ [2014-06-22 20:49:08] vytas dot LT at gmail dot com Description: ------------ For storing unicode text MSSQL has nchar and nvarchar column types However, pdo_dblib extension does not correctly escapes unicode strings. Those strings must be prefixed with N prefix - e.g. INSERT INTO table(field) (N'unicode_value') UPDATE table SET field = N'unicode_value' WHERE code = N'unicode_value' Likewise binary, varbinary and blob should be escaped like unquoted hexadamical notation starting with 0x - e. g. INSERT INTO table(binfield) (0xAAFFCC) UPDATE table SET binfield = 0xAAFFCC WHERE code = 0xCCAAFF ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67495&edit=1

« previous php.bugs (#186292) next »