Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch defensive-improvements Excluding Merge-Ins
This is equivalent to a diff from 70390bbca4 to 6aef58b629
2020-01-17
| ||
14:56 | Do not allow shadow tables to be dropped in defensive mode. (check-in: ad1f760f16 user: drh tags: branch-3.28) | |
2019-11-16
| ||
18:36 | Do not allow shadow tables to be dropped in defensive mode. (check-in: 0a988ce340 user: drh tags: apple-osx) | |
16:54 | More restrictions on changes to shadow tables when in defensive mode. (check-in: bae76a5c40 user: drh tags: trunk) | |
14:15 | Do not allow CREATE TABLE or CREATE VIEW of an object with a name that looks like a shadow table name. (Closed-Leaf check-in: 6aef58b629 user: drh tags: defensive-improvements) | |
13:51 | Break out the test for writable shadow tables into a separate subroutine. (check-in: 8ad34d36a1 user: drh tags: defensive-improvements) | |
12:04 | Do not allow shadow tables to be dropped in defensive mode. (check-in: 70390bbca4 user: drh tags: trunk) | |
11:33 | Fix a potential NULL pointer dereference on a RENAME TABLE that references a VIEW with a logic error in a window function in the ORDER BY clause. (check-in: 0adb273f7e user: drh tags: trunk) | |
Changes to src/alter.c.
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | - + - - + | ** in pParse->zErr (system tables may not be altered) and returns non-zero. ** ** Or, if zName is not a system table, zero is returned. */ static int isAlterableTable(Parse *pParse, Table *pTab){ if( 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) #ifndef SQLITE_OMIT_VIRTUALTABLE |
︙ |
Changes to src/build.c.
︙ | |||
852 853 854 855 856 857 858 | 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 | - - + + + | ){ if( sqlite3Config.bExtraSchemaChecks ){ sqlite3ErrorMsg(pParse, ""); /* corruptSchema() will supply the error */ return SQLITE_ERROR; } } }else{ |
︙ | |||
2125 2126 2127 2128 2129 2130 2131 | 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 | - + - - | /* ** Return true if zName is a shadow table name in the current database ** connection. ** ** zName is temporarily modified while this routine is running, but is ** restored to its original value prior to this routine returning. */ |
︙ | |||
2186 2187 2188 2189 2190 2191 2192 | 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 | - + | if( pEnd==0 && pSelect==0 ){ return; } assert( !db->mallocFailed ); p = pParse->pNewTable; if( p==0 ) return; |
︙ | |||
2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 | 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 | + + + + + + + + + + + + + + + + - + - + - - + | sqlite3VdbeAddOp4(v, OP_VDestroy, iDb, 0, 0, pTab->zName, 0); sqlite3MayAbort(pParse); } sqlite3VdbeAddOp4(v, OP_DropTable, iDb, 0, 0, pTab->zName, 0); sqlite3ChangeCookie(pParse, iDb); sqliteViewResetAll(db, iDb); } /* ** Return TRUE if shadow tables should be read-only in the current ** context. */ int sqlite3ReadOnlyShadowTables(sqlite3 *db){ #ifndef SQLITE_OMIT_VIRTUALTABLE if( (db->flags & SQLITE_Defensive)!=0 && db->pVtabCtx==0 && db->nVdbeExec==0 ){ return 1; } #endif return 0; } /* ** Return true if it is not allowed to drop the given table */ |
︙ | |||
2975 2976 2977 2978 2979 2980 2981 | 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 | - + | goto exit_drop_table; } if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ goto exit_drop_table; } } #endif |
︙ |
Changes to src/delete.c.
︙ | |||
66 67 68 69 70 71 72 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - + - - - - | } if( (pTab->tabFlags & (TF_Readonly|TF_Shadow))==0 ) return 0; db = pParse->db; if( (pTab->tabFlags & TF_Readonly)!=0 ){ return sqlite3WritableSchema(db)==0 && pParse->nested==0; } assert( pTab->tabFlags & TF_Shadow ); |
︙ |
Changes to src/sqliteInt.h.
︙ | |||
4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 | 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 | + + + + + + | sqlite3*, const char*, const sqlite3_module*, void*, void(*)(void*) ); # define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0) #endif int sqlite3ReadOnlyShadowTables(sqlite3 *db); #ifndef SQLITE_OMIT_VIRTUALTABLE int sqlite3ShadowTableName(sqlite3 *db, const char *zName); #else # define sqlite3ShadowTableName(A,B) 0 #endif int sqlite3VtabEponymousTableInit(Parse*,Module*); void sqlite3VtabEponymousTableClear(sqlite3*,Module*); void sqlite3VtabMakeWritable(Parse*,Table*); void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*, int); void sqlite3VtabFinishParse(Parse*, Token*); void sqlite3VtabArgInit(Parse*); |
︙ |
Changes to test/altertab.test.
︙ | |||
542 543 544 545 546 547 548 549 | 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 | - - + + - - - + + + + + + + + + + + + + + + + + + + | CREATE VIRTUAL TABLE y1 USING fts3; } do_catchsql_test 16.10 { INSERT INTO y1_segments VALUES(1, X'1234567890'); } {1 {table y1_segments may not be modified}} do_catchsql_test 16.20 { |
︙ |