rfc:extended-string-types-for-pdo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
rfc:extended-string-types-for-pdo [2017/03/03 15:44] – incorporate feedback from internals discussion adambaratzrfc:extended-string-types-for-pdo [2017/03/17 13:37] – accepted adambaratz
Line 1: Line 1:
 ====== PHP RFC: Extended String Types For PDO ====== ====== PHP RFC: Extended String Types For PDO ======
-  * Version: 0.2+  * Version: 0.3
   * Date: 2017-02-16   * Date: 2017-02-16
   * Author: Adam Baratz adambaratz@php.net   * Author: Adam Baratz adambaratz@php.net
-  * Status: Under Discussion+  * Status: Accepted
   * First Published at: https://wiki.php.net/rfc/extended-string-types-for-pdo   * First Published at: https://wiki.php.net/rfc/extended-string-types-for-pdo
  
Line 9: Line 9:
 The "national character" type was introduced in [[http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt|SQL-92]] (section 4.2.1). It's an open-ended type. The spec indicates that its meaning is defined by the implementation. [[https://dev.mysql.com/doc/refman/5.7/en/charset-national.html|MySQL]] and [[https://msdn.microsoft.com/en-GB/library/ms186939.aspx|Microsoft SQL Server]] use it to store Unicode data. The "national character" type was introduced in [[http://www.contrib.andrew.cmu.edu/~shadow/sql/sql1992.txt|SQL-92]] (section 4.2.1). It's an open-ended type. The spec indicates that its meaning is defined by the implementation. [[https://dev.mysql.com/doc/refman/5.7/en/charset-national.html|MySQL]] and [[https://msdn.microsoft.com/en-GB/library/ms186939.aspx|Microsoft SQL Server]] use it to store Unicode data.
  
-There is a different format for literals of this type. Instead of simply surrounding strings with quotes, an N is added as a prefix (e.g., N'string' instead of 'string'). When using emulated prepared statements -- the default behavior for pdo_mysql, the only one for pdo_dblib -- it's not possible to quote parameters using this format. This means that queries involving these columns will trigger implicit casts, which makes them more expensive.+There is a different format for literals of this type. Instead of simply surrounding strings with quotes, an N is added as a prefix (e.g., N'string' instead of 'string'). When using emulated prepared statements -- the default behavior for pdo_mysql, the only one for pdo_dblib -- it's not possible to quote parameters using this format. This means that queries involving these columns will trigger implicit casts, which makes them more expensive. This issue affects [[https://www.sqlskills.com/blogs/jonathan/implicit-conversions-that-cause-index-scans/|MySQL]] and [[http://code.openark.org/blog/mysql/beware-of-implicit-casting|MSSQL]].
  
 There aren't many pdo_dblib users who comment regularly on the internals list, but the presence of a [[https://bugs.php.net/bug.php?id=60818|feature request]] and a [[https://github.com/php/php-src/pull/2017|pull request]] suggests that this is an impactful omission. There aren't many pdo_dblib users who comment regularly on the internals list, but the presence of a [[https://bugs.php.net/bug.php?id=60818|feature request]] and a [[https://github.com/php/php-src/pull/2017|pull request]] suggests that this is an impactful omission.
Line 40: Line 40:
  
 ===== Proposed Voting Choices ===== ===== Proposed Voting Choices =====
-This project requires a 50%+1 majority.+Voting opened on 8 March 2017. It will close on the 17th at 0:00 UTC. This project requires a 50%+1 majority. 
 + 
 +<doodle title="extended-string-types-for-pdo" auth="adambaratz" voteType="single" closed="true"> 
 +   * Yes 
 +   * No 
 +</doodle>
rfc/extended-string-types-for-pdo.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1