aboutsummaryrefslogtreecommitdiff
path: root/src/alter.c
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2007-10-20 20:58:57 +0000
committerdrh <drh@noemail.net>2007-10-20 20:58:57 +0000
commita21a929e81d3d80cb97ed9b3204c80305cc18ceb (patch)
tree4f3f2137ba4a5f635b2f618069fe1417b34b3bde /src/alter.c
parent979aeaa395b51b49f07b5573508658126a0b7d2b (diff)
downloadsqlite-a21a929e81d3d80cb97ed9b3204c80305cc18ceb.tar.gz
sqlite-a21a929e81d3d80cb97ed9b3204c80305cc18ceb.zip
Use the 2-argument version of substr() in the SQL contained in the
VACUUM and ALTER TABLE commands. Ticket #2737. (CVS 4499) FossilOrigin-Name: 82b08a3dc2366007bcac4d9e451ef61c8c018fa5
Diffstat (limited to 'src/alter.c')
-rw-r--r--src/alter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/alter.c b/src/alter.c
index 9d1ebd22c..09eeb4f53 100644
--- a/src/alter.c
+++ b/src/alter.c
@@ -12,7 +12,7 @@
** This file contains C code routines that used to generate VDBE code
** that implements the ALTER TABLE command.
**
-** $Id: alter.c,v 1.32 2007/08/29 14:06:23 danielk1977 Exp $
+** $Id: alter.c,v 1.33 2007/10/20 20:58:57 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -378,7 +378,7 @@ void sqlite3AlterRenameTable(
"name = CASE "
"WHEN type='table' THEN %Q "
"WHEN name LIKE 'sqlite_autoindex%%' AND type='index' THEN "
- "'sqlite_autoindex_' || %Q || substr(name,%d+18,10) "
+ "'sqlite_autoindex_' || %Q || substr(name,%d+18) "
"ELSE name END "
"WHERE tbl_name=%Q AND "
"(type='table' OR type='index' OR type='trigger');",
@@ -515,7 +515,7 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
}
sqlite3NestedParse(pParse,
"UPDATE %Q.%s SET "
- "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d,length(sql)) "
+ "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) "
"WHERE type = 'table' AND name = %Q",
zDb, SCHEMA_TABLE(iDb), pNew->addColOffset, zCol, pNew->addColOffset+1,
zTab