1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fixes and test improvements resulting from code coverage testing. (CVS 716)

FossilOrigin-Name: 66a0f6a8e25e3eeed78eba4b63b097f921c79d99
This commit is contained in:
drh
2002-08-15 01:26:09 +00:00
parent b27b83a941
commit 3d037a91a5
6 changed files with 83 additions and 46 deletions

View File

@ -25,7 +25,7 @@
** ROLLBACK
** PRAGMA
**
** $Id: build.c,v 1.107 2002/08/02 10:36:09 drh Exp $
** $Id: build.c,v 1.108 2002/08/15 01:26:09 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@ -461,35 +461,37 @@ void sqliteAddColumnType(Parse *pParse, Token *pFirst, Token *pLast){
}
z[j] = 0;
pCol->sortOrder = SQLITE_SO_NUM;
for(i=0; z[i]; i++){
switch( z[i] ){
case 'b':
case 'B': {
if( sqliteStrNICmp(&z[i],"blob",4)==0 ){
pCol->sortOrder = SQLITE_SO_TEXT;
return;
if( pParse->db->file_format>=4 ){
for(i=0; z[i]; i++){
switch( z[i] ){
case 'b':
case 'B': {
if( sqliteStrNICmp(&z[i],"blob",4)==0 ){
pCol->sortOrder = SQLITE_SO_TEXT;
return;
}
break;
}
break;
}
case 'c':
case 'C': {
if( sqliteStrNICmp(&z[i],"char",4)==0 ||
sqliteStrNICmp(&z[i],"clob",4)==0 ){
pCol->sortOrder = SQLITE_SO_TEXT;
return;
case 'c':
case 'C': {
if( sqliteStrNICmp(&z[i],"char",4)==0 ||
sqliteStrNICmp(&z[i],"clob",4)==0 ){
pCol->sortOrder = SQLITE_SO_TEXT;
return;
}
break;
}
break;
}
case 'x':
case 'X': {
if( i>=2 && sqliteStrNICmp(&z[i-2],"text",4)==0 ){
pCol->sortOrder = SQLITE_SO_TEXT;
return;
case 'x':
case 'X': {
if( i>=2 && sqliteStrNICmp(&z[i-2],"text",4)==0 ){
pCol->sortOrder = SQLITE_SO_TEXT;
return;
}
break;
}
default: {
break;
}
break;
}
default: {
break;
}
}
}

View File

@ -30,7 +30,7 @@
** But other routines are also provided to help in building up
** a program instruction by instruction.
**
** $Id: vdbe.c,v 1.168 2002/08/13 23:02:57 drh Exp $
** $Id: vdbe.c,v 1.169 2002/08/15 01:26:10 drh Exp $
*/
#include "sqliteInt.h"
#include <ctype.h>
@ -2806,10 +2806,11 @@ case OP_IncrKey: {
VERIFY( if( tos<0 ) goto bad_instruction );
if( Stringify(p, tos) ) goto no_mem;
if( aStack[tos].flags & STK_Static ){
char *zNew = sqliteMalloc( aStack[tos].n );
memcpy(zNew, zStack[tos], aStack[tos].n);
zStack[tos] = zNew;
aStack[tos].flags = STK_Str | STK_Dyn;
/* CANT HAPPEN. The IncrKey opcode is only applied to keys
** generated by MakeKey or MakeIdxKey and the results of those
** operands are always dynamic strings.
*/
goto abort_due_to_error;
}
zStack[tos][aStack[tos].n-1]++;
break;