Fossil SCM
Use SQLITE_UTF8 in stead of SQLITE_ANY everywhere, because SQLITE_ANY is deprecated in later SQLite and fossil uses UTF-8 everywhere anyway.
Commit
2c95802cfcc5a3dcca94de71eecdffbe59133f67
Parent
88aa2e375af6868…
3 files changed
+5
-5
+2
-2
+3
-3
M
src/db.c
+5
-5
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -729,16 +729,16 @@ | ||
| 729 | 729 | if( rc!=SQLITE_OK ){ |
| 730 | 730 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 731 | 731 | } |
| 732 | 732 | sqlite3_busy_timeout(db, 5000); |
| 733 | 733 | sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */ |
| 734 | - sqlite3_create_function(db, "now", 0, SQLITE_ANY, 0, db_now_function, 0, 0); | |
| 735 | - sqlite3_create_function(db, "checkin_mtime", 2, SQLITE_ANY, 0, | |
| 734 | + sqlite3_create_function(db, "now", 0, SQLITE_UTF8, 0, db_now_function, 0, 0); | |
| 735 | + sqlite3_create_function(db, "checkin_mtime", 2, SQLITE_UTF8, 0, | |
| 736 | 736 | db_checkin_mtime_function, 0, 0); |
| 737 | - sqlite3_create_function(db, "user", 0, SQLITE_ANY, 0, db_sql_user, 0, 0); | |
| 738 | - sqlite3_create_function(db, "cgi", 1, SQLITE_ANY, 0, db_sql_cgi, 0, 0); | |
| 739 | - sqlite3_create_function(db, "cgi", 2, SQLITE_ANY, 0, db_sql_cgi, 0, 0); | |
| 737 | + sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0); | |
| 738 | + sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); | |
| 739 | + sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); | |
| 740 | 740 | sqlite3_create_function(db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 741 | 741 | sqlite3_create_function( |
| 742 | 742 | db, "is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0 |
| 743 | 743 | ); |
| 744 | 744 | sqlite3_create_function( |
| 745 | 745 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -729,16 +729,16 @@ | |
| 729 | if( rc!=SQLITE_OK ){ |
| 730 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 731 | } |
| 732 | sqlite3_busy_timeout(db, 5000); |
| 733 | sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */ |
| 734 | sqlite3_create_function(db, "now", 0, SQLITE_ANY, 0, db_now_function, 0, 0); |
| 735 | sqlite3_create_function(db, "checkin_mtime", 2, SQLITE_ANY, 0, |
| 736 | db_checkin_mtime_function, 0, 0); |
| 737 | sqlite3_create_function(db, "user", 0, SQLITE_ANY, 0, db_sql_user, 0, 0); |
| 738 | sqlite3_create_function(db, "cgi", 1, SQLITE_ANY, 0, db_sql_cgi, 0, 0); |
| 739 | sqlite3_create_function(db, "cgi", 2, SQLITE_ANY, 0, db_sql_cgi, 0, 0); |
| 740 | sqlite3_create_function(db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 741 | sqlite3_create_function( |
| 742 | db, "is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0 |
| 743 | ); |
| 744 | sqlite3_create_function( |
| 745 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -729,16 +729,16 @@ | |
| 729 | if( rc!=SQLITE_OK ){ |
| 730 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 731 | } |
| 732 | sqlite3_busy_timeout(db, 5000); |
| 733 | sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */ |
| 734 | sqlite3_create_function(db, "now", 0, SQLITE_UTF8, 0, db_now_function, 0, 0); |
| 735 | sqlite3_create_function(db, "checkin_mtime", 2, SQLITE_UTF8, 0, |
| 736 | db_checkin_mtime_function, 0, 0); |
| 737 | sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0); |
| 738 | sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 739 | sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 740 | sqlite3_create_function(db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 741 | sqlite3_create_function( |
| 742 | db, "is_selected", 1, SQLITE_UTF8, 0, file_is_selected,0,0 |
| 743 | ); |
| 744 | sqlite3_create_function( |
| 745 |
+2
-2
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -706,11 +706,11 @@ | ||
| 706 | 706 | zOtherRepo, &pOther, |
| 707 | 707 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, |
| 708 | 708 | g.zVfsName |
| 709 | 709 | ); |
| 710 | 710 | if( rc==SQLITE_OK ){ |
| 711 | - sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0); | |
| 711 | + sqlite3_create_function(pOther,"now",0,SQLITE_UTF8,0,db_now_function,0,0); | |
| 712 | 712 | sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0, |
| 713 | 713 | constant_time_cmp_function, 0, 0); |
| 714 | 714 | sqlite3_busy_timeout(pOther, 5000); |
| 715 | 715 | zSQL = mprintf( |
| 716 | 716 | "SELECT cexpire FROM user" |
| @@ -1409,11 +1409,11 @@ | ||
| 1409 | 1409 | sqlite3_close(pPeer); |
| 1410 | 1410 | continue; |
| 1411 | 1411 | } |
| 1412 | 1412 | sqlite3_create_function(pPeer, "shared_secret", 3, SQLITE_UTF8, |
| 1413 | 1413 | 0, sha1_shared_secret_sql_function, 0, 0); |
| 1414 | - sqlite3_create_function(pPeer, "now", 0,SQLITE_ANY,0,db_now_function,0,0); | |
| 1414 | + sqlite3_create_function(pPeer, "now", 0,SQLITE_UTF8,0,db_now_function,0,0); | |
| 1415 | 1415 | sqlite3_busy_timeout(pPeer, 5000); |
| 1416 | 1416 | zErr = 0; |
| 1417 | 1417 | rc = sqlite3_exec(pPeer, zSql, 0, 0, &zErr); |
| 1418 | 1418 | if( zErr ){ |
| 1419 | 1419 | blob_appendf(&err, "%s%s: %s%s", zPrefix, zRepoName, zErr, zSuffix); |
| 1420 | 1420 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -706,11 +706,11 @@ | |
| 706 | zOtherRepo, &pOther, |
| 707 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, |
| 708 | g.zVfsName |
| 709 | ); |
| 710 | if( rc==SQLITE_OK ){ |
| 711 | sqlite3_create_function(pOther,"now",0,SQLITE_ANY,0,db_now_function,0,0); |
| 712 | sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0, |
| 713 | constant_time_cmp_function, 0, 0); |
| 714 | sqlite3_busy_timeout(pOther, 5000); |
| 715 | zSQL = mprintf( |
| 716 | "SELECT cexpire FROM user" |
| @@ -1409,11 +1409,11 @@ | |
| 1409 | sqlite3_close(pPeer); |
| 1410 | continue; |
| 1411 | } |
| 1412 | sqlite3_create_function(pPeer, "shared_secret", 3, SQLITE_UTF8, |
| 1413 | 0, sha1_shared_secret_sql_function, 0, 0); |
| 1414 | sqlite3_create_function(pPeer, "now", 0,SQLITE_ANY,0,db_now_function,0,0); |
| 1415 | sqlite3_busy_timeout(pPeer, 5000); |
| 1416 | zErr = 0; |
| 1417 | rc = sqlite3_exec(pPeer, zSql, 0, 0, &zErr); |
| 1418 | if( zErr ){ |
| 1419 | blob_appendf(&err, "%s%s: %s%s", zPrefix, zRepoName, zErr, zSuffix); |
| 1420 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -706,11 +706,11 @@ | |
| 706 | zOtherRepo, &pOther, |
| 707 | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, |
| 708 | g.zVfsName |
| 709 | ); |
| 710 | if( rc==SQLITE_OK ){ |
| 711 | sqlite3_create_function(pOther,"now",0,SQLITE_UTF8,0,db_now_function,0,0); |
| 712 | sqlite3_create_function(pOther, "constant_time_cmp", 2, SQLITE_UTF8, 0, |
| 713 | constant_time_cmp_function, 0, 0); |
| 714 | sqlite3_busy_timeout(pOther, 5000); |
| 715 | zSQL = mprintf( |
| 716 | "SELECT cexpire FROM user" |
| @@ -1409,11 +1409,11 @@ | |
| 1409 | sqlite3_close(pPeer); |
| 1410 | continue; |
| 1411 | } |
| 1412 | sqlite3_create_function(pPeer, "shared_secret", 3, SQLITE_UTF8, |
| 1413 | 0, sha1_shared_secret_sql_function, 0, 0); |
| 1414 | sqlite3_create_function(pPeer, "now", 0,SQLITE_UTF8,0,db_now_function,0,0); |
| 1415 | sqlite3_busy_timeout(pPeer, 5000); |
| 1416 | zErr = 0; |
| 1417 | rc = sqlite3_exec(pPeer, zSql, 0, 0, &zErr); |
| 1418 | if( zErr ){ |
| 1419 | blob_appendf(&err, "%s%s: %s%s", zPrefix, zRepoName, zErr, zSuffix); |
| 1420 |
+3
-3
| --- src/sqlcmd.c | ||
| +++ src/sqlcmd.c | ||
| @@ -112,15 +112,15 @@ | ||
| 112 | 112 | static int sqlcmd_autoinit( |
| 113 | 113 | sqlite3 *db, |
| 114 | 114 | const char **pzErrMsg, |
| 115 | 115 | const void *notUsed |
| 116 | 116 | ){ |
| 117 | - sqlite3_create_function(db, "content", 1, SQLITE_ANY, 0, | |
| 117 | + sqlite3_create_function(db, "content", 1, SQLITE_UTF8, 0, | |
| 118 | 118 | sqlcmd_content, 0, 0); |
| 119 | - sqlite3_create_function(db, "compress", 1, SQLITE_ANY, 0, | |
| 119 | + sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0, | |
| 120 | 120 | sqlcmd_compress, 0, 0); |
| 121 | - sqlite3_create_function(db, "decompress", 1, SQLITE_ANY, 0, | |
| 121 | + sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0, | |
| 122 | 122 | sqlcmd_decompress, 0, 0); |
| 123 | 123 | re_add_sql_func(db); |
| 124 | 124 | g.repositoryOpen = 1; |
| 125 | 125 | g.db = db; |
| 126 | 126 | return SQLITE_OK; |
| 127 | 127 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -112,15 +112,15 @@ | |
| 112 | static int sqlcmd_autoinit( |
| 113 | sqlite3 *db, |
| 114 | const char **pzErrMsg, |
| 115 | const void *notUsed |
| 116 | ){ |
| 117 | sqlite3_create_function(db, "content", 1, SQLITE_ANY, 0, |
| 118 | sqlcmd_content, 0, 0); |
| 119 | sqlite3_create_function(db, "compress", 1, SQLITE_ANY, 0, |
| 120 | sqlcmd_compress, 0, 0); |
| 121 | sqlite3_create_function(db, "decompress", 1, SQLITE_ANY, 0, |
| 122 | sqlcmd_decompress, 0, 0); |
| 123 | re_add_sql_func(db); |
| 124 | g.repositoryOpen = 1; |
| 125 | g.db = db; |
| 126 | return SQLITE_OK; |
| 127 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -112,15 +112,15 @@ | |
| 112 | static int sqlcmd_autoinit( |
| 113 | sqlite3 *db, |
| 114 | const char **pzErrMsg, |
| 115 | const void *notUsed |
| 116 | ){ |
| 117 | sqlite3_create_function(db, "content", 1, SQLITE_UTF8, 0, |
| 118 | sqlcmd_content, 0, 0); |
| 119 | sqlite3_create_function(db, "compress", 1, SQLITE_UTF8, 0, |
| 120 | sqlcmd_compress, 0, 0); |
| 121 | sqlite3_create_function(db, "decompress", 1, SQLITE_UTF8, 0, |
| 122 | sqlcmd_decompress, 0, 0); |
| 123 | re_add_sql_func(db); |
| 124 | g.repositoryOpen = 1; |
| 125 | g.db = db; |
| 126 | return SQLITE_OK; |
| 127 |