Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch dump-recovery Excluding Merge-Ins
This is equivalent to a diff from 50eec5d9 to 5dc82a15
2017-03-09
| ||
18:13 | Fix the ".dump" command to correctly extract tail data from corrupt WITHOUT ROWID tables. (check-in: 6c627e50 user: drh tags: trunk) | |
16:32 | Add the --recovery-mode option to the CLI ".dump" command. This involves enhancing the "PRAGMA reverse_unordered_selects" command to accept a "TOGGLE" option. Recovery mode used to be always on. Now it is opt-in. Not sure this is the correct approach. Also not sure if TOGGLE is a good feature to have on boolean PRAGMA statements. (Closed-Leaf check-in: 5dc82a15 user: drh tags: dump-recovery) | |
13:50 | Begin moving separate boolean variables in the ShellState object of the CLI into the shellFlgs bitmask. (check-in: 50eec5d9 user: drh tags: trunk) | |
2017-03-08
| ||
18:06 | Make sure the database connection is open prior to running the ".sha3sum" command. (check-in: 2ea300fb user: drh tags: trunk) | |
Changes to src/pragma.c.
︙ | |||
1041 1042 1043 1044 1045 1046 1047 | 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 | - - + + + + + - + | } #if SQLITE_USER_AUTHENTICATION if( db->auth.authLevel==UAUTH_User ){ /* Do not allow non-admin users to modify the schema arbitrarily */ mask &= ~(SQLITE_WriteSchema); } #endif |
︙ |
Changes to src/shell.c.
︙ | |||
1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 | 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 | + | #define SHFLG_Scratch 0x00000001 /* The --scratch option is used */ #define SHFLG_Pagecache 0x00000002 /* The --pagecache option is used */ #define SHFLG_Lookaside 0x00000004 /* Lookaside memory is used */ #define SHFLG_Backslash 0x00000008 /* The --backslash option is used */ #define SHFLG_PreserveRowid 0x00000010 /* .dump preserves rowid values */ #define SHFLG_CountChanges 0x00000020 /* .changes setting */ #define SHFLG_Echo 0x00000040 /* .echo or --echo setting */ #define SHFLG_RecoveryMode 0x00000080 /* The --recovery-mode flag for .dump */ /* ** Macros for testing and setting shellFlgs */ #define ShellHasFlag(P,X) (((P)->shellFlgs & (X))!=0) #define ShellSetFlag(P,X) ((P)->shellFlgs|=(X)) #define ShellClearFlag(P,X) ((P)->shellFlgs&=(~(X))) |
︙ | |||
2215 2216 2217 2218 2219 2220 2221 | 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 | - + - + | raw_printf(pArg->out, "Memory Used: %d (max %d) bytes\n", iCur, iHiwtr); iHiwtr = iCur = -1; sqlite3_status(SQLITE_STATUS_MALLOC_COUNT, &iCur, &iHiwtr, bReset); raw_printf(pArg->out, "Number of Outstanding Allocations: %d (max %d)\n", iCur, iHiwtr); |
︙ | |||
2260 2261 2262 2263 2264 2265 2266 | 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 | - + | sqlite3_status(SQLITE_STATUS_PARSER_STACK, &iCur, &iHiwtr, bReset); raw_printf(pArg->out, "Deepest Parser Stack: %d (max %d)\n", iCur, iHiwtr); #endif } if( pArg && pArg->out && db ){ |
︙ | |||
2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 | 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 | + + + + + + + + - - + + + - + | appendText(&sSelect, zTable, quoteChar(zTable)); savedDestTable = p->zDestTable; savedMode = p->mode; p->zDestTable = sTable.z; p->mode = p->cMode = MODE_Insert; rc = shell_exec(p->db, sSelect.z, shell_callback, p, 0); if( (rc&0xff)==SQLITE_CORRUPT ){ raw_printf(p->out, "/****** CORRUPTION ERROR *******/\n"); if( ShellHasFlag(p, SHFLG_RecoveryMode) ){ sqlite3_exec(p->db, "PRAGMA reverse_unordered_selects=TOGGLE",0,0,0); shell_exec(p->db, sSelect.z, shell_callback, p, 0); sqlite3_exec(p->db, "PRAGMA reverse_unordered_selects=TOGGLE",0,0,0); } } p->zDestTable = savedDestTable; p->mode = savedMode; freeText(&sTable); freeText(&sSelect); if( rc ) p->nErr++; } return 0; } /* ** Run zQuery. Use dump_callback() as the callback routine so that ** the contents of the query are output as SQL statements. ** |
︙ | |||
4566 4567 4568 4569 4570 4571 4572 | 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 | - + + + + - + + + + - - - - + + + + + | if( c=='d' && strncmp(azArg[0], "dbinfo", n)==0 ){ rc = shell_dbinfo_command(p, nArg, azArg); }else if( c=='d' && strncmp(azArg[0], "dump", n)==0 ){ const char *zLike = 0; int i; |
︙ | |||
4632 4633 4634 4635 4636 4637 4638 | 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 | + - - + + + | run_table_dump_query(p, zSql, 0); sqlite3_free(zSql); } if( p->writableSchema ){ raw_printf(p->out, "PRAGMA writable_schema=OFF;\n"); p->writableSchema = 0; } if( ShellHasFlag(p, SHFLG_RecoveryMode) ){ |
︙ |