-C Fix\sa\slong-standing\sbug\sin\s.schema\swhen\sthe\sargument\scontains\sa\s".".
-D 2025-11-16T10:49:51.306
+C Default\s.mode\sis\snow\sqbox\swith\slimits.\s\sNew\s--compat\sYYYYMMDD\scommand-line\noption,\sand\snew\s-DCOMPATIBILITY_DATE=YYYYMMDD\scompile-time\soptions\scan\noverride.\s\sCommand\s".mode\sYYYYMMDD"\ssets\sthe\smode\sto\sthe\sdefault\sfor\sthe\ndate\sgiven.
+D 2025-11-16T17:27:21.262
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F src/resolve.c 5616fbcf3b833c7c705b24371828215ad0925d0c0073216c4f153348d5753f0a
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c ba9cd07ffa3277883c1986085f6ddc4320f4d35d5f212ab58df79a7ecc1a576a
-F src/shell.c.in c1606803c02f9dafc6c9644712be88b8f50cf267fd82c7085f8339de6a158a66
+F src/shell.c.in 2044498d05ffcaccdd713cce4d8482f6f3f66dbafb911c782a85bbfb47a8ca27
F src/sqlite.h.in 795ce84cc136b4e74d882cf4fab56d2927c20b9af9fd2fcea27760a6fe50851b
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P 3e02804c387c89afde59eef8e464c6011e083e158873e4f8ab1f17bcc12b7c28
-R 01873a3f151ad28aeba6a62a8ffe1131
+P 404576214fc20161cdcb031d57696d6068506309c8faecd3e4424e5ced28046b
+R 656e4e2e056e170cfa1c688265c9909d
U drh
-Z 08514ae94b4a719d2cf12e9dff1abcec
+Z 2168f764ba4213c8e8606210a6330583
# Remove this line to create a well-formed Fossil manifest.
typedef struct ShellState ShellState;
struct ShellState {
sqlite3 *db; /* The database */
+ int iCompat; /* Compatibility date YYYYMMDD */
u8 openMode; /* SHELL_OPEN_NORMAL, _APPENDVFS, or _ZIPFILE */
u8 doXdgOpen; /* Invoke start/open/xdg-open in output_reset() */
u8 nEqpLevel; /* Depth of the EQP output graph */
}
/*
-** Initialize a newly allocate Mode object to reasonable
-** defaults.
+** Set the mode to the default according to p->iCompat. It assumed
+** that the mode has already been freed and zeroed prior to calling
+** this routine.
*/
-static void modeInit(Mode *p){
- memset(p, 0, sizeof(*p));
- p->spec.iVersion = 1;
- p->autoExplain = 1;
- p->eMode = MODE_List;
-#ifdef _WIN32
- p->crlfMode = 1;
-#endif
- p->spec.zColumnSep = strdup("|");
- p->spec.zRowSep = strdup("\n");
- p->spec.zNull = strdup("");
+static void modeDefault(ShellState *p){
+ p->mode.spec.iVersion = 1;
+ p->mode.autoExplain = 1;
+ if( p->iCompat>=20251115 ){
+ modeChange(p, MODE_QBox);
+ p->mode.bAutoScreenWidth = 1;
+ p->mode.spec.nCharLimit = 300;
+ p->mode.spec.nLineLimit = 5;
+ }else{
+ modeChange(p, MODE_List);
+ }
}
/*
modeSetStr(&p->mode.spec.zTableName, azArg[i]);
}
chng = 1;
+ }else if( z[0]=='2' && strlen(z)==8 && atoi(z)>20000101 ){
+ modeFree(&p->mode);
+ p->iCompat = atoi(z);
+ memset(&p->mode, 0, sizeof(p->mode));
+ modeDefault(p);
+ chng = 1;
}else if( optionMatch(z,"align") ){
char *zAlign;
int nAlign;
" -bail stop after hitting an error\n"
" -batch force batch I/O\n"
" -box set output mode to 'box'\n"
- " -column set output mode to 'column'\n"
" -cmd COMMAND run \"COMMAND\" before reading stdin\n"
+ " -column set output mode to 'column'\n"
+ " -compat YYYYMMDD set default options for date YYYYMMDD\n"
" -csv set output mode to 'csv'\n"
#if !defined(SQLITE_OMIT_DESERIALIZE)
" -deserialize open the database using sqlite3_deserialize()\n"
*/
static void main_init(ShellState *p) {
memset(p, 0, sizeof(*p));
- modeInit(&p->mode);
+#if defined(COMPATIBILITY_DATE)
+ p->iCompat = COMPATIBILITY_DATE;
+#else
+ p->iCompat = 20251116;
+#endif
+ modeDefault(p);
p->pAuxDb = &p->aAuxDb[0];
p->shellFlgs = SHFLG_Lookaside;
sqlite3_config(SQLITE_CONFIG_LOG, shellLog, p);
** we do the actual processing of arguments later in a second pass.
*/
stdin_is_interactive = 0;
+ }else if( cli_strcmp(z,"-compat")==0 ){
+ data.iCompat = atoi(cmdline_option_value(argc, argv, ++i));
+ modeFree(&data.mode);
+ memset(&data.mode, 0, sizeof(data.mode));
+ modeDefault(&data);
}else if( cli_strcmp(z,"-utf8")==0 ){
}else if( cli_strcmp(z,"-no-utf8")==0 ){
}else if( cli_strcmp(z,"-no-rowid-in-view")==0 ){
stdin_is_interactive = 1;
}else if( cli_strcmp(z,"-batch")==0 ){
/* already handled */
+ }else if( cli_strcmp(z,"-compat")==0 ){
+ i++;
}else if( cli_strcmp(z,"-utf8")==0 ){
/* already handled */
}else if( cli_strcmp(z,"-no-utf8")==0 ){