]> git.joonet.de Git - adminer.git/commitdiff
Support binary data in SQLite (http://forum.zdrojak.cz/?topic=619, https://sourceforg...
authorJakub Vrana <jakub@vrana.cz>
Mon, 14 May 2012 06:20:47 +0000 (23:20 -0700)
committerJakub Vrana <jakub@vrana.cz>
Mon, 14 May 2012 06:23:57 +0000 (23:23 -0700)
adminer/drivers/sqlite.inc.php
changes.txt

index c1b6bf688e95bc28c7ed3d6f66c585781ad80aba..85d1347ad34a49a67934dd9b40f87e403b6d1fd5 100644 (file)
@@ -30,7 +30,10 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
                                }
                                
                                function quote($string) {
-                                       return "'" . $this->_link->escapeString($string) . "'";
+                                       return (is_utf8($string)
+                                               ? "'" . $this->_link->escapeString($string) . "'"
+                                               : "x'" . reset(unpack('H*', $string)) . "'"
+                                       );
                                }
                                
                                function store_result() {
index a6ab99acbfe14b49a5e27b5f6cbd2044b55c65f4..4ee0aea5fa445c0f49f2d25fd296c8fdeb437d50 100644 (file)
@@ -4,6 +4,7 @@ Highlight code in SQL command by CodeMirror
 Link to descending order
 Link to original table in EXPLAIN of SELECT * FROM table t
 MySQL: inform about disabled event_scheduler
+SQLite: support binary data
 PostgreSQL: approximate row count in table overview
 Oracle: schema, processlist, table overview numbers
 Replace JSMin by better JavaScript minifier