Fossil SCM

Ignore unfinalized statements when shutting down the SQLite command-line shell. Ticket [891cd78969e03ec3009].

drh 2010-12-08 03:31 trunk
Commit 31f5b295fafdd3a50f4a87d92a5469fadd072a3e
1 file changed +6 -6
+6 -6
--- src/shell.c
+++ src/shell.c
@@ -36,14 +36,18 @@
3636
3737
#ifdef __OS2__
3838
# include <unistd.h>
3939
#endif
4040
41
+#ifdef HAVE_EDITLINE
42
+# include <editline/editline.h>
43
+#endif
4144
#if defined(HAVE_READLINE) && HAVE_READLINE==1
4245
# include <readline/readline.h>
4346
# include <readline/history.h>
44
-#else
47
+#endif
48
+#if !defined(HAVE_EDITLINE) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1)
4549
# define readline(p) local_getline(p,stdin)
4650
# define add_history(X)
4751
# define read_history(X)
4852
# define write_history(X)
4953
# define stifle_history(X)
@@ -2727,13 +2731,9 @@
27272731
rc = process_input(&data, stdin);
27282732
}
27292733
}
27302734
set_table_name(&data, 0);
27312735
if( data.db ){
2732
- if( sqlite3_close(data.db)!=SQLITE_OK ){
2733
- fprintf(stderr,"Error: cannot close database \"%s\"\n",
2734
- sqlite3_errmsg(db));
2735
- rc++;
2736
- }
2736
+ sqlite3_close(data.db);
27372737
}
27382738
return rc;
27392739
}
27402740
--- src/shell.c
+++ src/shell.c
@@ -36,14 +36,18 @@
36
37 #ifdef __OS2__
38 # include <unistd.h>
39 #endif
40
 
 
 
41 #if defined(HAVE_READLINE) && HAVE_READLINE==1
42 # include <readline/readline.h>
43 # include <readline/history.h>
44 #else
 
45 # define readline(p) local_getline(p,stdin)
46 # define add_history(X)
47 # define read_history(X)
48 # define write_history(X)
49 # define stifle_history(X)
@@ -2727,13 +2731,9 @@
2727 rc = process_input(&data, stdin);
2728 }
2729 }
2730 set_table_name(&data, 0);
2731 if( data.db ){
2732 if( sqlite3_close(data.db)!=SQLITE_OK ){
2733 fprintf(stderr,"Error: cannot close database \"%s\"\n",
2734 sqlite3_errmsg(db));
2735 rc++;
2736 }
2737 }
2738 return rc;
2739 }
2740
--- src/shell.c
+++ src/shell.c
@@ -36,14 +36,18 @@
36
37 #ifdef __OS2__
38 # include <unistd.h>
39 #endif
40
41 #ifdef HAVE_EDITLINE
42 # include <editline/editline.h>
43 #endif
44 #if defined(HAVE_READLINE) && HAVE_READLINE==1
45 # include <readline/readline.h>
46 # include <readline/history.h>
47 #endif
48 #if !defined(HAVE_EDITLINE) && (!defined(HAVE_READLINE) || HAVE_READLINE!=1)
49 # define readline(p) local_getline(p,stdin)
50 # define add_history(X)
51 # define read_history(X)
52 # define write_history(X)
53 # define stifle_history(X)
@@ -2727,13 +2731,9 @@
2731 rc = process_input(&data, stdin);
2732 }
2733 }
2734 set_table_name(&data, 0);
2735 if( data.db ){
2736 sqlite3_close(data.db);
 
 
 
 
2737 }
2738 return rc;
2739 }
2740

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button