/ Check-in [33973814]
Login

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

Overview
Comment:Fix a segfault that can occur following an OOM fault while renaming a table holding foreign key constraints.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:33973814c67bc9bac575bf2249df6530dd2184d3
User & Date: drh 2009-10-08 01:43:55
Context
2009-10-08
06:24
Update triggerC.test to match the change to the way the trigger-recursion limit is handled. check-in: 58069252 user: dan tags: trunk
01:43
Fix a segfault that can occur following an OOM fault while renaming a table holding foreign key constraints. check-in: 33973814 user: drh tags: trunk
2009-10-07
23:42
Use memcpy() rather than structure assignment so that memcmp() can later be used for comparison. Ticket [8550ecca70] check-in: 56f609da user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/alter.c.

123
124
125
126
127
128
129

130
131
132
133
134
135
136
      char *zParent;
      do {
        z += n;
        n = sqlite3GetToken(z, &token);
      }while( token==TK_SPACE );

      zParent = sqlite3DbStrNDup(db, (const char *)z, n);

      sqlite3Dequote(zParent);
      if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){
        char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", 
            (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew
        );
        sqlite3DbFree(db, zOutput);
        zOutput = zOut;







>







123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
      char *zParent;
      do {
        z += n;
        n = sqlite3GetToken(z, &token);
      }while( token==TK_SPACE );

      zParent = sqlite3DbStrNDup(db, (const char *)z, n);
      if( zParent==0 ) break;
      sqlite3Dequote(zParent);
      if( 0==sqlite3StrICmp((const char *)zOld, zParent) ){
        char *zOut = sqlite3MPrintf(db, "%s%.*s\"%w\"", 
            (zOutput?zOutput:""), z-zInput, zInput, (const char *)zNew
        );
        sqlite3DbFree(db, zOutput);
        zOutput = zOut;