Fossil SCM

Rename sqlite3_cmd() to cmd_sqlite3() and sqlite3_exec_readonly() to db_exec_readonly(): sqlite3_* symbols are reserved for SQLite, in order to prevent possible future symbol conflicts. Eliminate use of deprecated "sqlite3_callback" typedef (which allows elimination of some type casts). Missing "static" in content.c

jan.nijtmans 2014-01-28 09:25 trunk
Commit 0ed6e68d5577abc12fb7087b5d890b1ef45a1025
3 files changed +2 -2 +22 -20 +1 -1
+2 -2
--- src/content.c
+++ src/content.c
@@ -945,12 +945,12 @@
945945
}
946946
db_finalize(&q);
947947
fossil_print("%d non-phantom blobs (out of %d total) checked: %d errors\n",
948948
n2, n1, nErr);
949949
if( bParse ){
950
- const char *const azType[] = { 0, "manifest", "cluster", "control",
951
- "wiki", "ticket", "attachment", "event" };
950
+ static const char *const azType[] = { 0, "manifest", "cluster",
951
+ "control", "wiki", "ticket", "attachment", "event" };
952952
int i;
953953
fossil_print("%d total control artifacts\n", nCA);
954954
for(i=1; i<count(azType); i++){
955955
if( anCA[i] ) fossil_print(" %d %ss\n", anCA[i], azType[i]);
956956
}
957957
--- src/content.c
+++ src/content.c
@@ -945,12 +945,12 @@
945 }
946 db_finalize(&q);
947 fossil_print("%d non-phantom blobs (out of %d total) checked: %d errors\n",
948 n2, n1, nErr);
949 if( bParse ){
950 const char *const azType[] = { 0, "manifest", "cluster", "control",
951 "wiki", "ticket", "attachment", "event" };
952 int i;
953 fossil_print("%d total control artifacts\n", nCA);
954 for(i=1; i<count(azType); i++){
955 if( anCA[i] ) fossil_print(" %d %ss\n", anCA[i], azType[i]);
956 }
957
--- src/content.c
+++ src/content.c
@@ -945,12 +945,12 @@
945 }
946 db_finalize(&q);
947 fossil_print("%d non-phantom blobs (out of %d total) checked: %d errors\n",
948 n2, n1, nErr);
949 if( bParse ){
950 static const char *const azType[] = { 0, "manifest", "cluster",
951 "control", "wiki", "ticket", "attachment", "event" };
952 int i;
953 fossil_print("%d total control artifacts\n", nCA);
954 for(i=1; i<count(azType); i++){
955 if( anCA[i] ) fossil_print(" %d %ss\n", anCA[i], azType[i]);
956 }
957
+22 -20
--- src/report.c
+++ src/report.c
@@ -650,17 +650,17 @@
650650
** The callback function for db_query
651651
*/
652652
static int generate_html(
653653
void *pUser, /* Pointer to output state */
654654
int nArg, /* Number of columns in this result row */
655
- char **azArg, /* Text of data in all columns */
656
- char **azName /* Names of the columns */
655
+ const char **azArg, /* Text of data in all columns */
656
+ const char **azName /* Names of the columns */
657657
){
658658
struct GenerateHTML *pState = (struct GenerateHTML*)pUser;
659659
int i;
660660
const char *zTid; /* Ticket UUID. (value of column named '#') */
661
- char *zBg = 0; /* Use this background color */
661
+ const char *zBg = 0; /* Use this background color */
662662
663663
/* Do initialization
664664
*/
665665
if( pState->nCount==0 ){
666666
/* Turn off the authorizer. It is no longer doing anything since the
@@ -710,11 +710,11 @@
710710
/* The first time this routine is called, output a table header
711711
*/
712712
@ <thead><tr>
713713
zTid = 0;
714714
for(i=0; i<nArg; i++){
715
- char *zName = azName[i];
715
+ const char *zName = azName[i];
716716
if( i==pState->iBg ) continue;
717717
if( pState->iNewRow>=0 && i>=pState->iNewRow ){
718718
if( g.perm.Write && zTid ){
719719
@ <th>&nbsp;</th>
720720
zTid = 0;
@@ -753,11 +753,11 @@
753753
zBg = pState->iBg>=0 ? azArg[pState->iBg] : 0;
754754
if( zBg==0 ) zBg = "white";
755755
@ <tr style="background-color:%h(zBg)">
756756
zTid = 0;
757757
for(i=0; i<nArg; i++){
758
- char *zData;
758
+ const char *zData;
759759
if( i==pState->iBg ) continue;
760760
zData = azArg[i];
761761
if( zData==0 ) zData = "";
762762
if( pState->iNewRow>=0 && i>=pState->iNewRow ){
763763
if( zTid && g.perm.Write ){
@@ -815,12 +815,12 @@
815815
** Output a row as a tab-separated line of text.
816816
*/
817817
static int output_tab_separated(
818818
void *pUser, /* Pointer to row-count integer */
819819
int nArg, /* Number of columns in this result row */
820
- char **azArg, /* Text of data in all columns */
821
- char **azName /* Names of the columns */
820
+ const char **azArg, /* Text of data in all columns */
821
+ const char **azName /* Names of the columns */
822822
){
823823
int *pCount = (int*)pUser;
824824
int i;
825825
826826
if( *pCount==0 ){
@@ -840,18 +840,19 @@
840840
/*
841841
** Generate HTML that describes a color key.
842842
*/
843843
void output_color_key(const char *zClrKey, int horiz, char *zTabArgs){
844844
int i, j, k;
845
- char *zSafeKey, *zToFree;
845
+ const char *zSafeKey;
846
+ char *zToFree;
846847
while( fossil_isspace(*zClrKey) ) zClrKey++;
847848
if( zClrKey[0]==0 ) return;
848849
@ <table %s(zTabArgs)>
849850
if( horiz ){
850851
@ <tr>
851852
}
852
- zToFree = zSafeKey = mprintf("%h", zClrKey);
853
+ zSafeKey = zToFree = mprintf("%h", zClrKey);
853854
while( zSafeKey[0] ){
854855
while( fossil_isspace(*zSafeKey) ) zSafeKey++;
855856
for(i=0; zSafeKey[i] && !fossil_isspace(zSafeKey[i]); i++){}
856857
for(j=i; fossil_isspace(zSafeKey[j]); j++){}
857858
for(k=j; zSafeKey[k] && zSafeKey[k]!='\n' && zSafeKey[k]!='\r'; k++){}
@@ -873,23 +874,24 @@
873874
874875
/*
875876
** Execute a single read-only SQL statement. Invoke xCallback() on each
876877
** row.
877878
*/
878
-int sqlite3_exec_readonly(
879
+static int db_exec_readonly(
879880
sqlite3 *db, /* The database on which the SQL executes */
880881
const char *zSql, /* The SQL to be executed */
881
- sqlite3_callback xCallback, /* Invoke this callback routine */
882
+ int (*xCallback)(void*,int,const char**, const char**),
883
+ /* Invoke this callback routine */
882884
void *pArg, /* First argument to xCallback() */
883885
char **pzErrMsg /* Write error messages here */
884886
){
885887
int rc = SQLITE_OK; /* Return code */
886888
const char *zLeftover; /* Tail of unprocessed SQL */
887889
sqlite3_stmt *pStmt = 0; /* The current SQL statement */
888
- char **azCols = 0; /* Names of result columns */
890
+ const char **azCols = 0; /* Names of result columns */
889891
int nCol; /* Number of columns of output */
890
- char **azVals = 0; /* Text of all output columns */
892
+ const char **azVals = 0; /* Text of all output columns */
891893
int i; /* Loop counter */
892894
893895
pStmt = 0;
894896
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
895897
assert( rc==SQLITE_OK || pStmt==0 );
@@ -912,15 +914,15 @@
912914
azVals = fossil_malloc(2*nCol*sizeof(const char*) + 1);
913915
while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){
914916
if( azCols==0 ){
915917
azCols = &azVals[nCol];
916918
for(i=0; i<nCol; i++){
917
- azCols[i] = (char *)sqlite3_column_name(pStmt, i);
919
+ azCols[i] = sqlite3_column_name(pStmt, i);
918920
}
919921
}
920922
for(i=0; i<nCol; i++){
921
- azVals[i] = (char *)sqlite3_column_text(pStmt, i);
923
+ azVals[i] = (const char *)sqlite3_column_text(pStmt, i);
922924
}
923925
if( xCallback(pArg, nCol, azVals, azCols) ){
924926
break;
925927
}
926928
}
@@ -1086,11 +1088,11 @@
10861088
@ <table border="1" cellpadding="2" cellspacing="0" class="report"
10871089
@ id="reportTable">
10881090
sState.rn = rn;
10891091
sState.nCount = 0;
10901092
report_restrict_sql(&zErr1);
1091
- sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2);
1093
+ db_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2);
10921094
report_unrestrict_sql();
10931095
@ </tbody></table>
10941096
if( zErr1 ){
10951097
@ <p class="reportError">Error: %h(zErr1)</p>
10961098
}else if( zErr2 ){
@@ -1098,11 +1100,11 @@
10981100
}
10991101
output_table_sorting_javascript("reportTable","");
11001102
style_footer();
11011103
}else{
11021104
report_restrict_sql(&zErr1);
1103
- sqlite3_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2);
1105
+ db_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2);
11041106
report_unrestrict_sql();
11051107
cgi_set_content_type("text/plain");
11061108
}
11071109
}
11081110
@@ -1187,12 +1189,12 @@
11871189
** Output a row as a tab-separated line of text.
11881190
*/
11891191
int output_separated_file(
11901192
void *pUser, /* Pointer to row-count integer */
11911193
int nArg, /* Number of columns in this result row */
1192
- char **azArg, /* Text of data in all columns */
1193
- char **azName /* Names of the columns */
1194
+ const char **azArg, /* Text of data in all columns */
1195
+ const char **azName /* Names of the columns */
11941196
){
11951197
int *pCount = (int*)pUser;
11961198
int i;
11971199
11981200
if( *pCount==0 ){
@@ -1251,11 +1253,11 @@
12511253
}
12521254
count = 0;
12531255
tktEncode = enc;
12541256
zSep = zSepIn;
12551257
report_restrict_sql(&zErr1);
1256
- sqlite3_exec_readonly(g.db, zSql, output_separated_file, &count, &zErr2);
1258
+ db_exec_readonly(g.db, zSql, output_separated_file, &count, &zErr2);
12571259
report_unrestrict_sql();
12581260
if( zFilter ){
12591261
free(zSql);
12601262
}
12611263
}
12621264
--- src/report.c
+++ src/report.c
@@ -650,17 +650,17 @@
650 ** The callback function for db_query
651 */
652 static int generate_html(
653 void *pUser, /* Pointer to output state */
654 int nArg, /* Number of columns in this result row */
655 char **azArg, /* Text of data in all columns */
656 char **azName /* Names of the columns */
657 ){
658 struct GenerateHTML *pState = (struct GenerateHTML*)pUser;
659 int i;
660 const char *zTid; /* Ticket UUID. (value of column named '#') */
661 char *zBg = 0; /* Use this background color */
662
663 /* Do initialization
664 */
665 if( pState->nCount==0 ){
666 /* Turn off the authorizer. It is no longer doing anything since the
@@ -710,11 +710,11 @@
710 /* The first time this routine is called, output a table header
711 */
712 @ <thead><tr>
713 zTid = 0;
714 for(i=0; i<nArg; i++){
715 char *zName = azName[i];
716 if( i==pState->iBg ) continue;
717 if( pState->iNewRow>=0 && i>=pState->iNewRow ){
718 if( g.perm.Write && zTid ){
719 @ <th>&nbsp;</th>
720 zTid = 0;
@@ -753,11 +753,11 @@
753 zBg = pState->iBg>=0 ? azArg[pState->iBg] : 0;
754 if( zBg==0 ) zBg = "white";
755 @ <tr style="background-color:%h(zBg)">
756 zTid = 0;
757 for(i=0; i<nArg; i++){
758 char *zData;
759 if( i==pState->iBg ) continue;
760 zData = azArg[i];
761 if( zData==0 ) zData = "";
762 if( pState->iNewRow>=0 && i>=pState->iNewRow ){
763 if( zTid && g.perm.Write ){
@@ -815,12 +815,12 @@
815 ** Output a row as a tab-separated line of text.
816 */
817 static int output_tab_separated(
818 void *pUser, /* Pointer to row-count integer */
819 int nArg, /* Number of columns in this result row */
820 char **azArg, /* Text of data in all columns */
821 char **azName /* Names of the columns */
822 ){
823 int *pCount = (int*)pUser;
824 int i;
825
826 if( *pCount==0 ){
@@ -840,18 +840,19 @@
840 /*
841 ** Generate HTML that describes a color key.
842 */
843 void output_color_key(const char *zClrKey, int horiz, char *zTabArgs){
844 int i, j, k;
845 char *zSafeKey, *zToFree;
 
846 while( fossil_isspace(*zClrKey) ) zClrKey++;
847 if( zClrKey[0]==0 ) return;
848 @ <table %s(zTabArgs)>
849 if( horiz ){
850 @ <tr>
851 }
852 zToFree = zSafeKey = mprintf("%h", zClrKey);
853 while( zSafeKey[0] ){
854 while( fossil_isspace(*zSafeKey) ) zSafeKey++;
855 for(i=0; zSafeKey[i] && !fossil_isspace(zSafeKey[i]); i++){}
856 for(j=i; fossil_isspace(zSafeKey[j]); j++){}
857 for(k=j; zSafeKey[k] && zSafeKey[k]!='\n' && zSafeKey[k]!='\r'; k++){}
@@ -873,23 +874,24 @@
873
874 /*
875 ** Execute a single read-only SQL statement. Invoke xCallback() on each
876 ** row.
877 */
878 int sqlite3_exec_readonly(
879 sqlite3 *db, /* The database on which the SQL executes */
880 const char *zSql, /* The SQL to be executed */
881 sqlite3_callback xCallback, /* Invoke this callback routine */
 
882 void *pArg, /* First argument to xCallback() */
883 char **pzErrMsg /* Write error messages here */
884 ){
885 int rc = SQLITE_OK; /* Return code */
886 const char *zLeftover; /* Tail of unprocessed SQL */
887 sqlite3_stmt *pStmt = 0; /* The current SQL statement */
888 char **azCols = 0; /* Names of result columns */
889 int nCol; /* Number of columns of output */
890 char **azVals = 0; /* Text of all output columns */
891 int i; /* Loop counter */
892
893 pStmt = 0;
894 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
895 assert( rc==SQLITE_OK || pStmt==0 );
@@ -912,15 +914,15 @@
912 azVals = fossil_malloc(2*nCol*sizeof(const char*) + 1);
913 while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){
914 if( azCols==0 ){
915 azCols = &azVals[nCol];
916 for(i=0; i<nCol; i++){
917 azCols[i] = (char *)sqlite3_column_name(pStmt, i);
918 }
919 }
920 for(i=0; i<nCol; i++){
921 azVals[i] = (char *)sqlite3_column_text(pStmt, i);
922 }
923 if( xCallback(pArg, nCol, azVals, azCols) ){
924 break;
925 }
926 }
@@ -1086,11 +1088,11 @@
1086 @ <table border="1" cellpadding="2" cellspacing="0" class="report"
1087 @ id="reportTable">
1088 sState.rn = rn;
1089 sState.nCount = 0;
1090 report_restrict_sql(&zErr1);
1091 sqlite3_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2);
1092 report_unrestrict_sql();
1093 @ </tbody></table>
1094 if( zErr1 ){
1095 @ <p class="reportError">Error: %h(zErr1)</p>
1096 }else if( zErr2 ){
@@ -1098,11 +1100,11 @@
1098 }
1099 output_table_sorting_javascript("reportTable","");
1100 style_footer();
1101 }else{
1102 report_restrict_sql(&zErr1);
1103 sqlite3_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2);
1104 report_unrestrict_sql();
1105 cgi_set_content_type("text/plain");
1106 }
1107 }
1108
@@ -1187,12 +1189,12 @@
1187 ** Output a row as a tab-separated line of text.
1188 */
1189 int output_separated_file(
1190 void *pUser, /* Pointer to row-count integer */
1191 int nArg, /* Number of columns in this result row */
1192 char **azArg, /* Text of data in all columns */
1193 char **azName /* Names of the columns */
1194 ){
1195 int *pCount = (int*)pUser;
1196 int i;
1197
1198 if( *pCount==0 ){
@@ -1251,11 +1253,11 @@
1251 }
1252 count = 0;
1253 tktEncode = enc;
1254 zSep = zSepIn;
1255 report_restrict_sql(&zErr1);
1256 sqlite3_exec_readonly(g.db, zSql, output_separated_file, &count, &zErr2);
1257 report_unrestrict_sql();
1258 if( zFilter ){
1259 free(zSql);
1260 }
1261 }
1262
--- src/report.c
+++ src/report.c
@@ -650,17 +650,17 @@
650 ** The callback function for db_query
651 */
652 static int generate_html(
653 void *pUser, /* Pointer to output state */
654 int nArg, /* Number of columns in this result row */
655 const char **azArg, /* Text of data in all columns */
656 const char **azName /* Names of the columns */
657 ){
658 struct GenerateHTML *pState = (struct GenerateHTML*)pUser;
659 int i;
660 const char *zTid; /* Ticket UUID. (value of column named '#') */
661 const char *zBg = 0; /* Use this background color */
662
663 /* Do initialization
664 */
665 if( pState->nCount==0 ){
666 /* Turn off the authorizer. It is no longer doing anything since the
@@ -710,11 +710,11 @@
710 /* The first time this routine is called, output a table header
711 */
712 @ <thead><tr>
713 zTid = 0;
714 for(i=0; i<nArg; i++){
715 const char *zName = azName[i];
716 if( i==pState->iBg ) continue;
717 if( pState->iNewRow>=0 && i>=pState->iNewRow ){
718 if( g.perm.Write && zTid ){
719 @ <th>&nbsp;</th>
720 zTid = 0;
@@ -753,11 +753,11 @@
753 zBg = pState->iBg>=0 ? azArg[pState->iBg] : 0;
754 if( zBg==0 ) zBg = "white";
755 @ <tr style="background-color:%h(zBg)">
756 zTid = 0;
757 for(i=0; i<nArg; i++){
758 const char *zData;
759 if( i==pState->iBg ) continue;
760 zData = azArg[i];
761 if( zData==0 ) zData = "";
762 if( pState->iNewRow>=0 && i>=pState->iNewRow ){
763 if( zTid && g.perm.Write ){
@@ -815,12 +815,12 @@
815 ** Output a row as a tab-separated line of text.
816 */
817 static int output_tab_separated(
818 void *pUser, /* Pointer to row-count integer */
819 int nArg, /* Number of columns in this result row */
820 const char **azArg, /* Text of data in all columns */
821 const char **azName /* Names of the columns */
822 ){
823 int *pCount = (int*)pUser;
824 int i;
825
826 if( *pCount==0 ){
@@ -840,18 +840,19 @@
840 /*
841 ** Generate HTML that describes a color key.
842 */
843 void output_color_key(const char *zClrKey, int horiz, char *zTabArgs){
844 int i, j, k;
845 const char *zSafeKey;
846 char *zToFree;
847 while( fossil_isspace(*zClrKey) ) zClrKey++;
848 if( zClrKey[0]==0 ) return;
849 @ <table %s(zTabArgs)>
850 if( horiz ){
851 @ <tr>
852 }
853 zSafeKey = zToFree = mprintf("%h", zClrKey);
854 while( zSafeKey[0] ){
855 while( fossil_isspace(*zSafeKey) ) zSafeKey++;
856 for(i=0; zSafeKey[i] && !fossil_isspace(zSafeKey[i]); i++){}
857 for(j=i; fossil_isspace(zSafeKey[j]); j++){}
858 for(k=j; zSafeKey[k] && zSafeKey[k]!='\n' && zSafeKey[k]!='\r'; k++){}
@@ -873,23 +874,24 @@
874
875 /*
876 ** Execute a single read-only SQL statement. Invoke xCallback() on each
877 ** row.
878 */
879 static int db_exec_readonly(
880 sqlite3 *db, /* The database on which the SQL executes */
881 const char *zSql, /* The SQL to be executed */
882 int (*xCallback)(void*,int,const char**, const char**),
883 /* Invoke this callback routine */
884 void *pArg, /* First argument to xCallback() */
885 char **pzErrMsg /* Write error messages here */
886 ){
887 int rc = SQLITE_OK; /* Return code */
888 const char *zLeftover; /* Tail of unprocessed SQL */
889 sqlite3_stmt *pStmt = 0; /* The current SQL statement */
890 const char **azCols = 0; /* Names of result columns */
891 int nCol; /* Number of columns of output */
892 const char **azVals = 0; /* Text of all output columns */
893 int i; /* Loop counter */
894
895 pStmt = 0;
896 rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
897 assert( rc==SQLITE_OK || pStmt==0 );
@@ -912,15 +914,15 @@
914 azVals = fossil_malloc(2*nCol*sizeof(const char*) + 1);
915 while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){
916 if( azCols==0 ){
917 azCols = &azVals[nCol];
918 for(i=0; i<nCol; i++){
919 azCols[i] = sqlite3_column_name(pStmt, i);
920 }
921 }
922 for(i=0; i<nCol; i++){
923 azVals[i] = (const char *)sqlite3_column_text(pStmt, i);
924 }
925 if( xCallback(pArg, nCol, azVals, azCols) ){
926 break;
927 }
928 }
@@ -1086,11 +1088,11 @@
1088 @ <table border="1" cellpadding="2" cellspacing="0" class="report"
1089 @ id="reportTable">
1090 sState.rn = rn;
1091 sState.nCount = 0;
1092 report_restrict_sql(&zErr1);
1093 db_exec_readonly(g.db, zSql, generate_html, &sState, &zErr2);
1094 report_unrestrict_sql();
1095 @ </tbody></table>
1096 if( zErr1 ){
1097 @ <p class="reportError">Error: %h(zErr1)</p>
1098 }else if( zErr2 ){
@@ -1098,11 +1100,11 @@
1100 }
1101 output_table_sorting_javascript("reportTable","");
1102 style_footer();
1103 }else{
1104 report_restrict_sql(&zErr1);
1105 db_exec_readonly(g.db, zSql, output_tab_separated, &count, &zErr2);
1106 report_unrestrict_sql();
1107 cgi_set_content_type("text/plain");
1108 }
1109 }
1110
@@ -1187,12 +1189,12 @@
1189 ** Output a row as a tab-separated line of text.
1190 */
1191 int output_separated_file(
1192 void *pUser, /* Pointer to row-count integer */
1193 int nArg, /* Number of columns in this result row */
1194 const char **azArg, /* Text of data in all columns */
1195 const char **azName /* Names of the columns */
1196 ){
1197 int *pCount = (int*)pUser;
1198 int i;
1199
1200 if( *pCount==0 ){
@@ -1251,11 +1253,11 @@
1253 }
1254 count = 0;
1255 tktEncode = enc;
1256 zSep = zSepIn;
1257 report_restrict_sql(&zErr1);
1258 db_exec_readonly(g.db, zSql, output_separated_file, &count, &zErr2);
1259 report_unrestrict_sql();
1260 if( zFilter ){
1261 free(zSql);
1262 }
1263 }
1264
+1 -1
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -137,11 +137,11 @@
137137
**
138138
** WARNING: Careless use of this command can corrupt a Fossil repository
139139
** in ways that are unrecoverable. Be sure you know what you are doing before
140140
** running any SQL commands that modifies the repository database.
141141
*/
142
-void sqlite3_cmd(void){
142
+void cmd_sqlite3(void){
143143
extern int sqlite3_shell(int, char**);
144144
db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
145145
db_close(1);
146146
sqlite3_shutdown();
147147
sqlite3_shell(g.argc-1, g.argv+1);
148148
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -137,11 +137,11 @@
137 **
138 ** WARNING: Careless use of this command can corrupt a Fossil repository
139 ** in ways that are unrecoverable. Be sure you know what you are doing before
140 ** running any SQL commands that modifies the repository database.
141 */
142 void sqlite3_cmd(void){
143 extern int sqlite3_shell(int, char**);
144 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
145 db_close(1);
146 sqlite3_shutdown();
147 sqlite3_shell(g.argc-1, g.argv+1);
148
--- src/sqlcmd.c
+++ src/sqlcmd.c
@@ -137,11 +137,11 @@
137 **
138 ** WARNING: Careless use of this command can corrupt a Fossil repository
139 ** in ways that are unrecoverable. Be sure you know what you are doing before
140 ** running any SQL commands that modifies the repository database.
141 */
142 void cmd_sqlite3(void){
143 extern int sqlite3_shell(int, char**);
144 db_find_and_open_repository(OPEN_ANY_SCHEMA, 0);
145 db_close(1);
146 sqlite3_shutdown();
147 sqlite3_shell(g.argc-1, g.argv+1);
148

Keyboard Shortcuts

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