| | @@ -3836,11 +3836,11 @@ |
| 3836 | 3836 | |
| 3837 | 3837 | /* Return the current wall-clock time in microseconds since the |
| 3838 | 3838 | ** Unix epoch (1970-01-01T00:00:00Z) |
| 3839 | 3839 | */ |
| 3840 | 3840 | static sqlite3_int64 timeOfDay(void){ |
| 3841 | | -#if defined(_WIN64) |
| 3841 | +#if defined(_WIN64) && _WIN32_WINNT >= _WIN32_WINNT_WIN8 |
| 3842 | 3842 | sqlite3_uint64 t; |
| 3843 | 3843 | FILETIME tm; |
| 3844 | 3844 | GetSystemTimePreciseAsFileTime(&tm); |
| 3845 | 3845 | t = ((u64)tm.dwHighDateTime<<32) | (u64)tm.dwLowDateTime; |
| 3846 | 3846 | t += 116444736000000000LL; |
| | @@ -13566,11 +13566,11 @@ |
| 13566 | 13566 | rc = zipfileReadData( |
| 13567 | 13567 | pFile, aRead, nExtra+nFile, iOff+ZIPFILE_CDS_FIXED_SZ, pzErr |
| 13568 | 13568 | ); |
| 13569 | 13569 | }else{ |
| 13570 | 13570 | aRead = (u8*)&aBlob[iOff + ZIPFILE_CDS_FIXED_SZ]; |
| 13571 | | - if( (iOff + ZIPFILE_LFH_FIXED_SZ + nFile + nExtra)>nBlob ){ |
| 13571 | + if( (iOff + ZIPFILE_CDS_FIXED_SZ + nFile + nExtra)>nBlob ){ |
| 13572 | 13572 | rc = zipfileCorrupt(pzErr); |
| 13573 | 13573 | } |
| 13574 | 13574 | } |
| 13575 | 13575 | } |
| 13576 | 13576 | |
| | @@ -24178,18 +24178,19 @@ |
| 24178 | 24178 | u8 autoExplain; /* Automatically turn on .explain mode */ |
| 24179 | 24179 | u8 autoEQP; /* Run EXPLAIN QUERY PLAN prior to each SQL stmt */ |
| 24180 | 24180 | u8 autoEQPtrace; /* autoEQP is in trace mode */ |
| 24181 | 24181 | u8 scanstatsOn; /* True to display scan stats before each finalize */ |
| 24182 | 24182 | u8 bAutoScreenWidth; /* Using the TTY to determine screen width */ |
| 24183 | | - u8 mFlags; /* MFLG_ECHO and/or MFLG_CRLF */ |
| 24183 | + u8 mFlags; /* MFLG_ECHO, MFLG_CRLF, etc. */ |
| 24184 | 24184 | u8 eMode; /* One of the MODE_ values */ |
| 24185 | 24185 | sqlite3_qrf_spec spec; /* Spec to be passed into QRF */ |
| 24186 | 24186 | } Mode; |
| 24187 | 24187 | |
| 24188 | 24188 | /* Flags for Mode.mFlags */ |
| 24189 | 24189 | #define MFLG_ECHO 0x01 /* Echo inputs to output */ |
| 24190 | 24190 | #define MFLG_CRLF 0x02 /* Use CR/LF output line endings */ |
| 24191 | +#define MFLG_HDR 0x04 /* .header used to change headers on/off */ |
| 24191 | 24192 | |
| 24192 | 24193 | |
| 24193 | 24194 | /* |
| 24194 | 24195 | ** State information about the database connection is contained in an |
| 24195 | 24196 | ** instance of the following structure. |
| | @@ -24550,11 +24551,13 @@ |
| 24550 | 24551 | if( pI->eCSep ) modeSetStr(&pM->spec.zColumnSep, aModeStr[pI->eCSep]); |
| 24551 | 24552 | if( pI->eRSep ) modeSetStr(&pM->spec.zRowSep, aModeStr[pI->eRSep]); |
| 24552 | 24553 | if( pI->eNull ) modeSetStr(&pM->spec.zNull, aModeStr[pI->eNull]); |
| 24553 | 24554 | pM->spec.eText = pI->eText; |
| 24554 | 24555 | pM->spec.eBlob = pI->eBlob; |
| 24555 | | - pM->spec.bTitles = pI->bHdr; |
| 24556 | + if( (pM->mFlags & MFLG_HDR)==0 ){ |
| 24557 | + pM->spec.bTitles = pI->bHdr; |
| 24558 | + } |
| 24556 | 24559 | pM->spec.eTitle = pI->eHdr; |
| 24557 | 24560 | if( pI->mFlg & 0x01 ){ |
| 24558 | 24561 | pM->spec.bBorder = QRF_No; |
| 24559 | 24562 | }else{ |
| 24560 | 24563 | pM->spec.bBorder = QRF_Auto; |
| | @@ -31286,10 +31289,11 @@ |
| 31286 | 31289 | if( k<0 ){ |
| 31287 | 31290 | dotCmdError(p, i, "bad --titles value","%z", zErr); |
| 31288 | 31291 | return 1; |
| 31289 | 31292 | } |
| 31290 | 31293 | p->mode.spec.bTitles = k>=1 ? QRF_Yes : QRF_No; |
| 31294 | + p->mode.mFlags &= ~MFLG_HDR; |
| 31291 | 31295 | p->mode.spec.eTitle = k>1 ? k-1 : aModeInfo[p->mode.eMode].eHdr; |
| 31292 | 31296 | chng = 1; |
| 31293 | 31297 | }else if( optionMatch(z,"widths") || optionMatch(z,"width") ){ |
| 31294 | 31298 | int nWidth = 0; |
| 31295 | 31299 | short int *aWidth; |
| | @@ -32759,10 +32763,11 @@ |
| 32759 | 32763 | }else |
| 32760 | 32764 | |
| 32761 | 32765 | if( c=='h' && cli_strncmp(azArg[0], "headers", n)==0 ){ |
| 32762 | 32766 | if( nArg==2 ){ |
| 32763 | 32767 | p->mode.spec.bTitles = booleanValue(azArg[1]) ? QRF_Yes : QRF_No; |
| 32768 | + p->mode.mFlags |= MFLG_HDR; |
| 32764 | 32769 | p->mode.spec.eTitle = aModeInfo[p->mode.eMode].eHdr; |
| 32765 | 32770 | }else{ |
| 32766 | 32771 | eputz("Usage: .headers on|off\n"); |
| 32767 | 32772 | rc = 1; |
| 32768 | 32773 | } |
| 32769 | 32774 | |