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