| OLD | NEW |
| 1 # 2002 May 24 | 1 # 2002 May 24 |
| 2 # | 2 # |
| 3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
| 4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
| 5 # | 5 # |
| 6 # May you do good and not evil. | 6 # May you do good and not evil. |
| 7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
| 8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
| 9 # | 9 # |
| 10 #*********************************************************************** | 10 #*********************************************************************** |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 ifcapable {bloblit && utf16} { | 55 ifcapable {bloblit && utf16} { |
| 56 do_test enc3-2.1 { | 56 do_test enc3-2.1 { |
| 57 execsql { | 57 execsql { |
| 58 PRAGMA encoding | 58 PRAGMA encoding |
| 59 } | 59 } |
| 60 } {UTF-16le} | 60 } {UTF-16le} |
| 61 do_test enc3-2.2 { | 61 do_test enc3-2.2 { |
| 62 execsql { | 62 execsql { |
| 63 CREATE TABLE t2(a); | 63 CREATE TABLE t2(a); |
| 64 INSERT INTO t2 VALUES(x'61006200630064006500'); | 64 INSERT INTO t2 VALUES(x'61006200630064006500'); |
| 65 SELECT CAST(a AS text) FROM t2 WHERE a LIKE 'abc%'; | 65 SELECT CAST(a AS text) FROM t2 WHERE CAST(a AS text) LIKE 'abc%'; |
| 66 } | 66 } |
| 67 } {abcde} | 67 } {abcde} |
| 68 do_test enc3-2.3 { | 68 do_test enc3-2.3 { |
| 69 execsql { | 69 execsql { |
| 70 SELECT CAST(x'61006200630064006500' AS text); | 70 SELECT CAST(x'61006200630064006500' AS text); |
| 71 } | 71 } |
| 72 } {abcde} | 72 } {abcde} |
| 73 do_test enc3-2.4 { | 73 do_test enc3-2.4 { |
| 74 execsql { | 74 execsql { |
| 75 SELECT rowid FROM t2 WHERE a LIKE x'610062002500'; | 75 SELECT rowid FROM t2 |
| 76 WHERE CAST(a AS text) LIKE CAST(x'610062002500' AS text); |
| 76 } | 77 } |
| 77 } {1} | 78 } {1} |
| 78 } | 79 } |
| 79 | 80 |
| 80 # Try to attach a database with a different encoding. | 81 # Try to attach a database with a different encoding. |
| 81 # | 82 # |
| 82 ifcapable {utf16 && shared_cache} { | 83 ifcapable {utf16 && shared_cache} { |
| 83 db close | 84 db close |
| 84 forcedelete test8.db test8.db-journal | 85 forcedelete test8.db test8.db-journal |
| 85 set ::enable_shared_cache [sqlite3_enable_shared_cache 1] | 86 set ::enable_shared_cache [sqlite3_enable_shared_cache 1] |
| (...skipping 12 matching lines...) Expand all Loading... |
| 98 ATTACH 'test.db' AS utf16; | 99 ATTACH 'test.db' AS utf16; |
| 99 SELECT 1 FROM utf16.sqlite_master LIMIT 1; | 100 SELECT 1 FROM utf16.sqlite_master LIMIT 1; |
| 100 } dbaux | 101 } dbaux |
| 101 } {1 {attached databases must use the same text encoding as main database}} | 102 } {1 {attached databases must use the same text encoding as main database}} |
| 102 dbaux close | 103 dbaux close |
| 103 forcedelete test8.db test8.db-journal | 104 forcedelete test8.db test8.db-journal |
| 104 sqlite3_enable_shared_cache $::enable_shared_cache | 105 sqlite3_enable_shared_cache $::enable_shared_cache |
| 105 } | 106 } |
| 106 | 107 |
| 107 finish_test | 108 finish_test |
| OLD | NEW |