/ Check-in [c27f23bb]
Login

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

Overview
Comment:Remove a NEVER() that can sometimes occur on an OOM error. (CVS 6744)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c27f23bbafd2e4fa453c8e3b83667ea8173183a7
User & Date: drh 2009-06-10 11:07:01
Context
2009-06-10
19:33
Do not let the reverse_unordered_selects pragma force the use of an index that would not otherwise be used. Ticket #3904. Also: remove an test which is always true. (CVS 6745) check-in: 78a391dc user: drh tags: trunk
11:07
Remove a NEVER() that can sometimes occur on an OOM error. (CVS 6744) check-in: c27f23bb user: drh tags: trunk
09:11
Minor tweak to balance_quick() to save a few instructions. (CVS 6743) check-in: 9ace9959 user: danielk1977 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/util.c.

10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.258 2009/06/05 14:17:23 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
#ifdef SQLITE_HAVE_ISNAN
# include <math.h>
#endif

................................................................................
**
** The value returned will never be negative.  Nor will it ever be greater
** than the actual length of the string.  For very long strings (greater
** than 1GiB) the value returned might be less than the true string length.
*/
int sqlite3Strlen30(const char *z){
  const char *z2 = z;
  if( NEVER(z==0) ) return 0;
  while( *z2 ){ z2++; }
  return 0x3fffffff & (int)(z2 - z);
}

/*
** Set the most recent error code and error string for the sqlite
** handle "db". The error code is set to "err_code".







|







 







|







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
...
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
**
*************************************************************************
** Utility functions used throughout sqlite.
**
** This file contains functions for allocating memory, comparing
** strings, and stuff like that.
**
** $Id: util.c,v 1.259 2009/06/10 11:07:01 drh Exp $
*/
#include "sqliteInt.h"
#include <stdarg.h>
#ifdef SQLITE_HAVE_ISNAN
# include <math.h>
#endif

................................................................................
**
** The value returned will never be negative.  Nor will it ever be greater
** than the actual length of the string.  For very long strings (greater
** than 1GiB) the value returned might be less than the true string length.
*/
int sqlite3Strlen30(const char *z){
  const char *z2 = z;
  if( z==0 ) return 0;
  while( *z2 ){ z2++; }
  return 0x3fffffff & (int)(z2 - z);
}

/*
** Set the most recent error code and error string for the sqlite
** handle "db". The error code is set to "err_code".