diff options
author | drh <drh@noemail.net> | 2020-03-05 16:13:24 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-03-05 16:13:24 +0000 |
commit | 42a630b1daf1df13850095251cc73be84dbdeac8 (patch) | |
tree | cc6212d1cf798a2e3d8d8ce7d98c016a7056519c /src/main.c | |
parent | 4cf2121e1c0adfcae41d89426e1e5e81ca4721a9 (diff) | |
download | sqlite-42a630b1daf1df13850095251cc73be84dbdeac8.tar.gz sqlite-42a630b1daf1df13850095251cc73be84dbdeac8.zip |
Change the sqlite3.pDfltColl (the default collating sequence for the
database connection) so that it is the collating sequence appropriate for
the database encoding, not the UTF8 collating sequence. This helps to
ensure that the database encoding collation is always used, even for
expressions that do not have an defined collating sequence.
Ticket [1b8d7264567eb6fc].
FossilOrigin-Name: 4a5851893c3d71cc823b6ab5df5e58a852cd322fff26290f1ea05b63d67f564a
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/main.c b/src/main.c index 74b532667..98e030fad 100644 --- a/src/main.c +++ b/src/main.c @@ -3199,11 +3199,6 @@ static int openDatabase( if( db->mallocFailed ){ goto opendb_out; } - /* EVIDENCE-OF: R-08308-17224 The default collating function for all - ** strings is BINARY. - */ - db->pDfltColl = sqlite3FindCollSeq(db, SQLITE_UTF8, sqlite3StrBINARY, 0); - assert( db->pDfltColl!=0 ); /* Parse the filename/URI argument ** @@ -3248,7 +3243,9 @@ static int openDatabase( } sqlite3BtreeEnter(db->aDb[0].pBt); db->aDb[0].pSchema = sqlite3SchemaGet(db, db->aDb[0].pBt); - if( !db->mallocFailed ) ENC(db) = SCHEMA_ENC(db); + if( !db->mallocFailed ){ + sqlite3SetTextEncoding(db, SCHEMA_ENC(db)); + } sqlite3BtreeLeave(db->aDb[0].pBt); db->aDb[1].pSchema = sqlite3SchemaGet(db, 0); |