UnQL

Check-in [55db23bf44]
Login

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

Overview
Comment:Fix a cut and paste bug in update.c.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 55db23bf4462039d68bf24d37d72e5dfc43c531d
User & Date: dan 2011-07-14 19:17:43
Context
2011-07-15
16:11
Add support for logical expression operators AND, OR and NOT. check-in: b4ea7f84c7 user: dan tags: trunk
2011-07-14
19:17
Fix a cut and paste bug in update.c. check-in: 55db23bf44 user: dan tags: trunk
2011-07-08
19:19
Add tcl scripts to generate bubble diagrams for the query language syntax. check-in: 1afab97fd6 user: dan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/update.c.

116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
                         pCmd->u.update.zName);
  sqlite3_prepare_v2(db, zSql, -1, &pReplace, 0);
  sqlite3_free(zSql);
  if( pQuery && pReplace ){
    while( SQLITE_ROW==sqlite3_step(pQuery) ){
      const char *zJson = (const char*)sqlite3_column_text(pQuery, 1);
      pStmt->pDoc = xjd1JsonParse(zJson, -1);
      if( pCmd->u.del.pWhere==0 || xjd1ExprTrue(pCmd->u.del.pWhere) ){
        JsonNode *pNewDoc;  /* Revised document content */
        ExprList *pChng;    /* List of changes */
        String jsonNewDoc;  /* Text rendering of revised document */
        int i, n;

        pNewDoc  = xjd1JsonRef(pStmt->pDoc);
        pChng = pCmd->u.update.pChng;







|







116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
                         pCmd->u.update.zName);
  sqlite3_prepare_v2(db, zSql, -1, &pReplace, 0);
  sqlite3_free(zSql);
  if( pQuery && pReplace ){
    while( SQLITE_ROW==sqlite3_step(pQuery) ){
      const char *zJson = (const char*)sqlite3_column_text(pQuery, 1);
      pStmt->pDoc = xjd1JsonParse(zJson, -1);
      if( pCmd->u.update.pWhere==0 || xjd1ExprTrue(pCmd->u.update.pWhere) ){
        JsonNode *pNewDoc;  /* Revised document content */
        ExprList *pChng;    /* List of changes */
        String jsonNewDoc;  /* Text rendering of revised document */
        int i, n;

        pNewDoc  = xjd1JsonRef(pStmt->pDoc);
        pChng = pCmd->u.update.pChng;