annotate sqlite/table.c @ 1456:6fe7ba6e5489 trunk

[svn] - Don't poll the config database if not using TCP sockets.
author nhjm449
date Mon, 31 Jul 2006 17:06:44 -0700
parents b6b61becdf4e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1434
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
1 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
2 ** 2001 September 15
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
3 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
4 ** The author disclaims copyright to this source code. In place of
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
5 ** a legal notice, here is a blessing:
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
6 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
7 ** May you do good and not evil.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
8 ** May you find forgiveness for yourself and forgive others.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
9 ** May you share freely, never taking more than you give.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
10 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
11 *************************************************************************
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
12 ** This file contains the sqlite3_get_table() and sqlite3_free_table()
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
13 ** interface routines. These are just wrappers around the main
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
14 ** interface routine of sqlite3_exec().
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
15 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
16 ** These routines are in a separate files so that they will not be linked
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
17 ** if they are not used.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
18 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
19 #include "sqliteInt.h"
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
20 #include <stdlib.h>
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
21 #include <string.h>
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
22
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
23 #ifndef SQLITE_OMIT_GET_TABLE
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
24
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
25 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
26 ** This structure is used to pass data from sqlite3_get_table() through
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
27 ** to the callback function is uses to build the result.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
28 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
29 typedef struct TabResult {
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
30 char **azResult;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
31 char *zErrMsg;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
32 int nResult;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
33 int nAlloc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
34 int nRow;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
35 int nColumn;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
36 int nData;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
37 int rc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
38 } TabResult;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
39
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
40 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
41 ** This routine is called once for each row in the result table. Its job
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
42 ** is to fill in the TabResult structure appropriately, allocating new
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
43 ** memory as necessary.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
44 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
45 static int sqlite3_get_table_cb(void *pArg, int nCol, char **argv, char **colv){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
46 TabResult *p = (TabResult*)pArg;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
47 int need;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
48 int i;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
49 char *z;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
50
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
51 /* Make sure there is enough space in p->azResult to hold everything
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
52 ** we need to remember from this invocation of the callback.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
53 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
54 if( p->nRow==0 && argv!=0 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
55 need = nCol*2;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
56 }else{
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
57 need = nCol;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
58 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
59 if( p->nData + need >= p->nAlloc ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
60 char **azNew;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
61 p->nAlloc = p->nAlloc*2 + need + 1;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
62 azNew = realloc( p->azResult, sizeof(char*)*p->nAlloc );
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
63 if( azNew==0 ) goto malloc_failed;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
64 p->azResult = azNew;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
65 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
66
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
67 /* If this is the first row, then generate an extra row containing
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
68 ** the names of all columns.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
69 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
70 if( p->nRow==0 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
71 p->nColumn = nCol;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
72 for(i=0; i<nCol; i++){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
73 if( colv[i]==0 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
74 z = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
75 }else{
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
76 z = malloc( strlen(colv[i])+1 );
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
77 if( z==0 ) goto malloc_failed;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
78 strcpy(z, colv[i]);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
79 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
80 p->azResult[p->nData++] = z;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
81 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
82 }else if( p->nColumn!=nCol ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
83 sqlite3SetString(&p->zErrMsg,
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
84 "sqlite3_get_table() called with two or more incompatible queries",
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
85 (char*)0);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
86 p->rc = SQLITE_ERROR;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
87 return 1;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
88 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
89
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
90 /* Copy over the row data
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
91 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
92 if( argv!=0 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
93 for(i=0; i<nCol; i++){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
94 if( argv[i]==0 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
95 z = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
96 }else{
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
97 z = malloc( strlen(argv[i])+1 );
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
98 if( z==0 ) goto malloc_failed;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
99 strcpy(z, argv[i]);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
100 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
101 p->azResult[p->nData++] = z;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
102 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
103 p->nRow++;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
104 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
105 return 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
106
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
107 malloc_failed:
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
108 p->rc = SQLITE_NOMEM;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
109 return 1;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
110 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
111
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
112 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
113 ** Query the database. But instead of invoking a callback for each row,
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
114 ** malloc() for space to hold the result and return the entire results
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
115 ** at the conclusion of the call.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
116 **
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
117 ** The result that is written to ***pazResult is held in memory obtained
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
118 ** from malloc(). But the caller cannot free this memory directly.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
119 ** Instead, the entire table should be passed to sqlite3_free_table() when
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
120 ** the calling procedure is finished using it.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
121 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
122 int sqlite3_get_table(
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
123 sqlite3 *db, /* The database on which the SQL executes */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
124 const char *zSql, /* The SQL to be executed */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
125 char ***pazResult, /* Write the result table here */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
126 int *pnRow, /* Write the number of rows in the result here */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
127 int *pnColumn, /* Write the number of columns of result here */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
128 char **pzErrMsg /* Write error messages here */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
129 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
130 int rc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
131 TabResult res;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
132 if( pazResult==0 ){ return SQLITE_ERROR; }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
133 *pazResult = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
134 if( pnColumn ) *pnColumn = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
135 if( pnRow ) *pnRow = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
136 res.zErrMsg = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
137 res.nResult = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
138 res.nRow = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
139 res.nColumn = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
140 res.nData = 1;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
141 res.nAlloc = 20;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
142 res.rc = SQLITE_OK;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
143 res.azResult = malloc( sizeof(char*)*res.nAlloc );
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
144 if( res.azResult==0 ) return SQLITE_NOMEM;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
145 res.azResult[0] = 0;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
146 rc = sqlite3_exec(db, zSql, sqlite3_get_table_cb, &res, pzErrMsg);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
147 if( res.azResult ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
148 assert( sizeof(res.azResult[0])>= sizeof(res.nData) );
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
149 res.azResult[0] = (char*)res.nData;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
150 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
151 if( rc==SQLITE_ABORT ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
152 sqlite3_free_table(&res.azResult[1]);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
153 if( res.zErrMsg ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
154 if( pzErrMsg ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
155 free(*pzErrMsg);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
156 *pzErrMsg = sqlite3_mprintf("%s",res.zErrMsg);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
157 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
158 sqliteFree(res.zErrMsg);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
159 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
160 db->errCode = res.rc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
161 return res.rc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
162 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
163 sqliteFree(res.zErrMsg);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
164 if( rc!=SQLITE_OK ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
165 sqlite3_free_table(&res.azResult[1]);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
166 return rc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
167 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
168 if( res.nAlloc>res.nData ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
169 char **azNew;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
170 azNew = realloc( res.azResult, sizeof(char*)*(res.nData+1) );
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
171 if( azNew==0 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
172 sqlite3_free_table(&res.azResult[1]);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
173 return SQLITE_NOMEM;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
174 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
175 res.nAlloc = res.nData+1;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
176 res.azResult = azNew;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
177 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
178 *pazResult = &res.azResult[1];
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
179 if( pnColumn ) *pnColumn = res.nColumn;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
180 if( pnRow ) *pnRow = res.nRow;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
181 return rc;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
182 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
183
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
184 /*
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
185 ** This routine frees the space the sqlite3_get_table() malloced.
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
186 */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
187 void sqlite3_free_table(
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
188 char **azResult /* Result returned from from sqlite3_get_table() */
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
189 ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
190 if( azResult ){
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
191 int i, n;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
192 azResult--;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
193 if( azResult==0 ) return;
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
194 n = (int)azResult[0];
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
195 for(i=1; i<n; i++){ if( azResult[i] ) free(azResult[i]); }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
196 free(azResult);
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
197 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
198 }
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
199
b6b61becdf4e [svn] - add sqlite/ directory
nenolod
parents:
diff changeset
200 #endif /* SQLITE_OMIT_GET_TABLE */