/ Check-in [54b30fe1]
Login

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

Overview
Comment:Fixes so that builds work with SQLITE_OMIT_VIRTUALTABLE=1. (CVS 3216)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 54b30fe1bdf0c9e690e12f07dcce4382e863bf02
User & Date: drh 2006-06-12 12:50:23
Context
2006-06-12
12:57
Patches to get things working better for OS2. Ticket #1836. (CVS 3217) check-in: 65c6e5e1 user: drh tags: trunk
12:50
Fixes so that builds work with SQLITE_OMIT_VIRTUALTABLE=1. (CVS 3216) check-in: 54b30fe1 user: drh tags: trunk
12:46
Get builds working again when extension loading is not enabled. Ticket #1839. (CVS 3215) check-in: 89ead801 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/test8.c.

9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
59
60
61
62
63
64
65

66

67
68
69
70
71
72
73
**    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.4 2006/06/12 12:08:45 danielk1977 Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include "os.h"
#include <stdlib.h>
#include <string.h>

................................................................................
    sqlite3_stmt *pStmt = 0;
    sqlite3_prepare(db, 
        "SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?",
        -1, &pStmt, 0);
    sqlite3_bind_text(pStmt, 1, argv[1], -1, 0);
    if( sqlite3_step(pStmt)==SQLITE_ROW ){
      const char *zCreateTable = sqlite3_column_text(pStmt, 0);

      sqlite3_declare_vtab(db, zCreateTable);

    } else {
      rc = SQLITE_ERROR;
    }
    sqlite3_finalize(pStmt);
  }

  return rc;







|







 







>

>







9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
..
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
**    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.5 2006/06/12 12:50:23 drh Exp $
*/
#include "sqliteInt.h"
#include "tcl.h"
#include "os.h"
#include <stdlib.h>
#include <string.h>

................................................................................
    sqlite3_stmt *pStmt = 0;
    sqlite3_prepare(db, 
        "SELECT sql FROM sqlite_master WHERE type = 'table' AND name = ?",
        -1, &pStmt, 0);
    sqlite3_bind_text(pStmt, 1, argv[1], -1, 0);
    if( sqlite3_step(pStmt)==SQLITE_ROW ){
      const char *zCreateTable = sqlite3_column_text(pStmt, 0);
#ifndef SQLITE_OMIT_VIRTUALTABLE
      sqlite3_declare_vtab(db, zCreateTable);
#endif
    } else {
      rc = SQLITE_ERROR;
    }
    sqlite3_finalize(pStmt);
  }

  return rc;

Changes to test/vtab1.test.

7
8
9
10
11
12
13
14
15
16
17





18
19
20
21
22
23
24
..
91
92
93
94
95
96
97
98
#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is creating and dropping virtual tables.
#
# $Id: vtab1.test,v 1.4 2006/06/12 12:08:45 danielk1977 Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl






# We cannot create a virtual table if the module has not
# been registered.
#
do_test vtab1-1.1 {
  catchsql {
    CREATE VIRTUAL TABLE t1 USING echo;
................................................................................
} [list         \
  0 a {} 0 {} 0 \
  1 b {} 0 {} 0 \
  2 c {} 0 {} 0 \
]

finish_test








|



>
>
>
>
>







 







<
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
..
96
97
98
99
100
101
102

#    May you find forgiveness for yourself and forgive others.
#    May you share freely, never taking more than you give.
#
#***********************************************************************
# This file implements regression tests for SQLite library.  The
# focus of this file is creating and dropping virtual tables.
#
# $Id: vtab1.test,v 1.5 2006/06/12 12:50:23 drh Exp $

set testdir [file dirname $argv0]
source $testdir/tester.tcl

ifcapable !vtab {
  finish_test
  return
}

# We cannot create a virtual table if the module has not
# been registered.
#
do_test vtab1-1.1 {
  catchsql {
    CREATE VIRTUAL TABLE t1 USING echo;
................................................................................
} [list         \
  0 a {} 0 {} 0 \
  1 b {} 0 {} 0 \
  2 c {} 0 {} 0 \
]

finish_test