1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-15 11:41:13 +03:00

Have sqlite3_create_collation() return MISUSE if passed an encoding value other than SQLITE_UTF8, SQLITE_UTF16LE, SQLITE_UTF16BE, SQLITE_UTF16 or SQLITE_UTF16_ALIGNED. (CVS 6558)

FossilOrigin-Name: 7975b6f2ec7736b3656a264c2f7e7e95ce7a78e4
This commit is contained in:
danielk1977
2009-04-28 15:35:38 +00:00
parent a83ccca794
commit ebb329397c
4 changed files with 16 additions and 18 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.541 2009/04/28 04:47:31 drh Exp $
** $Id: main.c,v 1.542 2009/04/28 15:35:39 danielk1977 Exp $
*/
#include "sqliteInt.h"
@@ -1361,9 +1361,9 @@ static int createCollation(
** SQLITE_UTF16NATIVE macro. SQLITE_UTF16 is not used internally.
*/
enc2 = enc;
testcase( enc2 & SQLITE_UTF16 );
testcase( enc2 & SQLITE_UTF16_ALIGNED );
if( enc2 & (SQLITE_UTF16|SQLITE_UTF16_ALIGNED) ){
testcase( enc2==SQLITE_UTF16 );
testcase( enc2==SQLITE_UTF16_ALIGNED );
if( enc2==SQLITE_UTF16 || enc2==SQLITE_UTF16_ALIGNED ){
enc2 = SQLITE_UTF16NATIVE;
}
if( enc2<SQLITE_UTF8 || enc2>SQLITE_UTF16BE ){