Make sure the default value on a column added using ALTER TABLE has the
correct encoding. Ticket #3838. (CVS 6603) FossilOrigin-Name: 7f89a860b7cd0993c36a8b0482c2bac950a875d6
This commit is contained in:
parent
eeb23a4c24
commit
e3b9bfe6ab
13
manifest
13
manifest
@ -1,5 +1,5 @@
|
|||||||
C Make\ssure\sva_arg()\sdoes\snot\soccur\son\sthe\ssame\sline\sas\sany\s"if"\sstatement\nor\s"?"\soperator.\s(CVS\s6602)
|
C Make\ssure\sthe\sdefault\svalue\son\sa\scolumn\sadded\susing\sALTER\sTABLE\shas\sthe\ncorrect\sencoding.\s\sTicket\s#3838.\s(CVS\s6603)
|
||||||
D 2009-05-04T20:20:16
|
D 2009-05-05T12:54:50
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
|
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@ -209,7 +209,7 @@ F src/vdbeInt.h 43183a2a18654fa570219ab65e53a608057c48ae
|
|||||||
F src/vdbeapi.c 86aa27a5f3493aaffb8ac051782aa3b22670d7ed
|
F src/vdbeapi.c 86aa27a5f3493aaffb8ac051782aa3b22670d7ed
|
||||||
F src/vdbeaux.c 02cefacfa4cf652743c4507fa83646cd7f35e564
|
F src/vdbeaux.c 02cefacfa4cf652743c4507fa83646cd7f35e564
|
||||||
F src/vdbeblob.c e67757450ae8581a8b354d9d7e467e41502dfe38
|
F src/vdbeblob.c e67757450ae8581a8b354d9d7e467e41502dfe38
|
||||||
F src/vdbemem.c f5d7c0b7db32ab6939cbfa371b3b329d16a0ee21
|
F src/vdbemem.c d8b985eeb88214941380372466a30ca410043a93
|
||||||
F src/vtab.c 53355aa2381ec3ef2eaad25672cfd5877a02fe45
|
F src/vtab.c 53355aa2381ec3ef2eaad25672cfd5877a02fe45
|
||||||
F src/walker.c 7cdf63223c953d4343c6833e940f110281a378ee
|
F src/walker.c 7cdf63223c953d4343c6833e940f110281a378ee
|
||||||
F src/where.c 823891e165c20ce781762a0d26f68ec908439687
|
F src/where.c 823891e165c20ce781762a0d26f68ec908439687
|
||||||
@ -647,6 +647,7 @@ F test/tkt3791.test a6624b9a80b216a26cf473607f42f3e51898c267
|
|||||||
F test/tkt3793.test 3aa2efe55bc31fc9459618feea2016ea9a52b2af
|
F test/tkt3793.test 3aa2efe55bc31fc9459618feea2016ea9a52b2af
|
||||||
F test/tkt3824.test 3da2f5c81b057e3ff355f5dfc9aa0cf0a92e0206
|
F test/tkt3824.test 3da2f5c81b057e3ff355f5dfc9aa0cf0a92e0206
|
||||||
F test/tkt3832.test 7ebd5ac82d1e430accd5eec9768044133a94c2aa
|
F test/tkt3832.test 7ebd5ac82d1e430accd5eec9768044133a94c2aa
|
||||||
|
F test/tkt3838.test 2a1525946bc9d3751e1d49ce95f3a2472f2b7408
|
||||||
F test/tokenize.test ce430a7aed48fc98301611429595883fdfcab5d7
|
F test/tokenize.test ce430a7aed48fc98301611429595883fdfcab5d7
|
||||||
F test/trace.test 19ffbc09885c3321d56358a5738feae8587fb377
|
F test/trace.test 19ffbc09885c3321d56358a5738feae8587fb377
|
||||||
F test/trans.test d887cb07630dc39879a322d958ad8b006137485c
|
F test/trans.test d887cb07630dc39879a322d958ad8b006137485c
|
||||||
@ -727,7 +728,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
|
|||||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
P 77a8239548722f702ead9d7c60df0d68180948fb
|
P 3543be6e34ebff48b1b0c1710ae6fec557b09b52
|
||||||
R 49a752b5e2e2337589ff9ef82e78f281
|
R 2a49d02646852b7f205e84dabaf8596f
|
||||||
U drh
|
U drh
|
||||||
Z bdc5440ddff4f2d94ee79f85a0798ddf
|
Z 842865b153ac4330b4a6ad542ce17574
|
||||||
|
@ -1 +1 @@
|
|||||||
3543be6e34ebff48b1b0c1710ae6fec557b09b52
|
7f89a860b7cd0993c36a8b0482c2bac950a875d6
|
@ -15,7 +15,7 @@
|
|||||||
** only within the VDBE. Interface routines refer to a Mem using the
|
** only within the VDBE. Interface routines refer to a Mem using the
|
||||||
** name sqlite_value
|
** name sqlite_value
|
||||||
**
|
**
|
||||||
** $Id: vdbemem.c,v 1.143 2009/05/01 21:13:37 drh Exp $
|
** $Id: vdbemem.c,v 1.144 2009/05/05 12:54:50 drh Exp $
|
||||||
*/
|
*/
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
#include "vdbeInt.h"
|
#include "vdbeInt.h"
|
||||||
@ -979,9 +979,12 @@ int sqlite3ValueFromExpr(
|
|||||||
if( !zVal || !pVal ) goto no_mem;
|
if( !zVal || !pVal ) goto no_mem;
|
||||||
sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC);
|
sqlite3ValueSetStr(pVal, -1, zVal, SQLITE_UTF8, SQLITE_DYNAMIC);
|
||||||
if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){
|
if( (op==TK_INTEGER || op==TK_FLOAT ) && affinity==SQLITE_AFF_NONE ){
|
||||||
sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, enc);
|
sqlite3ValueApplyAffinity(pVal, SQLITE_AFF_NUMERIC, SQLITE_UTF8);
|
||||||
}else{
|
}else{
|
||||||
sqlite3ValueApplyAffinity(pVal, affinity, enc);
|
sqlite3ValueApplyAffinity(pVal, affinity, SQLITE_UTF8);
|
||||||
|
}
|
||||||
|
if( enc!=SQLITE_UTF8 ){
|
||||||
|
sqlite3VdbeChangeEncoding(pVal, enc);
|
||||||
}
|
}
|
||||||
}else if( op==TK_UMINUS ) {
|
}else if( op==TK_UMINUS ) {
|
||||||
if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) ){
|
if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) ){
|
||||||
|
37
test/tkt3838.test
Normal file
37
test/tkt3838.test
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# 2009 May 5
|
||||||
|
#
|
||||||
|
# The author disclaims copyright to this source code. In place of
|
||||||
|
# a legal notice, here is a blessing:
|
||||||
|
#
|
||||||
|
# May you do good and not evil.
|
||||||
|
# May you find forgiveness for yourself and forgive others.
|
||||||
|
# May you share freely, never taking more than you give.
|
||||||
|
#
|
||||||
|
#***********************************************************************
|
||||||
|
#
|
||||||
|
# Ticket #3838
|
||||||
|
#
|
||||||
|
# The ticket reports that the encoding is UTF8 on the DEFAULT VALUE of
|
||||||
|
# a column added using ALTER TABLE even when the database is UTF16.
|
||||||
|
# Verify that this has been fixed.
|
||||||
|
#
|
||||||
|
# $Id: tkt3838.test,v 1.1 2009/05/05 12:54:50 drh Exp $
|
||||||
|
|
||||||
|
set testdir [file dirname $argv0]
|
||||||
|
source $testdir/tester.tcl
|
||||||
|
|
||||||
|
|
||||||
|
do_test tkt3838-1.1 {
|
||||||
|
db eval {
|
||||||
|
PRAGMA encoding=UTF16;
|
||||||
|
CREATE TABLE t1(x);
|
||||||
|
INSERT INTO t1 VALUES(1);
|
||||||
|
ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT '999';
|
||||||
|
ALTER TABLE t1 ADD COLUMN c REAL DEFAULT '9e99';
|
||||||
|
ALTER TABLE t1 ADD COLUMN d TEXT DEFAULT 'xyzzy';
|
||||||
|
UPDATE t1 SET x=x+1;
|
||||||
|
SELECT * FROM t1;
|
||||||
|
}
|
||||||
|
} {2 999 9e+99 xyzzy}
|
||||||
|
|
||||||
|
finish_test
|
Loading…
x
Reference in New Issue
Block a user