-C Allow\sexpressions\swith\ssubtypes\sto\sbe\sread\sfrom\sindexes\sunless\sthey\sare\nbeing\sused\sas\sdirect\sor\sindirect\sparameters\sto\sSQLITE_SUBTYPE\sfunctions.
-D 2024-10-08T10:10:42.057
+C Fix\sthe\s.crnl\scommand\sin\sthe\sshell\sso\sthat\sit\sdoes\snot\sget\sundone\sby\ncalls\sto\sprint\sa\squoted\sstring\sor\sCSV\soutput.
+D 2024-10-08T14:07:28.260
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
-F src/shell.c.in 981efe98f98a983c1d0193d18528eb2d765207c0c82b67b610be60f17995a43e
+F src/shell.c.in 188b1fe5e403e8e0638e0aa1151a95d47e841ddaf0545973cae09e4a6cef4d98
F src/sqlite.h.in 1def838497ad53c81486649ce79821925d1ac20a9843af317a344d507efe116e
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 011fab70cb3d194b27742ebb236b05be582230567cf78e3e6cac6911de86922f f150c3c5b898975b1f83d61fa589753449a48f8a0007e8e167dbd702528197c5
-R 4f5fad7a5b3f0800af84dc5d2cb9639f
-T +closed f150c3c5b898975b1f83d61fa589753449a48f8a0007e8e167dbd702528197c5
+P 39a56a23fec24dd713905457b6d4ed7c148f88e325a26c376f1e6daf147c69c8
+R f65d905956fc73a7bb20b3c2e0376b8f
U drh
-Z d4cafc45e7a2f93bf4c10b241262518d
+Z b2ad2cadf0ade220cb843ebb395ae876
# Remove this line to create a well-formed Fossil manifest.
u8 bSafeMode; /* True to prohibit unsafe operations */
u8 bSafeModePersist; /* The long-term value of bSafeMode */
u8 eRestoreState; /* See comments above doAutoDetectRestore() */
+ u8 crnlMode; /* Do NL-to-CRLF translations when enabled (maybe) */
ColModeOpts cmOpts; /* Option values affecting columnar mode output */
unsigned statsOn; /* True to display memory stats before each finalize */
unsigned mEqpLines; /* Mask of vertical lines in the EQP output graph */
memcpy(p->rowSeparator, p->rowSepPrior, sizeof(p->rowSeparator));
}
+/*
+** Set output mode to text or binary for Windows.
+*/
+static void setCrnlMode(ShellState *p){
+#ifdef _WIN32
+ if( p->crnlMode ){
+ sqlite3_fsetmode(p->out, _O_TEXT);
+ }else{
+ sqlite3_fsetmode(p->out, _O_BINARY);
+ }
+#endif
+}
+
/*
** Output the given string as a hex-encoded blob (eg. X'1234' )
*/
**
** See also: output_quoted_escaped_string()
*/
-static void output_quoted_string(FILE *out, const char *z){
+static void output_quoted_string(ShellState *p, const char *z){
int i;
char c;
+ FILE *out = p->out;
sqlite3_fsetmode(out, _O_BINARY);
if( z==0 ) return;
for(i=0; (c = z[i])!=0 && c!='\''; i++){}
}
sqlite3_fputs("'", out);
}
- sqlite3_fsetmode(out, _O_TEXT);
+ setCrnlMode(p);
}
/*
** This is like output_quoted_string() but with the addition of the \r\n
** escape mechanism.
*/
-static void output_quoted_escaped_string(FILE *out, const char *z){
+static void output_quoted_escaped_string(ShellState *p, const char *z){
int i;
char c;
+ FILE *out = p->out;
sqlite3_fsetmode(out, _O_BINARY);
for(i=0; (c = z[i])!=0 && c!='\'' && c!='\n' && c!='\r'; i++){}
if( c==0 ){
sqlite3_fprintf(out, ",'%s',char(10))", zNL);
}
}
- sqlite3_fsetmode(stdout, _O_TEXT);
+ setCrnlMode(p);
}
/*
}
sqlite3_fputs(p->rowSeparator, p->out);
}
- sqlite3_fsetmode(p->out, _O_TEXT);
+ setCrnlMode(p);
break;
}
case MODE_Insert: {
sqlite3_fputs("NULL", p->out);
}else if( aiType && aiType[i]==SQLITE_TEXT ){
if( ShellHasFlag(p, SHFLG_Newlines) ){
- output_quoted_string(p->out, azArg[i]);
+ output_quoted_string(p, azArg[i]);
}else{
- output_quoted_escaped_string(p->out, azArg[i]);
+ output_quoted_escaped_string(p, azArg[i]);
}
}else if( aiType && aiType[i]==SQLITE_INTEGER ){
sqlite3_fputs(azArg[i], p->out);
}else if( isNumber(azArg[i], 0) ){
sqlite3_fputs(azArg[i], p->out);
}else if( ShellHasFlag(p, SHFLG_Newlines) ){
- output_quoted_string(p->out, azArg[i]);
+ output_quoted_string(p, azArg[i]);
}else{
- output_quoted_escaped_string(p->out, azArg[i]);
+ output_quoted_escaped_string(p, azArg[i]);
}
}
sqlite3_fputs(");\n", p->out);
if( p->cnt==0 && p->showHeader ){
for(i=0; i<nArg; i++){
if( i>0 ) sqlite3_fputs(p->colSeparator, p->out);
- output_quoted_string(p->out, azCol[i]);
+ output_quoted_string(p, azCol[i]);
}
sqlite3_fputs(p->rowSeparator, p->out);
}
if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){
sqlite3_fputs("NULL", p->out);
}else if( aiType && aiType[i]==SQLITE_TEXT ){
- output_quoted_string(p->out, azArg[i]);
+ output_quoted_string(p, azArg[i]);
}else if( aiType && aiType[i]==SQLITE_INTEGER ){
sqlite3_fputs(azArg[i], p->out);
}else if( aiType && aiType[i]==SQLITE_FLOAT ){
}else if( isNumber(azArg[i], 0) ){
sqlite3_fputs(azArg[i], p->out);
}else{
- output_quoted_string(p->out, azArg[i]);
+ output_quoted_string(p, azArg[i]);
}
}
sqlite3_fputs(p->rowSeparator, p->out);
/* Undocumented. Legacy only. See "crnl" below */
if( c=='b' && n>=3 && cli_strncmp(azArg[0], "binary", n)==0 ){
- eputz("The \".binary\" command is deprecated. Use \".crnl\" instead.\n");
+ eputz("The \".binary\" command is deprecated.\n");
rc = 1;
}else
sqlite3_fputs("The \".crnl\" command is disable in this build.\n", p->out);
#else
if( nArg==2 ){
- if( booleanValue(azArg[1]) ){
- sqlite3_fsetmode(p->out, _O_TEXT);
- }else{
- sqlite3_fsetmode(p->out, _O_BINARY);
- }
+ p->crnlMode = booleanValue(azArg[1]);
+ setCrnlMode(p);
}else{
eputz("Usage: .crnl on|off\n");
rc = 1;