mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Improved response to error conditions in the ".session" shell command and
in the "changeset" command-line program. FossilOrigin-Name: b69f7dd1f35846c3bb9f4f160d50c4f03796f887
This commit is contained in:
@ -232,8 +232,10 @@ int main(int argc, char **argv){
|
||||
exit(1);
|
||||
}
|
||||
readFile(argv[3], &szB, &pB);
|
||||
sqlite3changeset_concat(sz, pBuf, szB, pB, &szOut, &pOutBuf);
|
||||
if( fwrite(pOutBuf, szOut, 1, out)!=1 ){
|
||||
rc = sqlite3changeset_concat(sz, pBuf, szB, pB, &szOut, &pOutBuf);
|
||||
if( rc!=SQLITE_OK ){
|
||||
fprintf(stderr, "sqlite3changeset_concat() returns %d\n", rc);
|
||||
}else if( szOut>0 && fwrite(pOutBuf, szOut, 1, out)!=1 ){
|
||||
fprintf(stderr, "unable to write all %d bytes of output to \"%s\"\n",
|
||||
szOut, zOut);
|
||||
}
|
||||
@ -300,8 +302,10 @@ int main(int argc, char **argv){
|
||||
fprintf(stderr, "cannot open \"%s\" for writing\n", zOut);
|
||||
exit(1);
|
||||
}
|
||||
sqlite3changeset_invert(sz, pBuf, &szOut, &pOutBuf);
|
||||
if( fwrite(pOutBuf, szOut, 1, out)!=1 ){
|
||||
rc = sqlite3changeset_invert(sz, pBuf, &szOut, &pOutBuf);
|
||||
if( rc!=SQLITE_OK ){
|
||||
fprintf(stderr, "sqlite3changeset_invert() returns %d\n", rc);
|
||||
}else if( szOut>0 && fwrite(pOutBuf, szOut, 1, out)!=1 ){
|
||||
fprintf(stderr, "unable to write all %d bytes of output to \"%s\"\n",
|
||||
szOut, zOut);
|
||||
}
|
||||
|
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
||||
C Fix\sthe\sautoconf\sand\sMSVC\smakefiles\sso\sthat\sthey\sconstruct\sthe\schangeset\ncommand-line\sutility\supon\srequest.\s\sDelete\sthat\sutility\sprogram\swhen\n"make\sclean"\sis\srun.
|
||||
D 2014-08-18T20:23:29.435
|
||||
C Improved\sresponse\sto\serror\sconditions\sin\sthe\s".session"\sshell\scommand\sand\nin\sthe\s"changeset"\scommand-line\sprogram.
|
||||
D 2014-08-19T00:26:17.830
|
||||
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
|
||||
F Makefile.in d5ad373b7a23525414b8843b3084cf90c560d92f
|
||||
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
|
||||
@ -143,7 +143,7 @@ F ext/rtree/rtree_util.tcl 06aab2ed5b826545bf215fff90ecb9255a8647ea
|
||||
F ext/rtree/sqlite3rtree.h 83349d519fe5f518b3ea025d18dd1fe51b1684bd
|
||||
F ext/rtree/tkt3363.test 142ab96eded44a3615ec79fba98c7bde7d0f96de
|
||||
F ext/rtree/viewrtree.tcl eea6224b3553599ae665b239bd827e182b466024
|
||||
F ext/session/changeset.c 9be709cea346d65c6d0cc8bf03569956af125462
|
||||
F ext/session/changeset.c 4ccbaa4531944c24584bf6a61ba3a39c62b6267a
|
||||
F ext/session/session1.test 3733d71eb9a99b14d51fa5219d5b8a82407c3be8
|
||||
F ext/session/session2.test 99ca0da7ddb617d42bafd83adccf99f18ae0384b
|
||||
F ext/session/session3.test a7a9ce59b8d1e49e2cc23d81421ac485be0eea01
|
||||
@ -239,7 +239,7 @@ F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
|
||||
F src/resolve.c 0ea356d32a5e884add23d1b9b4e8736681dd5697
|
||||
F src/rowset.c a9c9aae3234b44a6d7c6f5a3cadf90dce1e627be
|
||||
F src/select.c ea48e891406ccdf748f3eb02893e056d134a0fea
|
||||
F src/shell.c 1761e117dd58e2383a2d30319c49d0fca00f8bf0
|
||||
F src/shell.c 220564b70a2115e2157688f8faa6bb751ffe019a
|
||||
F src/sqlite.h.in 021a1f5c50e83060675d994a6014fd409e611d9e
|
||||
F src/sqlite3.rc 992c9f5fb8285ae285d6be28240a7e8d3a7f2bad
|
||||
F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc
|
||||
@ -1203,7 +1203,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 1324d08d0c639378cf1b03bd6410db81947747ac
|
||||
R fdaf7ebc782210d979a62294e31e9051
|
||||
P 4dc15fe066f079ff31c89a5e0242dd5b3c851d29
|
||||
R d85ccd3884f4a5cc5341a67dd8277838
|
||||
U drh
|
||||
Z e19e0e50f2717082ee6e33a1c9b88ce5
|
||||
Z edfba13e974f0e2f2be5cef97fba91ac
|
||||
|
@ -1 +1 @@
|
||||
4dc15fe066f079ff31c89a5e0242dd5b3c851d29
|
||||
b69f7dd1f35846c3bb9f4f160d50c4f03796f887
|
@ -3232,9 +3232,13 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
int szChng;
|
||||
void *pChng;
|
||||
if( azCmd[0][0]=='c' ){
|
||||
sqlite3session_changeset(pSession->p, &szChng, &pChng);
|
||||
rc = sqlite3session_changeset(pSession->p, &szChng, &pChng);
|
||||
}else{
|
||||
sqlite3session_patchset(pSession->p, &szChng, &pChng);
|
||||
rc = sqlite3session_patchset(pSession->p, &szChng, &pChng);
|
||||
}
|
||||
if( rc ){
|
||||
printf("Error: error code %d\n", rc);
|
||||
rc = 0;
|
||||
}
|
||||
if( pChng
|
||||
&& fwrite(pChng, szChng, 1, out)!=1 ){
|
||||
|
Reference in New Issue
Block a user