1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Provide "sqlite_schema" as an alternative name to the table that holds the

database schema.

FossilOrigin-Name: 61782a7ae3c25cf59d7a676cb295eb024d17c46e532ae78c6fe871a91d712fa9
This commit is contained in:
drh
2020-06-15 20:27:35 +00:00
parent 999429882e
commit 346a70ca1e
13 changed files with 127 additions and 89 deletions

View File

@@ -1011,18 +1011,24 @@ struct BusyHandler {
** is a special table that holds the names and attributes of all
** user tables and indices.
*/
#define MASTER_NAME "sqlite_master"
#define TEMP_MASTER_NAME "sqlite_temp_master"
//#define MASTER_NAME "sqlite_master"
//#define TEMP_MASTER_NAME "sqlite_temp_master"
#define DFLT_SCHEMA_TABLE "sqlite_master"
#define DFLT_TEMP_SCHEMA_TABLE "sqlite_temp_master"
#define ALT_SCHEMA_TABLE "sqlite_schema"
#define ALT_TEMP_SCHEMA_TABLE "sqlite_temp_schema"
/*
** The root-page of the master database table.
** The root-page of the schema table.
*/
#define MASTER_ROOT 1
#define SCHEMA_ROOT 1
/*
** The name of the schema table.
** The name of the schema table. The name is different for TEMP.
*/
#define SCHEMA_TABLE(x) ((!OMIT_TEMPDB)&&(x==1)?TEMP_MASTER_NAME:MASTER_NAME)
#define SCHEMA_TABLE(x) \
((!OMIT_TEMPDB)&&(x==1)?DFLT_TEMP_SCHEMA_TABLE:DFLT_SCHEMA_TABLE)
/*
** A convenience macro that returns the number of elements in
@@ -4144,7 +4150,7 @@ void sqlite3DeleteColumnNames(sqlite3*,Table*);
int sqlite3ColumnsFromExprList(Parse*,ExprList*,i16*,Column**);
void sqlite3SelectAddColumnTypeAndCollation(Parse*,Table*,Select*,char);
Table *sqlite3ResultSetOfSelect(Parse*,Select*,char);
void sqlite3OpenMasterTable(Parse *, int);
void sqlite3OpenSchemaTable(Parse *, int);
Index *sqlite3PrimaryKeyIndex(Table*);
i16 sqlite3TableColumnToIndex(Index*, i16);
#ifdef SQLITE_OMIT_GENERATED_COLUMNS