From: Operating system: PHP version: 5.4SVN-2011-07-18 (SVN) Package: SQLite related Bug Type: Feature/Change Request Bug description:Support creating collations in SQLite
Description: ------------ As with many other things, SQLite have very limited support for collations and relies on the host application to implement anything non trivial [1]. For example, an Unicode collations (like accent insensitive collations, for example) will have to be implemented in the application. I would like to add a PDO_sqlite::sqliteCreateCollation() using the same technique as PDO_sqlite::sqliteCreateFunction() and PDO_sqlite::sqliteCreateAggregate(): allow the application to register a PHP callback as a new collation. [1] http://www.sqlite.org/faq.html#q18 Test script: --------------- $db = new pdo('sqlite::memory:'); $db->sqliteCreateCollation('MYCOLLATE', function($a, $b) { return strnatcmp($a, $b); }); // This will return results in the natural order ("P1", "P2", "P10"). $result = $db->query('SELECT name FROM foobar ORDER BY name COLLATE MYCOLLATE'); -- Edit bug report at https://bugs.php.net/bug.php?id=55226&edit=1 -- Try a snapshot (PHP 5.2): https://bugs.php.net/fix.php?id=55226&r=trysnapshot52 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=55226&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=55226&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=55226&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=55226&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=55226&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=55226&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=55226&r=needscript Try newer version: https://bugs.php.net/fix.php?id=55226&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=55226&r=support Expected behavior: https://bugs.php.net/fix.php?id=55226&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=55226&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=55226&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=55226&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=55226&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=55226&r=dst IIS Stability: https://bugs.php.net/fix.php?id=55226&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=55226&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=55226&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=55226&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=55226&r=mysqlcfg Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=55226&r=trysnapshot54
