1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Correctly handle COLLATE clauses in tables being modified by an

ALTER TABLE ADD COLUMN command.  Ticket #1665. (CVS 3060)

FossilOrigin-Name: baef2f66be164910881278ea527d2be75ac2e944
This commit is contained in:
drh
2006-02-09 02:56:02 +00:00
parent 6a714ded6c
commit ff22e18b3c
4 changed files with 24 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
C Use\s64-bit\sintegers\sin\ssqlite3_analyzer.\s\sTicket\s#1666.\s(CVS\s3059)
D 2006-02-09T02:41:08
C Correctly\shandle\sCOLLATE\sclauses\sin\stables\sbeing\smodified\sby\san\nALTER\sTABLE\sADD\sCOLUMN\scommand.\s\sTicket\s#1665.\s(CVS\s3060)
D 2006-02-09T02:56:03
F Makefile.in 5d8dff443383918b700e495de42ec65bc1c8865b
F Makefile.linux-gcc 74ba0eadf88748a9ce3fd03d2a3ede2e6715baec
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -30,7 +30,7 @@ F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2
F sqlite3.1 6be1ad09113570e1fc8dcaff84c9b0b337db5ffc
F sqlite3.def f756049b1bf3e8442baf6862db393ca423225262
F sqlite3.pc.in 985b9bf34192a549d7d370e0f0b6b34a4f61369a
F src/alter.c faf98b04050d674d06df21bcf23ded5bbff7b5b7
F src/alter.c 451b34fc4eb2475ca76a2e86b21e1030a9428091
F src/analyze.c 7d2b7ab9a9c2fd6e55700f69064dfdd3e36d7a8a
F src/attach.c d73a3505de3fb9e373d0a158978116c4212031d0
F src/auth.c 9ae84d2d94eb96195e04515715e08e85963e96c2
@@ -100,7 +100,7 @@ F src/where.c c7d71d5e55c9c4c1e948089280fb0dec7c7d1ef6
F tclinstaller.tcl 046e3624671962dc50f0481d7c25b38ef803eb42
F test/aggerror.test b854de90f530ae37be68fbfe6de40e111358cbb2
F test/all.test 5df90d015ca63fcef2a4b62c24f7316b66c4bfd4
F test/alter.test d2569ed639946be29cfcae9117942b4a6d01f719
F test/alter.test 29234396d738966d512dcb0d71c137a2315d38d7
F test/alter2.test cc0b8832e4e98605dbc26910efd4bb89abe59cb2
F test/alter3.test a6eec8f454be9b6ce73d8d7dc711453675a10ce7
F test/altermalloc.test 6e1f404ec021eb2ba6582e3c77b0a35cf206b7af
@@ -350,7 +350,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
P 7940a590abb4262c17922fb2dae1d9688279b2ef
R ca98022de64942582985fba510edc60c
P 8b3068aca7b28d2b6c326f632bb9fe9b4940792d
R 47553fd44adabe1f2b524acd7a9ad936
U drh
Z a28c6abd7d4ce5c8dff2e29b20557003
Z 958b2cb828e348f813795762ac6399a1

View File

@@ -1 +1 @@
8b3068aca7b28d2b6c326f632bb9fe9b4940792d
baef2f66be164910881278ea527d2be75ac2e944

View File

@@ -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.19 2006/01/31 14:28:45 drh Exp $
** $Id: alter.c,v 1.20 2006/02/09 02:56:03 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@@ -541,6 +541,7 @@ void sqlite3AlterBeginAddColumn(Parse *pParse, SrcList *pSrc){
for(i=0; i<pNew->nCol; i++){
Column *pCol = &pNew->aCol[i];
pCol->zName = sqliteStrDup(pCol->zName);
pCol->zColl = 0;
pCol->zType = 0;
pCol->pDflt = 0;
}

View File

@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is testing the ALTER TABLE statement.
#
# $Id: alter.test,v 1.16 2006/01/17 09:35:02 danielk1977 Exp $
# $Id: alter.test,v 1.17 2006/02/09 02:56:03 drh Exp $
#
set testdir [file dirname $argv0]
@@ -618,5 +618,17 @@ do_test alter-6.7 {
"
} {4 5}
finish_test
# Ticket #1665: Make sure ALTER TABLE ADD COLUMN works on a table
# that includes a COLLATE clause.
#
do_test alter-7.1 {
execsql {
CREATE TABLE t1(a TEXT COLLATE BINARY);
ALTER TABLE t1 ADD COLUMN b INTEGER COLLATE NOCASE;
INSERT INTO t1 VALUES(1,'2');
SELECT typeof(a), a, typeof(b), b FROM t1;
}
} {text 1 integer 2}
finish_test