SQLite

Check-in [a554bf6c70]
Login

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

Overview
Comment:Fix typo in vdbe.c from previous commit. (CVS 1448)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a554bf6c7075839f760a2ff944ac61b32cab0821
User & Date: danielk1977 2004-05-24 09:15:39.000
Context
2004-05-24
12:39
Non-aggregate SQL functions use sqlite_value* instead of const char * for argument values. (CVS 1449) (check-in: 1e47d7384d user: danielk1977 tags: trunk)
09:15
Fix typo in vdbe.c from previous commit. (CVS 1448) (check-in: a554bf6c70 user: danielk1977 tags: trunk)
09:10
Add the sqlite3_value_*() access functions. (CVS 1447) (check-in: 4bf925fcfc user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vdbe.c.
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** 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.324 2004/05/24 09:10:11 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"

/*







|







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
**
** Various scripts scan this source file in order to generate HTML
** documentation, headers files, or other derived files.  The formatting
** of the code in this file is, therefore, important.  See other comments
** 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.325 2004/05/24 09:15:39 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "os.h"
#include <ctype.h>
#include "vdbeInt.h"

/*
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
  return 0;
}

/*
** Return the number of bytes of data that will be returned by the
** equivalent sqlite3_value_data16() call.
*/
int sqlite3_value_bytes(sqlite3_value *pVal){
  if( sqlite3_value_data16(pVal) ){
    return ((Mem *)pVal)->n;
  }
  return 0;
}

/*
** Return the value of the sqlite_value* argument coerced to a 64-bit
** integer.
*/
long long int sqlite3_value_int(sqlite3_value *pVal){
  Mem *pMem = (Mem *)pVal;
  Integerify(pMem, flagsToEnc(pMem->flags));
  return pVal->i;
}

/*
** Return the value of the sqlite_value* argument coerced to a 64-bit
** IEEE float.
*/
double sqlite3_value_float(sqlite3_value*){
  pVal = &pVm->pTos[(1-vals)+i];
  Realify(pVal, flagsToEnc(pMem->flags));
  return pVal->r;
}

/*
** Return the number of bytes of data that will be returned by the
** equivalent sqlite3_column_data() call.
*/
int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){







|




















|
|
|
|







641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
  return 0;
}

/*
** Return the number of bytes of data that will be returned by the
** equivalent sqlite3_value_data16() call.
*/
int sqlite3_value_bytes16(sqlite3_value *pVal){
  if( sqlite3_value_data16(pVal) ){
    return ((Mem *)pVal)->n;
  }
  return 0;
}

/*
** Return the value of the sqlite_value* argument coerced to a 64-bit
** integer.
*/
long long int sqlite3_value_int(sqlite3_value *pVal){
  Mem *pMem = (Mem *)pVal;
  Integerify(pMem, flagsToEnc(pMem->flags));
  return pVal->i;
}

/*
** Return the value of the sqlite_value* argument coerced to a 64-bit
** IEEE float.
*/
double sqlite3_value_float(sqlite3_value *pVal){
  Mem *pMem = (Mem *)pVal;
  Realify(pMem, flagsToEnc(pMem->flags));
  return pMem->r;
}

/*
** Return the number of bytes of data that will be returned by the
** equivalent sqlite3_column_data() call.
*/
int sqlite3_column_bytes(sqlite3_stmt *pStmt, int i){
730
731
732
733
734
735
736

737
738
739
740
741
742
743

  vals = sqlite3_data_count(pStmt);
  if( i>=vals || i<0 ){
    sqlite3Error(pVm->db, SQLITE_RANGE, 0);
    return 0;
  }


  return sqlite3_value_float(pVal);
}

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







>







730
731
732
733
734
735
736
737
738
739
740
741
742
743
744

  vals = sqlite3_data_count(pStmt);
  if( i>=vals || i<0 ){
    sqlite3Error(pVm->db, SQLITE_RANGE, 0);
    return 0;
  }

  pVal = &pVm->pTos[(1-vals)+i];
  return sqlite3_value_float(pVal);
}

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