diff --git a/amalgamation/rename_exports.h b/amalgamation/rename_exports.h index 52274ef7ed700e38d9d841f95def2daa9ab18479..36b6c9df5a4c2869122eb61928f7dbcc96dde882 100644 --- a/amalgamation/rename_exports.h +++ b/amalgamation/rename_exports.h @@ -1,4 +1,4 @@ -// Copyright 2023 The Chromium Authors. All rights reserved. +// Copyright 2024 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/amalgamation/sqlite3.c b/amalgamation/sqlite3.c index 560ea7afa6112858d9c5ab868b76751b60a01993..acb2dbe98150f8e302ffde35c3884deb24030afc 100644 --- a/amalgamation/sqlite3.c +++ b/amalgamation/sqlite3.c @@ -454,7 +454,7 @@ extern "C" { */ #define SQLITE_VERSION "3.41.2" #define SQLITE_VERSION_NUMBER 3041002 -#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aff78" +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aalt1" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -162770,7 +162770,10 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */ testcase( pOrderBy && pOrderBy->nExpr==BMS-1 ); - if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; + if( pOrderBy && pOrderBy->nExpr>=BMS ){ + pOrderBy = 0; + wctrlFlags &= ~WHERE_WANT_DISTINCT; + } /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask diff --git a/amalgamation/sqlite3.h b/amalgamation/sqlite3.h index e967249b609c57b946734ce9224e31c25e2f4db2..c87819b5feab8d90bf2596a80fd0ceebb5a2a34e 100644 --- a/amalgamation/sqlite3.h +++ b/amalgamation/sqlite3.h @@ -148,7 +148,7 @@ extern "C" { */ #define SQLITE_VERSION "3.41.2" #define SQLITE_VERSION_NUMBER 3041002 -#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aff78" +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aalt1" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/amalgamation_dev/rename_exports.h b/amalgamation_dev/rename_exports.h index 52274ef7ed700e38d9d841f95def2daa9ab18479..36b6c9df5a4c2869122eb61928f7dbcc96dde882 100644 --- a/amalgamation_dev/rename_exports.h +++ b/amalgamation_dev/rename_exports.h @@ -1,4 +1,4 @@ -// Copyright 2023 The Chromium Authors. All rights reserved. +// Copyright 2024 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/amalgamation_dev/sqlite3.c b/amalgamation_dev/sqlite3.c index 0819ea6a615c07c50ce4f1e1c8c839433a165352..48ec733ed409c90efa92a3d4b16e6fdf22c44a4b 100644 --- a/amalgamation_dev/sqlite3.c +++ b/amalgamation_dev/sqlite3.c @@ -454,7 +454,7 @@ extern "C" { */ #define SQLITE_VERSION "3.41.2" #define SQLITE_VERSION_NUMBER 3041002 -#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aff78" +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aalt1" /* ** CAPI3REF: Run-Time Library Version Numbers @@ -162783,7 +162783,10 @@ SQLITE_PRIVATE WhereInfo *sqlite3WhereBegin( /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */ testcase( pOrderBy && pOrderBy->nExpr==BMS-1 ); - if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; + if( pOrderBy && pOrderBy->nExpr>=BMS ){ + pOrderBy = 0; + wctrlFlags &= ~WHERE_WANT_DISTINCT; + } /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask @@ -219195,15 +219198,19 @@ static int sessionReadRecord( } } if( eType==SQLITE_INTEGER || eType==SQLITE_FLOAT ){ - sqlite3_int64 v = sessionGetI64(aVal); - if( eType==SQLITE_INTEGER ){ - sqlite3VdbeMemSetInt64(apOut[i], v); + if( (pIn->nData-pIn->iNext)<8 ){ + rc = SQLITE_CORRUPT_BKPT; }else{ - double d; - memcpy(&d, &v, 8); - sqlite3VdbeMemSetDouble(apOut[i], d); + sqlite3_int64 v = sessionGetI64(aVal); + if( eType==SQLITE_INTEGER ){ + sqlite3VdbeMemSetInt64(apOut[i], v); + }else{ + double d; + memcpy(&d, &v, 8); + sqlite3VdbeMemSetDouble(apOut[i], d); + } + pIn->iNext += 8; } - pIn->iNext += 8; } } } diff --git a/amalgamation_dev/sqlite3.h b/amalgamation_dev/sqlite3.h index e967249b609c57b946734ce9224e31c25e2f4db2..c87819b5feab8d90bf2596a80fd0ceebb5a2a34e 100644 --- a/amalgamation_dev/sqlite3.h +++ b/amalgamation_dev/sqlite3.h @@ -148,7 +148,7 @@ extern "C" { */ #define SQLITE_VERSION "3.41.2" #define SQLITE_VERSION_NUMBER 3041002 -#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aff78" +#define SQLITE_SOURCE_ID "2023-03-22 11:56:21 c5a8ed5442668c558f8330bc68beb9e9e6396526f364a63f7a6cb812639aalt1" /* ** CAPI3REF: Run-Time Library Version Numbers diff --git a/src/where.c b/src/where.c index 448c9557637ada065739cbc60c303af3f6972561..423fa379a452aa1232d613e2dc585b3bc5a9e74a 100644 --- a/src/where.c +++ b/src/where.c @@ -5849,7 +5849,10 @@ WhereInfo *sqlite3WhereBegin( /* An ORDER/GROUP BY clause of more than 63 terms cannot be optimized */ testcase( pOrderBy && pOrderBy->nExpr==BMS-1 ); - if( pOrderBy && pOrderBy->nExpr>=BMS ) pOrderBy = 0; + if( pOrderBy && pOrderBy->nExpr>=BMS ){ + pOrderBy = 0; + wctrlFlags &= ~WHERE_WANT_DISTINCT; + } /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask