Fossil SCM

Make sure the tkt_uuid and tkt_datetime TH1 variables are initialized on a ticket display, even if no matching ticket is found.

drh 2008-11-09 13:22 trunk
Commit 2664476fbc2dfd37ebda0a82e6ba19a4a557551b
1 file changed +6
+6
--- src/tkt.c
+++ src/tkt.c
@@ -137,15 +137,21 @@
137137
free(zRevealed);
138138
}
139139
}else{
140140
db_finalize(&q);
141141
db_prepare(&q, "PRAGMA table_info(ticket)");
142
+ if( Th_Fetch("tkt_uuid",&size)==0 ){
143
+ Th_Store("tkt_uuid",zName);
144
+ }
142145
while( db_step(&q)==SQLITE_ROW ){
143146
const char *zField = db_column_text(&q, 1);
144147
if( Th_Fetch(zField, &size)==0 ){
145148
Th_Store(zField, "");
146149
}
150
+ }
151
+ if( Th_Fetch("tkt_datetime",&size)==0 ){
152
+ Th_Store("tkt_datetime","");
147153
}
148154
}
149155
db_finalize(&q);
150156
}
151157
152158
--- src/tkt.c
+++ src/tkt.c
@@ -137,15 +137,21 @@
137 free(zRevealed);
138 }
139 }else{
140 db_finalize(&q);
141 db_prepare(&q, "PRAGMA table_info(ticket)");
 
 
 
142 while( db_step(&q)==SQLITE_ROW ){
143 const char *zField = db_column_text(&q, 1);
144 if( Th_Fetch(zField, &size)==0 ){
145 Th_Store(zField, "");
146 }
 
 
 
147 }
148 }
149 db_finalize(&q);
150 }
151
152
--- src/tkt.c
+++ src/tkt.c
@@ -137,15 +137,21 @@
137 free(zRevealed);
138 }
139 }else{
140 db_finalize(&q);
141 db_prepare(&q, "PRAGMA table_info(ticket)");
142 if( Th_Fetch("tkt_uuid",&size)==0 ){
143 Th_Store("tkt_uuid",zName);
144 }
145 while( db_step(&q)==SQLITE_ROW ){
146 const char *zField = db_column_text(&q, 1);
147 if( Th_Fetch(zField, &size)==0 ){
148 Th_Store(zField, "");
149 }
150 }
151 if( Th_Fetch("tkt_datetime",&size)==0 ){
152 Th_Store("tkt_datetime","");
153 }
154 }
155 db_finalize(&q);
156 }
157
158

Keyboard Shortcuts

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