|
2 | 2 | #pragma clang diagnostic ignored "-Wshorten-64-to-32"
|
3 | 3 | /******************************************************************************
|
4 | 4 | ** This file is an amalgamation of many separate C source files from SQLite
|
5 |
| -** version 3.50.3. By combining all the individual C code files into this |
| 5 | +** version 3.50.4. By combining all the individual C code files into this |
6 | 6 | ** single large file, the entire code can be compiled as a single translation
|
7 | 7 | ** unit. This allows many compilers to do optimizations that would not be
|
8 | 8 | ** possible if the files were compiled separately. Performance improvements
|
|
20 | 20 | ** separate file. This file contains only code for the core SQLite library.
|
21 | 21 | **
|
22 | 22 | ** The content in this amalgamation comes from Fossil check-in
|
23 |
| -** 3ce993b8657d6d9deda380a93cdd6404a8c8 with changes in files: |
| 23 | +** 4d8adfb30e03f9cf27f800a2c1ba3c48fb4c with changes in files: |
24 | 24 | **
|
25 | 25 | **
|
26 | 26 | */
|
@@ -467,9 +467,9 @@ extern "C" {
|
467 | 467 | ** [sqlite_nio_sqlite3_libversion_number()], [sqlite_nio_sqlite3_sourceid()],
|
468 | 468 | ** [sqlite_version()] and [sqlite_source_id()].
|
469 | 469 | */
|
470 |
| -#define SQLITE_VERSION "3.50.3" |
471 |
| -#define SQLITE_VERSION_NUMBER 3050003 |
472 |
| -#define SQLITE_SOURCE_ID "2025-07-17 13:25:10 3ce993b8657d6d9deda380a93cdd6404a8c8ba1b185b2bc423703e41ae5f2543" |
| 470 | +#define SQLITE_VERSION "3.50.4" |
| 471 | +#define SQLITE_VERSION_NUMBER 3050004 |
| 472 | +#define SQLITE_SOURCE_ID "2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3" |
473 | 473 |
|
474 | 474 | /*
|
475 | 475 | ** CAPI3REF: Run-Time Library Version Numbers
|
@@ -19442,6 +19442,7 @@ struct Expr {
|
19442 | 19442 | Table *pTab; /* TK_COLUMN: Table containing column. Can be NULL
|
19443 | 19443 | ** for a column of an index on an expression */
|
19444 | 19444 | Window *pWin; /* EP_WinFunc: Window/Filter defn for a function */
|
| 19445 | + int nReg; /* TK_NULLS: Number of registers to NULL out */ |
19445 | 19446 | struct { /* TK_IN, TK_SELECT, and TK_EXISTS */
|
19446 | 19447 | int iAddr; /* Subroutine entry address */
|
19447 | 19448 | int regReturn; /* Register used to hold return address */
|
@@ -21476,6 +21477,7 @@ SQLITE_PRIVATE void sqlite3ExprCodeGeneratedColumn(Parse*, Table*, Column*, int)
|
21476 | 21477 | SQLITE_PRIVATE void sqlite3ExprCodeCopy(Parse*, Expr*, int);
|
21477 | 21478 | SQLITE_PRIVATE void sqlite3ExprCodeFactorable(Parse*, Expr*, int);
|
21478 | 21479 | SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(Parse*, Expr*, int);
|
| 21480 | +SQLITE_PRIVATE void sqlite3ExprNullRegisterRange(Parse*, int, int); |
21479 | 21481 | SQLITE_PRIVATE int sqlite3ExprCodeTemp(Parse*, Expr*, int*);
|
21480 | 21482 | SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse*, Expr*, int);
|
21481 | 21483 | SQLITE_PRIVATE int sqlite3ExprCodeExprList(Parse*, ExprList*, int, int, u8);
|
@@ -115243,6 +115245,12 @@ SQLITE_PRIVATE int sqlite3ExprCodeTarget(Parse *pParse, Expr *pExpr, int target)
|
115243 | 115245 | sqlite3VdbeLoadString(v, target, pExpr->u.zToken);
|
115244 | 115246 | return target;
|
115245 | 115247 | }
|
| 115248 | + case TK_NULLS: { |
| 115249 | + /* Set a range of registers to NULL. pExpr->y.nReg registers starting |
| 115250 | + ** with target */ |
| 115251 | + sqlite3VdbeAddOp3(v, OP_Null, 0, target, target + pExpr->y.nReg - 1); |
| 115252 | + return target; |
| 115253 | + } |
115246 | 115254 | default: {
|
115247 | 115255 | /* Make NULL the default case so that if a bug causes an illegal
|
115248 | 115256 | ** Expr node to be passed into this function, it will be handled
|
@@ -115927,6 +115935,25 @@ SQLITE_PRIVATE int sqlite3ExprCodeRunJustOnce(
|
115927 | 115935 | return regDest;
|
115928 | 115936 | }
|
115929 | 115937 |
|
| 115938 | +/* |
| 115939 | +** Make arrangements to invoke OP_Null on a range of registers |
| 115940 | +** during initialization. |
| 115941 | +*/ |
| 115942 | +SQLITE_PRIVATE SQLITE_NOINLINE void sqlite3ExprNullRegisterRange( |
| 115943 | + Parse *pParse, /* Parsing context */ |
| 115944 | + int iReg, /* First register to set to NULL */ |
| 115945 | + int nReg /* Number of sequential registers to NULL out */ |
| 115946 | +){ |
| 115947 | + u8 okConstFactor = pParse->okConstFactor; |
| 115948 | + Expr t; |
| 115949 | + memset(&t, 0, sizeof(t)); |
| 115950 | + t.op = TK_NULLS; |
| 115951 | + t.y.nReg = nReg; |
| 115952 | + pParse->okConstFactor = 1; |
| 115953 | + sqlite3ExprCodeRunJustOnce(pParse, &t, iReg); |
| 115954 | + pParse->okConstFactor = okConstFactor; |
| 115955 | +} |
| 115956 | + |
115930 | 115957 | /*
|
115931 | 115958 | ** Generate code to evaluate an expression and store the results
|
115932 | 115959 | ** into a register. Return the register number where the results
|
@@ -153177,6 +153204,7 @@ SQLITE_PRIVATE int sqlite3Select(
|
153177 | 153204 | sqlite3VdbeAddOp2(v, OP_Integer, 0, iAbortFlag);
|
153178 | 153205 | VdbeComment((v, "clear abort flag"));
|
153179 | 153206 | sqlite3VdbeAddOp3(v, OP_Null, 0, iAMem, iAMem+pGroupBy->nExpr-1);
|
| 153207 | + sqlite3ExprNullRegisterRange(pParse, iAMem, pGroupBy->nExpr); |
153180 | 153208 |
|
153181 | 153209 | /* Begin a loop that will extract all source rows in GROUP BY order.
|
153182 | 153210 | ** This might involve two separate loops with an OP_Sort in between, or
|
@@ -168472,6 +168500,7 @@ static int whereLoopAddBtree(
|
168472 | 168500 | pNew->u.btree.nEq = 0;
|
168473 | 168501 | pNew->u.btree.nBtm = 0;
|
168474 | 168502 | pNew->u.btree.nTop = 0;
|
| 168503 | + pNew->u.btree.nDistinctCol = 0; |
168475 | 168504 | pNew->nSkip = 0;
|
168476 | 168505 | pNew->nLTerm = 0;
|
168477 | 168506 | pNew->iSortIdx = 0;
|
@@ -169540,8 +169569,6 @@ static i8 wherePathSatisfiesOrderBy(
|
169540 | 169569 | obSat = obDone;
|
169541 | 169570 | }
|
169542 | 169571 | break;
|
169543 |
| - }else if( wctrlFlags & WHERE_DISTINCTBY ){ |
169544 |
| - pLoop->u.btree.nDistinctCol = 0; |
169545 | 169572 | }
|
169546 | 169573 | iCur = pWInfo->pTabList->a[pLoop->iTab].iCursor;
|
169547 | 169574 |
|
@@ -257285,7 +257312,7 @@ static void fts5SourceIdFunc(
|
257285 | 257312 | ){
|
257286 | 257313 | assert( nArg==0 );
|
257287 | 257314 | UNUSED_PARAM2(nArg, apUnused);
|
257288 |
| - sqlite_nio_sqlite3_result_text(pCtx, "fts5: 2025-07-17 13:25:10 3ce993b8657d6d9deda380a93cdd6404a8c8ba1b185b2bc423703e41ae5f2543", -1, SQLITE_TRANSIENT); |
| 257315 | + sqlite_nio_sqlite3_result_text(pCtx, "fts5: 2025-07-30 19:33:53 4d8adfb30e03f9cf27f800a2c1ba3c48fb4ca1b08b0f5ed59a4d5ecbf45e20a3", -1, SQLITE_TRANSIENT); |
257289 | 257316 | }
|
257290 | 257317 |
|
257291 | 257318 | /*
|
|
0 commit comments