mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Fix a bug in UPDATE OR REPLACE that was introduced by check-in (999).
Also clean up some compiler warnings for VC++. (CVS 1005) FossilOrigin-Name: af6f2bdf59fb621ff3e1d061e429f01ebd7d0b42
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.93 2003/05/17 17:35:11 drh Exp $
|
||||
** $Id: btree.c,v 1.94 2003/06/04 16:24:39 drh Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@ -2477,7 +2477,7 @@ static int balance(Btree *pBt, MemPage *pPage, BtCursor *pCur){
|
||||
int minV = pgnoNew[i];
|
||||
int minI = i;
|
||||
for(j=i+1; j<k; j++){
|
||||
if( pgnoNew[j]<minV ){
|
||||
if( pgnoNew[j]<(unsigned)minV ){
|
||||
minI = j;
|
||||
minV = pgnoNew[j];
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
** This file contains C code routines that are called by the parser
|
||||
** to handle INSERT statements in SQLite.
|
||||
**
|
||||
** $Id: insert.c,v 1.87 2003/06/04 12:23:31 drh Exp $
|
||||
** $Id: insert.c,v 1.88 2003/06/04 16:24:39 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
|
||||
@ -748,7 +748,7 @@ void sqliteGenerateConstraintChecks(
|
||||
case OE_Replace: {
|
||||
sqliteGenerateRowIndexDelete(pParse->db, v, pTab, base, 0);
|
||||
if( isUpdate ){
|
||||
sqliteVdbeAddOp(v, OP_Dup, nCol+extra+1+hasTwoRecnos, 1);
|
||||
sqliteVdbeAddOp(v, OP_Dup, nCol+hasTwoRecnos, 1);
|
||||
sqliteVdbeAddOp(v, OP_MoveTo, base, 0);
|
||||
}
|
||||
seenReplace = 1;
|
||||
|
1
src/os.c
1
src/os.c
@ -1003,7 +1003,6 @@ int sqliteOsFileSize(OsFile *id, off_t *pSize){
|
||||
int isNT(void){
|
||||
static osType = 0; /* 0=unknown 1=win95 2=winNT */
|
||||
if( osType==0 ){
|
||||
int tmpOsType;
|
||||
OSVERSIONINFO sInfo;
|
||||
sInfo.dwOSVersionInfoSize = sizeof(sInfo);
|
||||
GetVersionEx(&sInfo);
|
||||
|
@ -18,7 +18,7 @@
|
||||
** file simultaneously, or one process from reading the database while
|
||||
** another is writing.
|
||||
**
|
||||
** @(#) $Id: pager.c,v 1.83 2003/04/25 15:37:58 drh Exp $
|
||||
** @(#) $Id: pager.c,v 1.84 2003/06/04 16:24:40 drh Exp $
|
||||
*/
|
||||
#include "os.h" /* Must be first to enable large file support */
|
||||
#include "sqliteInt.h"
|
||||
@ -496,7 +496,7 @@ static int pager_playback_one_page(Pager *pPager, OsFile *jfd, int format){
|
||||
if( pgRec.pgno==0 ){
|
||||
return SQLITE_DONE;
|
||||
}
|
||||
if( pgRec.pgno>pPager->dbSize ){
|
||||
if( pgRec.pgno>(unsigned)pPager->dbSize ){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
if( format>=JOURNAL_FORMAT_3 ){
|
||||
@ -944,7 +944,7 @@ int sqlitepager_truncate(Pager *pPager, Pgno nPage){
|
||||
rc = pager_errcode(pPager);
|
||||
return rc;
|
||||
}
|
||||
if( nPage>=pPager->dbSize ){
|
||||
if( nPage>=(unsigned)pPager->dbSize ){
|
||||
return SQLITE_OK;
|
||||
}
|
||||
syncAllPages(pPager);
|
||||
|
@ -36,7 +36,7 @@
|
||||
** in this file for details. If in doubt, do not deviate from existing
|
||||
** commenting and indentation practices when changing or adding code.
|
||||
**
|
||||
** $Id: vdbe.c,v 1.225 2003/06/02 23:14:13 drh Exp $
|
||||
** $Id: vdbe.c,v 1.226 2003/06/04 16:24:40 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <ctype.h>
|
||||
@ -2287,7 +2287,7 @@ case OP_MustBeInt: {
|
||||
/* Do nothing */
|
||||
}else if( aStack[tos].flags & STK_Real ){
|
||||
int i = aStack[tos].r;
|
||||
double r = i;
|
||||
double r = (double)i;
|
||||
if( r!=aStack[tos].r ){
|
||||
goto mismatch;
|
||||
}
|
||||
|
Reference in New Issue
Block a user