| OLD | NEW |
| 1 /* | 1 /* |
| 2 ** 2001 September 15 | 2 ** 2001 September 15 |
| 3 ** | 3 ** |
| 4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
| 5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
| 6 ** | 6 ** |
| 7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
| 8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
| 9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
| 10 ** | 10 ** |
| 11 ************************************************************************* | 11 ************************************************************************* |
| 12 ** This file contains the sqlite3_get_table() and sqlite3_free_table() | 12 ** This file contains the sqlite3_get_table() and sqlite3_free_table() |
| 13 ** interface routines. These are just wrappers around the main | 13 ** interface routines. These are just wrappers around the main |
| 14 ** interface routine of sqlite3_exec(). | 14 ** interface routine of sqlite3_exec(). |
| 15 ** | 15 ** |
| 16 ** These routines are in a separate files so that they will not be linked | 16 ** These routines are in a separate files so that they will not be linked |
| 17 ** if they are not used. | 17 ** if they are not used. |
| 18 ** | |
| 19 ** $Id: table.c,v 1.40 2009/04/10 14:28:00 drh Exp $ | |
| 20 */ | 18 */ |
| 21 #include "sqliteInt.h" | 19 #include "sqliteInt.h" |
| 22 #include <stdlib.h> | 20 #include <stdlib.h> |
| 23 #include <string.h> | 21 #include <string.h> |
| 24 | 22 |
| 25 #ifndef SQLITE_OMIT_GET_TABLE | 23 #ifndef SQLITE_OMIT_GET_TABLE |
| 26 | 24 |
| 27 /* | 25 /* |
| 28 ** This structure is used to pass data from sqlite3_get_table() through | 26 ** This structure is used to pass data from sqlite3_get_table() through |
| 29 ** to the callback function is uses to build the result. | 27 ** to the callback function is uses to build the result. |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 int i, n; | 188 int i, n; |
| 191 azResult--; | 189 azResult--; |
| 192 assert( azResult!=0 ); | 190 assert( azResult!=0 ); |
| 193 n = SQLITE_PTR_TO_INT(azResult[0]); | 191 n = SQLITE_PTR_TO_INT(azResult[0]); |
| 194 for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); } | 192 for(i=1; i<n; i++){ if( azResult[i] ) sqlite3_free(azResult[i]); } |
| 195 sqlite3_free(azResult); | 193 sqlite3_free(azResult); |
| 196 } | 194 } |
| 197 } | 195 } |
| 198 | 196 |
| 199 #endif /* SQLITE_OMIT_GET_TABLE */ | 197 #endif /* SQLITE_OMIT_GET_TABLE */ |
| OLD | NEW |