Fossil

Check-in [0b76ce7b6b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Treat NULL ticket fields as empty strings when appending new text. Ticket [f6747f854ba62b3]
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0b76ce7b6ba3b641168c14875d3d6f329f389b80
User & Date: drh 2009-09-19 14:33:04.000
References
2009-09-19
14:34 Fixed ticket [f6747f854b]: commens not visible for ticket with no description plus 3 other changes ... (artifact: 6ec44da199 user: drh)
Context
2009-09-19
14:42
Fix the name of the "fossil branch" command in the [/doc/tip/www/quickstart.wiki | Quick Start] document. Ticket [6445480b9bd2] ... (check-in: 849972ea0b user: drh tags: trunk)
14:33
Treat NULL ticket fields as empty strings when appending new text. Ticket [f6747f854ba62b3] ... (check-in: 0b76ce7b6b user: drh tags: trunk)
2009-09-18
20:58
On the "checkout" command, make sure the argument specifies a check-in and not some other object. Ticket [867f23ff79]. ... (check-in: c774e298c3 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/tkt.c.
216
217
218
219
220
221
222

223
224
225
226
227
228
229
230
  blob_appendf(&sql, "UPDATE OR REPLACE ticket SET tkt_mtime=:mtime");
  zSep = "SET";
  for(i=0; i<p->nField; i++){
    const char *zName = p->aField[i].zName;
    if( zName[0]=='+' ){
      zName++;
      if( fieldId(zName)<0 ) continue;

      blob_appendf(&sql,", %s=%s || %Q", zName, zName, p->aField[i].zValue);
    }else{
      if( fieldId(zName)<0 ) continue;
      blob_appendf(&sql,", %s=%Q", zName, p->aField[i].zValue);
    }
  }
  blob_appendf(&sql, " WHERE tkt_uuid='%s' AND tkt_mtime<:mtime",
                     p->zTicketUuid);







>
|







216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
  blob_appendf(&sql, "UPDATE OR REPLACE ticket SET tkt_mtime=:mtime");
  zSep = "SET";
  for(i=0; i<p->nField; i++){
    const char *zName = p->aField[i].zName;
    if( zName[0]=='+' ){
      zName++;
      if( fieldId(zName)<0 ) continue;
      blob_appendf(&sql,", %s=coalesce(%s,'') || %Q",
                   zName, zName, p->aField[i].zValue);
    }else{
      if( fieldId(zName)<0 ) continue;
      blob_appendf(&sql,", %s=%Q", zName, p->aField[i].zValue);
    }
  }
  blob_appendf(&sql, " WHERE tkt_uuid='%s' AND tkt_mtime<:mtime",
                     p->zTicketUuid);