Fossil SCM
Make the now() SQL function available in the "fossil sql" command.
Commit
0134654db60898d91ede721843d2831ca7f3d3de
Parent
f5165dd05bb99f6…
2 files changed
+2
-2
+2
M
src/db.c
+2
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -805,10 +805,12 @@ | ||
| 805 | 805 | db_checkin_mtime_function, 0, 0); |
| 806 | 806 | sqlite3_create_function(db, "symbolic_name_to_rid", 1, SQLITE_UTF8, 0, |
| 807 | 807 | db_sym2rid_function, 0, 0); |
| 808 | 808 | sqlite3_create_function(db, "symbolic_name_to_rid", 2, SQLITE_UTF8, 0, |
| 809 | 809 | db_sym2rid_function, 0, 0); |
| 810 | + sqlite3_create_function(db, "now", 0, SQLITE_UTF8, 0, | |
| 811 | + db_now_function, 0, 0); | |
| 810 | 812 | } |
| 811 | 813 | |
| 812 | 814 | |
| 813 | 815 | /* |
| 814 | 816 | ** Open a database file. Return a pointer to the new database |
| @@ -827,12 +829,10 @@ | ||
| 827 | 829 | if( rc!=SQLITE_OK ){ |
| 828 | 830 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 829 | 831 | } |
| 830 | 832 | sqlite3_busy_timeout(db, 5000); |
| 831 | 833 | sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */ |
| 832 | - sqlite3_create_function(db, "now", 0, SQLITE_UTF8, 0, | |
| 833 | - db_now_function, 0, 0); | |
| 834 | 834 | sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0); |
| 835 | 835 | sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 836 | 836 | sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 837 | 837 | sqlite3_create_function(db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 838 | 838 | sqlite3_create_function( |
| 839 | 839 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -805,10 +805,12 @@ | |
| 805 | db_checkin_mtime_function, 0, 0); |
| 806 | sqlite3_create_function(db, "symbolic_name_to_rid", 1, SQLITE_UTF8, 0, |
| 807 | db_sym2rid_function, 0, 0); |
| 808 | sqlite3_create_function(db, "symbolic_name_to_rid", 2, SQLITE_UTF8, 0, |
| 809 | db_sym2rid_function, 0, 0); |
| 810 | } |
| 811 | |
| 812 | |
| 813 | /* |
| 814 | ** Open a database file. Return a pointer to the new database |
| @@ -827,12 +829,10 @@ | |
| 827 | if( rc!=SQLITE_OK ){ |
| 828 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 829 | } |
| 830 | sqlite3_busy_timeout(db, 5000); |
| 831 | sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */ |
| 832 | sqlite3_create_function(db, "now", 0, SQLITE_UTF8, 0, |
| 833 | db_now_function, 0, 0); |
| 834 | sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0); |
| 835 | sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 836 | sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 837 | sqlite3_create_function(db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 838 | sqlite3_create_function( |
| 839 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -805,10 +805,12 @@ | |
| 805 | db_checkin_mtime_function, 0, 0); |
| 806 | sqlite3_create_function(db, "symbolic_name_to_rid", 1, SQLITE_UTF8, 0, |
| 807 | db_sym2rid_function, 0, 0); |
| 808 | sqlite3_create_function(db, "symbolic_name_to_rid", 2, SQLITE_UTF8, 0, |
| 809 | db_sym2rid_function, 0, 0); |
| 810 | sqlite3_create_function(db, "now", 0, SQLITE_UTF8, 0, |
| 811 | db_now_function, 0, 0); |
| 812 | } |
| 813 | |
| 814 | |
| 815 | /* |
| 816 | ** Open a database file. Return a pointer to the new database |
| @@ -827,12 +829,10 @@ | |
| 829 | if( rc!=SQLITE_OK ){ |
| 830 | db_err("[%s]: %s", zDbName, sqlite3_errmsg(db)); |
| 831 | } |
| 832 | sqlite3_busy_timeout(db, 5000); |
| 833 | sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */ |
| 834 | sqlite3_create_function(db, "user", 0, SQLITE_UTF8, 0, db_sql_user, 0, 0); |
| 835 | sqlite3_create_function(db, "cgi", 1, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 836 | sqlite3_create_function(db, "cgi", 2, SQLITE_UTF8, 0, db_sql_cgi, 0, 0); |
| 837 | sqlite3_create_function(db, "print", -1, SQLITE_UTF8, 0,db_sql_print,0,0); |
| 838 | sqlite3_create_function( |
| 839 |
+2
| --- src/sqlcmd.c | ||
| +++ src/sqlcmd.c | ||
| @@ -170,10 +170,12 @@ | ||
| 170 | 170 | ** checkin_mtime(X,Y) Return the mtime for the file Y (a BLOB.RID) |
| 171 | 171 | ** found in check-in X (another BLOB.RID value). |
| 172 | 172 | ** |
| 173 | 173 | ** symbolic_name_to_rid(X) Return a the BLOB.RID corresponding to symbolic |
| 174 | 174 | ** name X. |
| 175 | +** | |
| 176 | +** now() Return the number of seconds since 1970. | |
| 175 | 177 | ** |
| 176 | 178 | ** REGEXP The REGEXP operator works, unlike in |
| 177 | 179 | ** standard SQLite. |
| 178 | 180 | ** |
| 179 | 181 | ** files_of_checkin The "files_of_check" virtual table is |
| 180 | 182 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -170,10 +170,12 @@ | |
| 170 | ** checkin_mtime(X,Y) Return the mtime for the file Y (a BLOB.RID) |
| 171 | ** found in check-in X (another BLOB.RID value). |
| 172 | ** |
| 173 | ** symbolic_name_to_rid(X) Return a the BLOB.RID corresponding to symbolic |
| 174 | ** name X. |
| 175 | ** |
| 176 | ** REGEXP The REGEXP operator works, unlike in |
| 177 | ** standard SQLite. |
| 178 | ** |
| 179 | ** files_of_checkin The "files_of_check" virtual table is |
| 180 |
| --- src/sqlcmd.c | |
| +++ src/sqlcmd.c | |
| @@ -170,10 +170,12 @@ | |
| 170 | ** checkin_mtime(X,Y) Return the mtime for the file Y (a BLOB.RID) |
| 171 | ** found in check-in X (another BLOB.RID value). |
| 172 | ** |
| 173 | ** symbolic_name_to_rid(X) Return a the BLOB.RID corresponding to symbolic |
| 174 | ** name X. |
| 175 | ** |
| 176 | ** now() Return the number of seconds since 1970. |
| 177 | ** |
| 178 | ** REGEXP The REGEXP operator works, unlike in |
| 179 | ** standard SQLite. |
| 180 | ** |
| 181 | ** files_of_checkin The "files_of_check" virtual table is |
| 182 |