Fossil SCM

The SQL parameter $login in the SQL for a report returns the name of the login name of the current user.

drh 2012-08-07 14:58 trunk
Commit a4249d2180521bddb2df2a2d6f168f5611dc7539
1 file changed +3
--- src/report.c
+++ src/report.c
@@ -864,10 +864,13 @@
864864
if( !sqlite3_stmt_readonly(pStmt) ){
865865
sqlite3_finalize(pStmt);
866866
return SQLITE_ERROR;
867867
}
868868
869
+ i = sqlite3_bind_parameter_index(pStmt, "$login");
870
+ if( i ) sqlite3_bind_text(pStmt, i, g.zLogin, -1, SQLITE_TRANSIENT);
871
+
869872
nCol = sqlite3_column_count(pStmt);
870873
azVals = fossil_malloc(2*nCol*sizeof(const char*) + 1);
871874
while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){
872875
if( azCols==0 ){
873876
azCols = &azVals[nCol];
874877
--- src/report.c
+++ src/report.c
@@ -864,10 +864,13 @@
864 if( !sqlite3_stmt_readonly(pStmt) ){
865 sqlite3_finalize(pStmt);
866 return SQLITE_ERROR;
867 }
868
 
 
 
869 nCol = sqlite3_column_count(pStmt);
870 azVals = fossil_malloc(2*nCol*sizeof(const char*) + 1);
871 while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){
872 if( azCols==0 ){
873 azCols = &azVals[nCol];
874
--- src/report.c
+++ src/report.c
@@ -864,10 +864,13 @@
864 if( !sqlite3_stmt_readonly(pStmt) ){
865 sqlite3_finalize(pStmt);
866 return SQLITE_ERROR;
867 }
868
869 i = sqlite3_bind_parameter_index(pStmt, "$login");
870 if( i ) sqlite3_bind_text(pStmt, i, g.zLogin, -1, SQLITE_TRANSIENT);
871
872 nCol = sqlite3_column_count(pStmt);
873 azVals = fossil_malloc(2*nCol*sizeof(const char*) + 1);
874 while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){
875 if( azCols==0 ){
876 azCols = &azVals[nCol];
877

Keyboard Shortcuts

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