aboutsummaryrefslogtreecommitdiff
path: root/src/vdbeaux.c
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2004-05-28 11:37:27 +0000
committerdanielk1977 <danielk1977@noemail.net>2004-05-28 11:37:27 +0000
commitcbb18d2256deeef705100cfd017de0752215634c (patch)
treeca593011acf212c6191624a375b28146e57d3fae /src/vdbeaux.c
parentd5788201543b12f62308732cb6ff31ab32933e72 (diff)
downloadsqlite-cbb18d2256deeef705100cfd017de0752215634c.tar.gz
sqlite-cbb18d2256deeef705100cfd017de0752215634c.zip
Allow CREATE TABLE and CREATE INDEX on attached databases. (CVS 1483)
FossilOrigin-Name: 4984a130ccf3b8e486941a5d0d0cc70a691f0dac
Diffstat (limited to 'src/vdbeaux.c')
-rw-r--r--src/vdbeaux.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index e643284b0..93a30fd30 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -610,7 +610,8 @@ int sqlite3VdbeList(
** If pOp is an OP_HexBlob opcode, then transform it to an OP_Blob
** opcode.
*/
-static int translateOp(Op *pOp){
+static int translateOp(Op *pOp, u8 enc){
+
if( pOp->opcode==OP_HexBlob ){
pOp->p1 = strlen(pOp->p3)/2;
if( pOp->p1 ){
@@ -627,6 +628,28 @@ static int translateOp(Op *pOp){
}
pOp->opcode = OP_Blob;
}
+
+ else if( pOp->opcode==OP_String8 ){
+ if( pOp->p3 ){
+ void *z = 0;
+ switch( enc ){
+ case TEXT_Utf16be:
+ z = sqlite3utf8to16be(pOp->p3, -1);
+ if( !z ) return SQLITE_NOMEM;
+ break;
+ case TEXT_Utf16le:
+ z = sqlite3utf8to16be(pOp->p3, -1);
+ if( !z ) return SQLITE_NOMEM;
+ break;
+ }
+ if( z ){
+ if( pOp->p3type==P3_DYNAMIC ) sqliteFree( pOp->p3 );
+
+ }
+ }
+ pOp->opcode = OP_String;
+ }
+
return SQLITE_OK;
}
@@ -704,7 +727,7 @@ void sqlite3VdbeMakeReady(
if( !isExplain ){
int i;
for(i=0; i<p->nOp; i++){
- translateOp(&p->aOp[i]);
+ translateOp(&p->aOp[i], p->db->enc);
}
}
}