SQLite

Check-in [7ae0fc7ea5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Remove unused branches from the vdbeapi.c module. (CVS 6489)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7ae0fc7ea55dc5b5fbeef20f476a00f619bd3c5c
User & Date: drh 2009-04-10 20:32:00.000
Context
2009-04-10
20:55
In the async test, make sure procedures do not get renamed over top of one another. (CVS 6490) (check-in: b6430cc429 user: drh tags: trunk)
20:32
Remove unused branches from the vdbeapi.c module. (CVS 6489) (check-in: 7ae0fc7ea5 user: drh tags: trunk)
18:41
Increase the error tolerance when verifying the approximate size of a pseudo-random database in backup_ioerr.test. Otherwise the test could fail depending on the PRNG seed. (CVS 6488) (check-in: deda5ab35e user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbeapi.c.
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
**    May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file contains code use to implement APIs that are part of the
** VDBE.
**
** $Id: vdbeapi.c,v 1.159 2009/04/09 14:02:44 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"

#if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT)
/*
** The following structure contains pointers to the end points of a







|







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
**    May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file contains code use to implement APIs that are part of the
** VDBE.
**
** $Id: vdbeapi.c,v 1.160 2009/04/10 20:32:00 drh Exp $
*/
#include "sqliteInt.h"
#include "vdbeInt.h"

#if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT)
/*
** The following structure contains pointers to the end points of a
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
  if( pVm && pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
    sqlite3_mutex_enter(pVm->db->mutex);
    vals = sqlite3_data_count(pStmt);
    pOut = &pVm->pResultSet[i];
  }else{
    /* ((double)0) In case of SQLITE_OMIT_FLOATING_POINT... */
    static const Mem nullMem = {{0}, (double)0, 0, "", 0, MEM_Null, SQLITE_NULL, 0, 0, 0 };
    if( pVm && pVm->db ){
      sqlite3_mutex_enter(pVm->db->mutex);
      sqlite3Error(pVm->db, SQLITE_RANGE, 0);
    }
    pOut = (Mem*)&nullMem;
  }
  return pOut;
}







|







760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
  if( pVm && pVm->pResultSet!=0 && i<pVm->nResColumn && i>=0 ){
    sqlite3_mutex_enter(pVm->db->mutex);
    vals = sqlite3_data_count(pStmt);
    pOut = &pVm->pResultSet[i];
  }else{
    /* ((double)0) In case of SQLITE_OMIT_FLOATING_POINT... */
    static const Mem nullMem = {{0}, (double)0, 0, "", 0, MEM_Null, SQLITE_NULL, 0, 0, 0 };
    if( pVm && ALWAYS(pVm->db) ){
      sqlite3_mutex_enter(pVm->db->mutex);
      sqlite3Error(pVm->db, SQLITE_RANGE, 0);
    }
    pOut = (Mem*)&nullMem;
  }
  return pOut;
}
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
  int useType
){
  const void *ret = 0;
  Vdbe *p = (Vdbe *)pStmt;
  int n;
  sqlite3 *db = p->db;
  

  if( p!=0 ){
    assert( db!=0 );
    n = sqlite3_column_count(pStmt);
    if( N<n && N>=0 ){
      N += useType*n;
      sqlite3_mutex_enter(db->mutex);
      assert( db->mallocFailed==0 );
      ret = xFunc(&p->aColName[N]);

      /* A malloc may have failed inside of the xFunc() call. If this
      ** is the case, clear the mallocFailed flag and return NULL.
      */
      if( db->mallocFailed ){
        db->mallocFailed = 0;
        ret = 0;
      }
      sqlite3_mutex_leave(db->mutex);
    }
  }
  return ret;
}

/*
** Return the name of the Nth column of the result set returned by SQL
** statement pStmt.







<
<
|
|
|
|
|
|
|
<
|
|
|
|
|
|
|
|
<







902
903
904
905
906
907
908


909
910
911
912
913
914
915

916
917
918
919
920
921
922
923

924
925
926
927
928
929
930
  int useType
){
  const void *ret = 0;
  Vdbe *p = (Vdbe *)pStmt;
  int n;
  sqlite3 *db = p->db;
  


  assert( db!=0 );
  n = sqlite3_column_count(pStmt);
  if( N<n && N>=0 ){
    N += useType*n;
    sqlite3_mutex_enter(db->mutex);
    assert( db->mallocFailed==0 );
    ret = xFunc(&p->aColName[N]);

     /* A malloc may have failed inside of the xFunc() call. If this
    ** is the case, clear the mallocFailed flag and return NULL.
    */
    if( db->mallocFailed ){
      db->mallocFailed = 0;
      ret = 0;
    }
    sqlite3_mutex_leave(db->mutex);

  }
  return ret;
}

/*
** Return the name of the Nth column of the result set returned by SQL
** statement pStmt.