SQLite

Check-in [e5c132fff3]
Login

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

Overview
Comment:Fix a memory leak in the Rename method of the echo test virtual table. No changes to the core. (CVS 4166)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e5c132fff3e8a0478622527a7e47d679594f899a
User & Date: drh 2007-07-20 00:35:59.000
Context
2007-07-20
01:17
Documentation change in preparation for version 3.4.1. (CVS 4167) (check-in: cf227766ac user: drh tags: trunk)
00:35
Fix a memory leak in the Rename method of the echo test virtual table. No changes to the core. (CVS 4166) (check-in: e5c132fff3 user: drh tags: trunk)
00:33
Cleanup unused function in pager.c. This is the conclusion of the fix to ticket #2518. We believe the fix is complete and correct. (CVS 4165) (check-in: 31dba1e933 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test8.c.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Code for testing the virtual table interfaces.  This code
** is not included in the SQLite library.  It is used for automated
** testing of the SQLite library.
**
** $Id: test8.c,v 1.47 2007/06/27 15:53:35 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include "os.h"
#include <stdlib.h>
#include <string.h>








|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
**    May you share freely, never taking more than you give.
**
*************************************************************************
** Code for testing the virtual table interfaces.  This code
** is not included in the SQLite library.  It is used for automated
** testing of the SQLite library.
**
** $Id: test8.c,v 1.48 2007/07/20 00:35:59 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include "os.h"
#include <stdlib.h>
#include <string.h>

1037
1038
1039
1040
1041
1042
1043

1044
1045
1046
1047
1048
1049
1050

  if( p->isPattern ){
    int nThis = strlen(p->zThis);
    char *zSql = sqlite3MPrintf("ALTER TABLE %s RENAME TO %s%s", 
        p->zTableName, zNewName, &p->zTableName[nThis]
    );
    rc = sqlite3_exec(p->db, zSql, 0, 0, 0);

  }

  return rc;
}

/*
** A virtual table module that merely "echos" the contents of another







>







1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051

  if( p->isPattern ){
    int nThis = strlen(p->zThis);
    char *zSql = sqlite3MPrintf("ALTER TABLE %s RENAME TO %s%s", 
        p->zTableName, zNewName, &p->zTableName[nThis]
    );
    rc = sqlite3_exec(p->db, zSql, 0, 0, 0);
    sqliteFree(zSql);
  }

  return rc;
}

/*
** A virtual table module that merely "echos" the contents of another