Correctly set the length of the string in bytes when transforming an OP_String8 to OP_String in a utf-16 vdbe program. (CVS 2949)

FossilOrigin-Name: 69f996e0fac1dc50b8c43d5fa132f79776843819
This commit is contained in:
danielk1977
2006-01-15 14:11:48 +00:00
parent 21691543a3
commit 819d7f4735
4 changed files with 29 additions and 21 deletions
+17 -8
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.14 2006/01/14 08:02:28 danielk1977 Exp $
# $Id: alter.test,v 1.15 2006/01/15 14:11:49 danielk1977 Exp $
#
set testdir [file dirname $argv0]
@@ -552,11 +552,17 @@ do_test alter-5.3 {
db2 close
} {}
foreach tblname [execsql {
SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite%'
}] {
execsql "DROP TABLE \"$tblname\""
}
set ::tbl_name "abc\uABCDdef"
do_test alter-5.1 {
do_test alter-6.1 {
string length $::tbl_name
} {7}
do_test alter-5.2 {
do_test alter-6.2 {
execsql "
CREATE TABLE ${tbl_name}(a, b, c);
"
@@ -565,8 +571,11 @@ do_test alter-5.2 {
SELECT sql FROM sqlite_master WHERE oid = $::oid;
}
} "{CREATE TABLE ${::tbl_name}(a, b, c)}"
execsql "
SELECT * FROM ${::tbl_name}
"
set ::tbl_name2 "abcXdef"
do_test alter-5.2 {
do_test alter-6.3 {
execsql "
ALTER TABLE $::tbl_name RENAME TO $::tbl_name2
"
@@ -574,7 +583,7 @@ do_test alter-5.2 {
SELECT sql FROM sqlite_master WHERE oid = $::oid;
}
} "{CREATE TABLE '${::tbl_name2}'(a, b, c)}"
do_test alter-5.3 {
do_test alter-6.4 {
execsql "
ALTER TABLE $::tbl_name2 RENAME TO $::tbl_name
"
@@ -583,7 +592,7 @@ do_test alter-5.3 {
}
} "{CREATE TABLE '${::tbl_name}'(a, b, c)}"
set ::col_name ghi\1234\jkl
do_test alter-5.4 {
do_test alter-6.5 {
execsql "
ALTER TABLE $::tbl_name ADD COLUMN $::col_name VARCHAR
"
@@ -592,7 +601,7 @@ do_test alter-5.4 {
}
} "{CREATE TABLE '${::tbl_name}'(a, b, c, $::col_name VARCHAR)}"
set ::col_name2 B\3421\A
do_test alter-5.5 {
do_test alter-6.6 {
db close
sqlite3 db test.db
execsql "
@@ -602,7 +611,7 @@ do_test alter-5.5 {
SELECT sql FROM sqlite_master WHERE oid = $::oid;
}
} "{CREATE TABLE '${::tbl_name}'(a, b, c, $::col_name VARCHAR, $::col_name2)}"
do_test alter-5.6 {
do_test alter-6.7 {
execsql "
INSERT INTO ${::tbl_name} VALUES(1, 2, 3, 4, 5);
SELECT $::col_name, $::col_name2 FROM $::tbl_name;