SQLite

Check-in [75be7d4988]
Login

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

Overview
Comment:Fix typo in test8.c. (CVS 3240)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 75be7d4988a3618ea9e3c1b65d5c05380ec7d25d
User & Date: danielk1977 2006-06-14 10:47:04.000
Context
2006-06-14
10:55
Add code to test8.c to check that the correct idxNum value is passed to the xFilter method. (CVS 3241) (check-in: 77bcaf99b3 user: danielk1977 tags: trunk)
10:47
Fix typo in test8.c. (CVS 3240) (check-in: 75be7d4988 user: danielk1977 tags: trunk)
10:38
Add some tests for sqlite3_load_extension(). (CVS 3239) (check-in: 402a77c43d user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/test8.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.
**
*************************************************************************
** Code for testing the virtual table interfaces.  This code
** is not included in the SQLite library.  It is used for automated
** testing of the SQLite library.
**
** $Id: test8.c,v 1.14 2006/06/14 07:41:32 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include "os.h"
#include <stdlib.h>
#include <string.h>








|







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.
**
*************************************************************************
** Code for testing the virtual table interfaces.  This code
** is not included in the SQLite library.  It is used for automated
** testing of the SQLite library.
**
** $Id: test8.c,v 1.15 2006/06/14 10:47:04 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include "os.h"
#include <stdlib.h>
#include <string.h>

441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
    char *zDir = pIdxInfo->aOrderBy->desc?"DESC":"ASC";
    zNew = sqlite3_mprintf("%s ORDER BY %s %s", zQuery, zCol, zDir);
    sqlite3_free(zQuery);
    zQuery = zNew;
    pIdxInfo->orderByConsumed = 1;
  }

  const int nOrderBy;        /* Number of terms in the ORDER BY clause */
  const struct sqlite3_index_orderby {
     int iColumn;              /* Column number */
     unsigned char desc;       /* True for DESC.  False for ASC. */
  } *const aOrderBy;         /* The ORDER BY clause */

  appendToEchoModule(pVtab->interp, "xBestIndex");;
  appendToEchoModule(pVtab->interp, zQuery);

  pIdxInfo->idxStr = zQuery;
  pIdxInfo->needToFreeIdxStr = 1;
  pIdxInfo->estimatedCost = 1.0;
  return SQLITE_OK;







<
<
<
<
<
<







441
442
443
444
445
446
447






448
449
450
451
452
453
454
    char *zDir = pIdxInfo->aOrderBy->desc?"DESC":"ASC";
    zNew = sqlite3_mprintf("%s ORDER BY %s %s", zQuery, zCol, zDir);
    sqlite3_free(zQuery);
    zQuery = zNew;
    pIdxInfo->orderByConsumed = 1;
  }







  appendToEchoModule(pVtab->interp, "xBestIndex");;
  appendToEchoModule(pVtab->interp, zQuery);

  pIdxInfo->idxStr = zQuery;
  pIdxInfo->needToFreeIdxStr = 1;
  pIdxInfo->estimatedCost = 1.0;
  return SQLITE_OK;