Mercurial > hg > MonetDB
changeset 86151:1a99e3095157 userprofile
Merge with default branch.
| author | Sjoerd Mullender <sjoerd@acm.org> |
|---|---|
| date | Fri, 22 Jul 2022 17:36:47 +0200 |
| parents | 0b7fb3a2229c (current diff) 546a4b0f327a (diff) |
| children | 3fa7717ad6ef |
| files | |
| diffstat | 7 files changed, 89 insertions(+), 872 deletions(-) [+] |
line wrap: on
line diff
--- a/clients/odbc/driver/ODBCQueries.h +++ b/clients/odbc/driver/ODBCQueries.h @@ -136,7 +136,7 @@ "else " #t ".type_digits " \ "end as \"COLUMN_SIZE\"" -#define BUFFER_LENGTH(t) "case " #t ".type " \ +#define BUFFER_LENGTH(t) "cast(case " #t ".type " \ "when 'bigint' then 20 " \ "when 'char' then 2 * " #t ".type_digits " \ "when 'clob' then 2 * " #t ".type_digits " \ @@ -173,9 +173,9 @@ "when 'tinyint' then 4 " \ "when 'varchar' then 2 * " #t ".type_digits " \ "else " #t ".type_digits " \ - "end as \"BUFFER_LENGTH\"" + "end as integer) as \"BUFFER_LENGTH\"" -#define DECIMAL_DIGITS(t) "case " #t ".type " \ +#define DECIMAL_DIGITS(t) "cast(case " #t ".type " \ "when 'bigint' then 0 " \ "when 'day_interval' then 0 " \ "when 'decimal' then " #t ".type_scale " \ @@ -198,7 +198,7 @@ "when 'timetz' then " #t ".type_digits - 1 " \ "when 'tinyint' then 0 " \ "else cast(null as smallint) " \ - "end as \"DECIMAL_DIGITS\"" + "end as smallint) as \"DECIMAL_DIGITS\"" #define NUM_PREC_RADIX(t) "case " #t ".type " \ "when 'bigint' then 2 " \ @@ -289,10 +289,10 @@ SQL_CODE_TIME #define CHAR_OCTET_LENGTH(t) \ - "case " #t ".type " \ + "cast(case " #t ".type " \ "when 'char' then 2 * " #t ".type_digits " \ "when 'varchar' then 2 * " #t ".type_digits " \ "when 'clob' then 2 * " #t ".type_digits " \ "when 'blob' then " #t ".type_digits " \ "else cast(null as integer) " \ - "end as \"CHAR_OCTET_LENGTH\"" + "end as integer) as \"CHAR_OCTET_LENGTH\""
--- a/clients/odbc/driver/SQLProcedureColumns.c +++ b/clients/odbc/driver/SQLProcedureColumns.c @@ -153,10 +153,10 @@ MNDBProcedureColumns(ODBCStmt *stmt, "s.name as \"PROCEDURE_SCHEM\", " "p.name as \"PROCEDURE_NAME\", " "a.name as \"COLUMN_NAME\", " - "case when a.inout = 1 then %d " + "cast(case when a.inout = 1 then %d " "when p.type = %d then %d " "else %d " - "end as \"COLUMN_TYPE\", " + "end as smallint) as \"COLUMN_TYPE\", " DATA_TYPE(a) ", " TYPE_NAME(a) ", " COLUMN_SIZE(a) ", " @@ -169,12 +169,12 @@ MNDBProcedureColumns(ODBCStmt *stmt, SQL_DATA_TYPE(a) ", " SQL_DATETIME_SUB(a) ", " CHAR_OCTET_LENGTH(a) ", " - "case when p.type = 5 and a.inout = 0 then a.number + 1 " + "cast(case when p.type = 5 and a.inout = 0 then a.number + 1 " "when p.type = 5 and a.inout = 1 then a.number - x.maxout " "when p.type = 2 and a.inout = 1 then a.number + 1 " "when a.inout = 0 then 0 " "else a.number " - "end as \"ORDINAL_POSITION\", " + "end as integer) as \"ORDINAL_POSITION\", " "'' as \"IS_NULLABLE\", " /* Only the id value uniquely identifies a specific procedure. Include it to be able to differentiate between multiple
--- a/clients/odbc/driver/SQLSpecialColumns.c +++ b/clients/odbc/driver/SQLSpecialColumns.c @@ -424,7 +424,7 @@ MNDBSpecialColumns(ODBCStmt *stmt, assert(IdentifierType == SQL_ROWVER); /* The backend does not have such info available */ /* create just a query which results in zero rows */ - /* Note: pseudo_column is sql_pc_unknown is 0 */ + /* Note: PSEUDO_COLUMN is SQL_PC_UNKNOWN is 0 */ query = strdup("select cast(null as smallint) as \"SCOPE\", " "cast('' as varchar(1)) as \"COLUMN_NAME\", " "cast(1 as smallint) as \"DATA_TYPE\", "
--- a/clients/odbc/driver/SQLTables.c +++ b/clients/odbc/driver/SQLTables.c @@ -76,6 +76,7 @@ MNDBTables(ODBCStmt *stmt, CatalogName && strcmp((char *) CatalogName, SQL_ALL_CATALOGS) == 0) { /* Special case query to fetch all Catalog names. */ + /* All columns except the TABLE_CAT column contain NULLs. */ query = strdup("select cast(null as varchar(1)) as \"TABLE_CAT\", " "cast(null as varchar(1)) as \"TABLE_SCHEM\", " "cast(null as varchar(1)) as \"TABLE_NAME\", " @@ -89,13 +90,14 @@ MNDBTables(ODBCStmt *stmt, SchemaName && strcmp((char *) SchemaName, SQL_ALL_SCHEMAS) == 0) { /* Special case query to fetch all Schema names. */ + /* All columns except the TABLE_SCHEM column contain NULLs. */ query = strdup("select cast(null as varchar(1)) as \"TABLE_CAT\", " "name as \"TABLE_SCHEM\", " "cast(null as varchar(1)) as \"TABLE_NAME\", " "cast(null as varchar(1)) as \"TABLE_TYPE\", " /* ODBC says remarks column contains * NULL even though MonetDB supports - * schema remarks */ + * schema remarks. We must comply with ODBC */ "cast(null as varchar(1)) as \"REMARKS\" " "from sys.schemas order by \"TABLE_SCHEM\""); if (query == NULL) @@ -106,6 +108,7 @@ MNDBTables(ODBCStmt *stmt, TableType && strcmp((char *) TableType, SQL_ALL_TABLE_TYPES) == 0) { /* Special case query to fetch all Table type names. */ + /* All columns except the TABLE_TYPE column contain NULLs. */ query = strdup("select cast(null as varchar(1)) as \"TABLE_CAT\", " "cast(null as varchar(1)) as \"TABLE_SCHEM\", " "cast(null as varchar(1)) as \"TABLE_NAME\", " @@ -196,7 +199,10 @@ MNDBTables(ODBCStmt *stmt, } if (NameLength4 > 0) { - /* filtering requested on table type */ + /* filtering requested on table type(s) + * each table type can be enclosed in single quotation marks (') + * or unquoted, for example, 'TABLE', 'VIEW' or TABLE, VIEW. + */ char buf[32]; /* the longest string is "GLOBAL TEMPORARY TABLE" */ int i; size_t j;
--- a/clients/odbc/tests/ODBCmetadata.c +++ b/clients/odbc/tests/ODBCmetadata.c @@ -363,10 +363,25 @@ main(int argc, char **argv) check(ret, SQL_HANDLE_DBC, dbc, "SQLExecDirect (add privileges script)"); // TODO add user procedures / functions to test SQLProcedures() and SQLProcedureColumns() more - // TODO add SQL COMMENT to tables, columns, indexes, procedures, functions to fetch (and test) data in the REMARKS result column + + // set COMMENT ON schema, tables, columns, indexes, procedures and functions to fetch (and test) data in the REMARKS result column + ret = SQLExecDirect(stmt, (SQLCHAR *) + "COMMENT ON SCHEMA odbctst IS 'odbctst schema comment';\n" + "COMMENT ON TABLE odbctst.pk_uc IS 'odbctst.pk_uc table comment';\n" + "COMMENT ON TABLE odbctst.nopk_twoucs IS 'odbctst.nopk_twoucs table comment';\n" + "COMMENT ON COLUMN odbctst.nopk_twoucs.id2 IS 'odbctst.nopk_twoucs.id2 column comment';\n" + "COMMENT ON COLUMN odbctst.nopk_twoucs.name2 IS 'odbctst.nopk_twoucs.name2 column comment';\n" + "COMMENT ON INDEX odbctst.pk_uc_i IS 'odbctst.pk_uc_i index comment';\n" + "COMMENT ON INDEX odbctst.nopk_twoucs_i IS 'odbctst.nopk_twoucs_i index comment';\n" + "COMMENT ON PROCEDURE sys.analyze() IS 'sys.analyze() procedure comment';\n" + "COMMENT ON FUNCTION sys.sin(double) IS 'sys.sin(double) function comment';\n" + "COMMENT ON FUNCTION sys.env() IS 'sys.env() function comment';\n" + "COMMENT ON FUNCTION sys.statistics() IS 'sys.statistics() function comment';\n" + , SQL_NTS); + check(ret, SQL_HANDLE_DBC, dbc, "SQLExecDirect (add comments script)"); /* run actual metadata query tests */ - // All catalogs query + // All catalogs query. MonetDB should return no rows. Catalog qualifier not supported. ret = SQLTables(stmt, (SQLCHAR*)SQL_ALL_CATALOGS, SQL_NTS, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"", SQL_NTS); @@ -376,7 +391,7 @@ main(int argc, char **argv) "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS\n" "WVARCHAR(1) WVARCHAR(1) WVARCHAR(1) WVARCHAR(1) WVARCHAR(1)\n"); - // All schemas query + // All schemas query. All columns except the TABLE_SCHEM column should contain NULLs. ret = SQLTables(stmt, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)SQL_ALL_SCHEMAS, SQL_NTS, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"", SQL_NTS); @@ -394,7 +409,7 @@ main(int argc, char **argv) "NULL wlc NULL NULL NULL\n" "NULL wlr NULL NULL NULL\n"); - // All table types query + // All table types query. All columns except the TABLE_TYPE column should contain NULLs. ret = SQLTables(stmt, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)SQL_ALL_TABLE_TYPES, SQL_NTS); @@ -427,11 +442,28 @@ main(int argc, char **argv) "NULL odbctst LINES TABLE NULL\n" "NULL odbctst ORDERS TABLE NULL\n" "NULL odbctst fk2c TABLE NULL\n" - "NULL odbctst nopk_twoucs TABLE NULL\n" + "NULL odbctst nopk_twoucs TABLE odbctst.nopk_twoucs table comment\n" "NULL odbctst pk2c TABLE NULL\n" - "NULL odbctst pk_uc TABLE NULL\n"); + "NULL odbctst pk_uc TABLE odbctst.pk_uc table comment\n"); - // All user tables and views + // All user tables and views in schema odbctst + ret = SQLTables(stmt, (SQLCHAR*)"", SQL_NTS, + (SQLCHAR*)"odbctst", SQL_NTS, (SQLCHAR*)"%", SQL_NTS, + (SQLCHAR*)"'TABLE' , 'VIEW'", SQL_NTS); // using quotes around the type names + compareResult(stmt, ret, "SQLTables (odbctst, %, 'TABLE' , 'VIEW')", + "Resultset with 5 columns\n" + "Resultset with 7 rows\n" + "TABLE_CAT TABLE_SCHEM TABLE_NAME TABLE_TYPE REMARKS\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(1024) WVARCHAR(25) WVARCHAR(65000)\n" + "NULL odbctst CUSTOMERS TABLE NULL\n" + "NULL odbctst LINES TABLE NULL\n" + "NULL odbctst ORDERS TABLE NULL\n" + "NULL odbctst fk2c TABLE NULL\n" + "NULL odbctst nopk_twoucs TABLE odbctst.nopk_twoucs table comment\n" + "NULL odbctst pk2c TABLE NULL\n" + "NULL odbctst pk_uc TABLE odbctst.pk_uc table comment\n"); + + // All user tables and views in all schemas ret = SQLTables(stmt, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"%", SQL_NTS, (SQLCHAR*)"%", SQL_NTS, (SQLCHAR*)"TABLE, VIEW, GLOBAL TEMPORARY TABLE, LOCAL TEMPORARY TABLE", SQL_NTS); @@ -448,9 +480,9 @@ main(int argc, char **argv) "NULL odbctst LINES TABLE NULL\n" "NULL odbctst ORDERS TABLE NULL\n" "NULL odbctst fk2c TABLE NULL\n" - "NULL odbctst nopk_twoucs TABLE NULL\n" + "NULL odbctst nopk_twoucs TABLE odbctst.nopk_twoucs table comment\n" "NULL odbctst pk2c TABLE NULL\n" - "NULL odbctst pk_uc TABLE NULL\n"); + "NULL odbctst pk_uc TABLE odbctst.pk_uc table comment\n"); // All columns of odbctst tables containg 'pk' in their name ret = SQLColumns(stmt, (SQLCHAR*)"", SQL_NTS, @@ -460,9 +492,9 @@ main(int argc, char **argv) "Resultset with 18 columns\n" "Resultset with 7 rows\n" "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE\n" - "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(1024) WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(2048) SMALLINT SMALLINT BIGINT INTEGER WVARCHAR(3)\n" - "NULL odbctst nopk_twoucs id2 4 INTEGER 32 11 0 2 0 NULL NULL 4 NULL NULL 1 NO\n" - "NULL odbctst nopk_twoucs name2 -9 VARCHAR 99 198 NULL NULL 1 NULL NULL -9 NULL 198 2 YES\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(1024) WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(2048) SMALLINT SMALLINT INTEGER INTEGER WVARCHAR(3)\n" + "NULL odbctst nopk_twoucs id2 4 INTEGER 32 11 0 2 0 odbctst.nopk_twoucs.id2 column comment NULL 4 NULL NULL 1 NO\n" + "NULL odbctst nopk_twoucs name2 -9 VARCHAR 99 198 NULL NULL 1 odbctst.nopk_twoucs.name2 column comment NULL -9 NULL 198 2 YES\n" "NULL odbctst pk2c pkc1 4 INTEGER 32 11 0 2 0 NULL NULL 4 NULL NULL 1 NO\n" "NULL odbctst pk2c pkc2 -9 VARCHAR 99 198 NULL NULL 0 NULL NULL -9 NULL 198 2 NO\n" "NULL odbctst pk2c name1 -9 VARCHAR 99 198 NULL NULL 1 NULL NULL -9 NULL 198 3 YES\n" @@ -477,7 +509,7 @@ main(int argc, char **argv) "Resultset with 18 columns\n" "Resultset with 8 rows\n" "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE\n" - "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(1024) WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(2048) SMALLINT SMALLINT BIGINT INTEGER WVARCHAR(3)\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(1024) WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(2048) SMALLINT SMALLINT INTEGER INTEGER WVARCHAR(3)\n" "NULL tmp glbl_nopk_twoucs id2 4 INTEGER 32 11 0 2 0 NULL NULL 4 NULL NULL 1 NO\n" "NULL tmp glbl_nopk_twoucs name2 -9 VARCHAR 99 198 NULL NULL 1 NULL NULL -9 NULL 198 2 YES\n" "NULL tmp glbl_pk_uc id1 4 INTEGER 32 11 0 2 0 NULL NULL 4 NULL NULL 1 NO\n" @@ -495,12 +527,21 @@ main(int argc, char **argv) "Resultset with 18 columns\n" "Resultset with 4 rows\n" "TABLE_CAT TABLE_SCHEM TABLE_NAME COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE\n" - "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(1024) WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(2048) SMALLINT SMALLINT BIGINT INTEGER WVARCHAR(3)\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(1024) WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(2048) SMALLINT SMALLINT INTEGER INTEGER WVARCHAR(3)\n" "NULL tmp glbl_nopk_twoucs name2 -9 VARCHAR 99 198 NULL NULL 1 NULL NULL -9 NULL 198 2 YES\n" "NULL tmp glbl_pk_uc name1 -9 VARCHAR 99 198 NULL NULL 1 NULL NULL -9 NULL 198 2 YES\n" "NULL tmp tmp_nopk_twoucs name2 -9 VARCHAR 99 198 NULL NULL 1 NULL NULL -9 NULL 198 2 YES\n" "NULL tmp tmp_pk_uc name1 -9 VARCHAR 99 198 NULL NULL 1 NULL NULL -9 NULL 198 2 YES\n"); + ret = SQLSpecialColumns(stmt, SQL_ROWVER, (SQLCHAR*)NULL, 0, + (SQLCHAR*)"%", SQL_NTS, (SQLCHAR*)"%", SQL_NTS, + SQL_SCOPE_SESSION, SQL_NO_NULLS); + compareResult(stmt, ret, "SQLSpecialColumns (%, %, SQL_ROWVER)", + "Resultset with 8 columns\n" + "Resultset with 0 rows\n" + "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" + "SMALLINT WVARCHAR(1) SMALLINT WVARCHAR(4) INTEGER INTEGER SMALLINT SMALLINT\n"); + // sys.table_types ret = SQLPrimaryKeys(stmt, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"sys", SQL_NTS, (SQLCHAR*)"table_types", SQL_NTS); @@ -518,7 +559,7 @@ main(int argc, char **argv) "Resultset with 8 columns\n" "Resultset with 1 rows\n" "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" - "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT\n" + "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT\n" "1 table_type_id 5 SMALLINT 16 6 0 1\n"); ret = SQLStatistics(stmt, (SQLCHAR*)"", SQL_NTS, @@ -577,7 +618,7 @@ main(int argc, char **argv) "Resultset with 8 columns\n" "Resultset with 1 rows\n" "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" - "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT\n" + "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT\n" "1 id1 4 INTEGER 32 11 0 1\n"); ret = SQLSpecialColumns(stmt, SQL_ROWVER, (SQLCHAR*)"", SQL_NTS, @@ -651,7 +692,7 @@ main(int argc, char **argv) "Resultset with 8 columns\n" "Resultset with 1 rows\n" "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" - "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT\n" + "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT\n" "1 id1 4 INTEGER 32 11 0 1\n"); ret = SQLStatistics(stmt, (SQLCHAR*)"", SQL_NTS, @@ -717,7 +758,7 @@ main(int argc, char **argv) "Resultset with 8 columns\n" "Resultset with 1 rows\n" "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" - "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT\n" + "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT\n" "1 id1 4 INTEGER 32 11 0 1\n"); ret = SQLStatistics(stmt, (SQLCHAR*)"", SQL_NTS, @@ -782,7 +823,7 @@ main(int argc, char **argv) "Resultset with 8 columns\n" "Resultset with 1 rows\n" "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" - "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT\n" + "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT\n" "1 id2 4 INTEGER 32 11 0 1\n"); ret = SQLStatistics(stmt, (SQLCHAR*)"", SQL_NTS, @@ -845,7 +886,7 @@ main(int argc, char **argv) "Resultset with 8 columns\n" "Resultset with 1 rows\n" "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" - "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT\n" + "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT\n" "1 id2 4 INTEGER 32 11 0 1\n"); ret = SQLStatistics(stmt, (SQLCHAR*)"", SQL_NTS, @@ -910,7 +951,7 @@ main(int argc, char **argv) "Resultset with 8 columns\n" "Resultset with 1 rows\n" "SCOPE COLUMN_NAME DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS PSEUDO_COLUMN\n" - "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT\n" + "SMALLINT WVARCHAR(1024) SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT\n" "1 id2 4 INTEGER 32 11 0 1\n"); ret = SQLStatistics(stmt, (SQLCHAR*)"", SQL_NTS, @@ -1063,7 +1104,7 @@ main(int argc, char **argv) "Resultset with 4 rows\n" "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME NUM_INPUT_PARAMS NUM_OUTPUT_PARAMS NUM_RESULT_SETS REMARKS PROCEDURE_TYPE SPECIFIC_NAME\n" "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) TINYINT TINYINT TINYINT WVARCHAR(65000) SMALLINT WVARCHAR(10)\n" - "NULL sys analyze 0 0 0 NULL 1 replacedId\n" + "NULL sys analyze 0 0 0 sys.analyze() procedure comment 1 replacedId\n" "NULL sys analyze 0 0 0 NULL 1 replacedId\n" "NULL sys analyze 0 0 0 NULL 1 replacedId\n" "NULL sys analyze 0 0 0 NULL 1 replacedId\n"); @@ -1075,7 +1116,7 @@ main(int argc, char **argv) "Resultset with 20 columns\n" "Resultset with 6 rows\n" "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME COLUMN_NAME COLUMN_TYPE DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SPECIFIC_NAME\n" - "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) TINYINT SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT BIGINT BIGINT WCHAR WVARCHAR(10)\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) SMALLINT SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT INTEGER INTEGER WCHAR WVARCHAR(10)\n" "NULL sys analyze sname 1 -9 VARCHAR 1024 2048 NULL NULL 2 NULL NULL -9 NULL 2048 1 replacedId\n" "NULL sys analyze sname 1 -9 VARCHAR 1024 2048 NULL NULL 2 NULL NULL -9 NULL 2048 1 replacedId\n" "NULL sys analyze tname 1 -9 VARCHAR 1024 2048 NULL NULL 2 NULL NULL -9 NULL 2048 2 replacedId\n" @@ -1092,7 +1133,7 @@ main(int argc, char **argv) "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME NUM_INPUT_PARAMS NUM_OUTPUT_PARAMS NUM_RESULT_SETS REMARKS PROCEDURE_TYPE SPECIFIC_NAME\n" "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) TINYINT TINYINT TINYINT WVARCHAR(65000) SMALLINT WVARCHAR(10)\n" "NULL sys sin 0 0 0 NULL 2 replacedId\n" - "NULL sys sin 0 0 0 NULL 2 replacedId\n"); + "NULL sys sin 0 0 0 sys.sin(double) function comment 2 replacedId\n"); ret = SQLProcedureColumns(stmt, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"sys", SQL_NTS, (SQLCHAR*)"sin", SQL_NTS, @@ -1101,7 +1142,7 @@ main(int argc, char **argv) "Resultset with 20 columns\n" "Resultset with 4 rows\n" "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME COLUMN_NAME COLUMN_TYPE DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SPECIFIC_NAME\n" - "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) TINYINT SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT BIGINT BIGINT WCHAR WVARCHAR(10)\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) SMALLINT SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT INTEGER INTEGER WCHAR WVARCHAR(10)\n" "NULL sys sin arg_1 1 7 REAL 24 14 7 2 2 NULL NULL 7 NULL NULL 1 replacedId\n" "NULL sys sin res_0 5 7 REAL 24 14 7 2 2 NULL NULL 7 NULL NULL 0 replacedId\n" "NULL sys sin arg_1 1 8 DOUBLE 53 24 15 2 2 NULL NULL 8 NULL NULL 1 replacedId\n" @@ -1115,7 +1156,7 @@ main(int argc, char **argv) "Resultset with 1 rows\n" "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME NUM_INPUT_PARAMS NUM_OUTPUT_PARAMS NUM_RESULT_SETS REMARKS PROCEDURE_TYPE SPECIFIC_NAME\n" "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) TINYINT TINYINT TINYINT WVARCHAR(65000) SMALLINT WVARCHAR(10)\n" - "NULL sys env 0 0 0 NULL 2 replacedId\n"); + "NULL sys env 0 0 0 sys.env() function comment 2 replacedId\n"); ret = SQLProcedureColumns(stmt, (SQLCHAR*)"", SQL_NTS, (SQLCHAR*)"sys", SQL_NTS, (SQLCHAR*)"env", SQL_NTS, @@ -1124,7 +1165,7 @@ main(int argc, char **argv) "Resultset with 20 columns\n" "Resultset with 2 rows\n" "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME COLUMN_NAME COLUMN_TYPE DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SPECIFIC_NAME\n" - "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) TINYINT SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT BIGINT BIGINT WCHAR WVARCHAR(10)\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) SMALLINT SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT INTEGER INTEGER WCHAR WVARCHAR(10)\n" "NULL sys env name 3 -9 VARCHAR 1024 2048 NULL NULL 2 NULL NULL -9 NULL 2048 1 replacedId\n" "NULL sys env value 3 -9 VARCHAR 2048 4096 NULL NULL 2 NULL NULL -9 NULL 4096 2 replacedId\n"); @@ -1136,7 +1177,7 @@ main(int argc, char **argv) "Resultset with 4 rows\n" "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME NUM_INPUT_PARAMS NUM_OUTPUT_PARAMS NUM_RESULT_SETS REMARKS PROCEDURE_TYPE SPECIFIC_NAME\n" "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) TINYINT TINYINT TINYINT WVARCHAR(65000) SMALLINT WVARCHAR(10)\n" - "NULL sys statistics 0 0 0 NULL 2 replacedId\n" + "NULL sys statistics 0 0 0 sys.statistics() function comment 2 replacedId\n" "NULL sys statistics 0 0 0 NULL 2 replacedId\n" "NULL sys statistics 0 0 0 NULL 2 replacedId\n" "NULL sys statistics 0 0 0 NULL 2 replacedId\n"); @@ -1148,7 +1189,7 @@ main(int argc, char **argv) "Resultset with 20 columns\n" "Resultset with 58 rows\n" "PROCEDURE_CAT PROCEDURE_SCHEM PROCEDURE_NAME COLUMN_NAME COLUMN_TYPE DATA_TYPE TYPE_NAME COLUMN_SIZE BUFFER_LENGTH DECIMAL_DIGITS NUM_PREC_RADIX NULLABLE REMARKS COLUMN_DEF SQL_DATA_TYPE SQL_DATETIME_SUB CHAR_OCTET_LENGTH ORDINAL_POSITION IS_NULLABLE SPECIFIC_NAME\n" - "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) TINYINT SMALLINT WCHAR(25) INTEGER BIGINT BIGINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT BIGINT BIGINT WCHAR WVARCHAR(10)\n" + "WVARCHAR(1) WVARCHAR(1024) WVARCHAR(256) WVARCHAR(256) SMALLINT SMALLINT WCHAR(25) INTEGER INTEGER SMALLINT SMALLINT SMALLINT WVARCHAR(65000) WVARCHAR(1) SMALLINT SMALLINT INTEGER INTEGER WCHAR WVARCHAR(10)\n" // 0 input argument and 13 result columns of sys.statistics() "NULL sys statistics column_id 3 4 INTEGER 32 11 0 2 2 NULL NULL 4 NULL NULL 1 replacedId\n" "NULL sys statistics schema 3 -9 VARCHAR 1024 2048 NULL NULL 2 NULL NULL -9 NULL 2048 2 replacedId\n"
deleted file mode 100644 --- a/sql/test/drupal/database.monetdb +++ /dev/null @@ -1,827 +0,0 @@ - --- --- Table structure for access --- - -CREATE TABLE access ( - aid SERIAL, - mask varchar(255) NOT NULL default '', - type varchar(255) NOT NULL default '', - status smallint NOT NULL default '0', - PRIMARY KEY (aid) -); - --- --- Table structure for accesslog --- - -CREATE TABLE accesslog ( - aid SERIAL, - mask varchar(255) NOT NULL default '', - title varchar(255) default NULL, - path varchar(255) default NULL, - url varchar(255) default NULL, - hostname varchar(128) default NULL, - uid integer default '0', - timestamp integer NOT NULL default '0', - PRIMARY KEY (aid) -); -CREATE INDEX accesslog_timestamp_idx ON accesslog (timestamp); --- --- Table structure for table 'aggregator_category' --- - -CREATE SEQUENCE aggregator_category_cid_seq as integer; - -CREATE TABLE aggregator_category ( - cid INTEGER, - title varchar(255) NOT NULL default '', - description text, - block smallint NOT NULL default '0', - PRIMARY KEY (cid), - UNIQUE (title) -); - --- --- Table structure for table 'aggregator_category_feed' --- - -CREATE TABLE aggregator_category_feed ( - fid integer NOT NULL default '0', - cid integer NOT NULL default '0', - PRIMARY KEY (fid,cid) -); - --- --- Table structure for table 'aggregator_category_item' --- - -CREATE TABLE aggregator_category_item ( - iid integer NOT NULL default '0', - cid integer NOT NULL default '0', - PRIMARY KEY (iid,cid) -); - --- --- Table structure for table 'aggregator_feed' --- -CREATE SEQUENCE aggregator_feed_fid_seq as integer; - -CREATE TABLE aggregator_feed ( - fid integer, - title varchar(255) NOT NULL default '', - url varchar(255) NOT NULL default '', - refresh integer NOT NULL default '0', - checked integer NOT NULL default '0', - link varchar(255) NOT NULL default '', - description text, - image text, - etag varchar(255) NOT NULL default '', - modified integer NOT NULL default '0', - block smallint NOT NULL default '0', - PRIMARY KEY (fid), - UNIQUE (url), - UNIQUE (title) -); - --- --- Table structure for table 'aggregator_item' --- - -CREATE TABLE aggregator_item ( - iid SERIAL, - fid integer NOT NULL default '0', - title varchar(255) NOT NULL default '', - link varchar(255) NOT NULL default '', - author varchar(255) NOT NULL default '', - description text, - timestamp integer default NULL, - PRIMARY KEY (iid) -); - --- --- Table structure for authmap --- - -CREATE TABLE authmap ( - aid SERIAL, - uid integer NOT NULL default '0', - authname varchar(128) NOT NULL default '', - module varchar(128) NOT NULL default '', - PRIMARY KEY (aid), - UNIQUE (authname) -); - --- --- Table structure for blocks --- - -CREATE TABLE blocks ( - module varchar(64) NOT NULL default '', - delta varchar(32) NOT NULL default '0', - status smallint NOT NULL default '0', - weight smallint NOT NULL default '0', - region smallint NOT NULL default '0', - custom smallint NOT NULL default '0', - throttle smallint NOT NULL default '0', - visibility smallint NOT NULL default '0', - pages text NOT NULL default '', - types text NOT NULL default '' -); - --- --- Table structure for book --- - -CREATE TABLE book ( - nid integer NOT NULL default '0', - parent integer NOT NULL default '0', - weight smallint NOT NULL default '0', - log text default '', - PRIMARY KEY (nid) -); -CREATE INDEX book_nid_idx ON book(nid); -CREATE INDEX book_parent ON book(parent); - --- --- Table structure for boxes --- - -CREATE TABLE boxes ( - bid SERIAL, - title varchar(64) NOT NULL default '', - body text default '', - info varchar(128) NOT NULL default '', - format smallint NOT NULL default '0', - PRIMARY KEY (bid), - UNIQUE (info), - UNIQUE (title) -); - --- --- Table structure for cache --- - -CREATE TABLE cache ( - cid varchar(255) NOT NULL default '', - data text default '', - expire integer NOT NULL default '0', - created integer NOT NULL default '0', - headers text default '', - PRIMARY KEY (cid) -); -CREATE INDEX cache_expire_idx ON cache(expire); - --- --- Table structure for comments --- - -CREATE TABLE comments ( - cid SERIAL, - pid integer NOT NULL default '0', - nid integer NOT NULL default '0', - uid integer NOT NULL default '0', - subject varchar(64) NOT NULL default '', - comment text NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp integer NOT NULL default '0', - score integer NOT NULL default '0', - status smallint NOT NULL default '0', - format smallint NOT NULL default '0', - thread varchar(255) default '', - users text default '', - name varchar(60) default NULL, - mail varchar(64) default NULL, - homepage varchar(255) default NULL, - PRIMARY KEY (cid) -); -CREATE INDEX comments_nid_idx ON comments(nid); - --- --- Table structre for table 'node_last_comment' --- - -CREATE TABLE node_comment_statistics ( - nid integer NOT NULL, - last_comment_timestamp integer NOT NULL default '0', - last_comment_name varchar(60) default NULL, - last_comment_uid integer NOT NULL default '0', - comment_count integer NOT NULL default '0', - PRIMARY KEY (nid) -); -CREATE INDEX node_comment_statistics_timestamp_idx ON node_comment_statistics(last_comment_timestamp); - --- --- Table structure for directory --- - -CREATE TABLE directory ( - link varchar(255) NOT NULL default '', - name varchar(128) NOT NULL default '', - mail varchar(128) NOT NULL default '', - slogan text NOT NULL default '', - mission text NOT NULL default '', - timestamp integer NOT NULL default '0', - PRIMARY KEY (link) -); - --- --- Table structure for table 'files' --- - -CREATE TABLE files ( - fid SERIAL, - nid integer NOT NULL default '0', - filename varchar(255) NOT NULL default '', - filepath varchar(255) NOT NULL default '', - filemime varchar(255) NOT NULL default '', - filesize integer NOT NULL default '0', - list smallint NOT NULL default '0', - PRIMARY KEY (fid) -); - --- --- Table structure for table 'filter_formats' --- - -CREATE TABLE filter_formats ( - format SERIAL, - name varchar(255) NOT NULL default '', - roles varchar(255) NOT NULL default '', - cache smallint NOT NULL default '0', - PRIMARY KEY (format) -); - --- --- Table structure for table 'filters' --- - -CREATE TABLE filters ( - format integer NOT NULL DEFAULT '0', - module varchar(64) NOT NULL DEFAULT '', - delta smallint NOT NULL DEFAULT 1, - weight smallint DEFAULT '0' NOT NULL -); -CREATE INDEX filters_module_idx ON filters(module); -CREATE INDEX filters_weight_idx ON filters(weight); - --- --- Table structure for table 'flood' --- - -CREATE TABLE flood ( - event varchar(64) NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp integer NOT NULL default '0' -); - --- --- Table structure for table 'forum' --- - -CREATE TABLE forum ( - nid integer NOT NULL default '0', - tid integer NOT NULL default '0', - shadow integer NOT NULL default '0', - PRIMARY KEY (nid) -); -CREATE INDEX forum_tid_idx ON forum(tid); - --- --- Table structure for history --- - -CREATE TABLE history ( - uid integer NOT NULL default '0', - nid integer NOT NULL default '0', - timestamp integer NOT NULL default '0', - PRIMARY KEY (uid,nid) -); - --- --- Table structure for locales_meta --- - -CREATE TABLE locales_meta ( - locale varchar(12) NOT NULL default '', - name varchar(64) NOT NULL default '', - enabled smallint NOT NULL default '0', - isdefault smallint NOT NULL default '0', - plurals tinyint NOT NULL default '0', - formula varchar(128) NOT NULL default '', - PRIMARY KEY (locale) -); - --- --- Table structure for locales_source --- - - -CREATE TABLE locales_source ( - lid SERIAL, - location varchar(255) NOT NULL default '', - source text NOT NULL, - PRIMARY KEY (lid) -); - --- --- Table structure for locales_target --- - -CREATE TABLE locales_target ( - lid int NOT NULL default '0', - translation text DEFAULT '' NOT NULL, - locale varchar(12) NOT NULL default '', - plid int NOT NULL default '0', - plural tinyint NOT NULL default '0', - UNIQUE (lid) -); -CREATE INDEX locales_target_lid_idx ON locales_target(lid); -CREATE INDEX locales_target_lang_idx ON locales_target(locale); -CREATE INDEX locales_target_plid_idx ON locales_target(plid); -CREATE INDEX locales_target_plural_idx ON locales_target(plural); - --- --- Table structure for table 'menu' --- - - -CREATE SEQUENCE menu_mid_seq as integer; - -CREATE TABLE menu ( - mid integer, - pid integer NOT NULL default '0', - path varchar(255) NOT NULL default '', - title varchar(255) NOT NULL default '', - description varchar(255) NOT NULL default '', - weight smallint NOT NULL default '0', - type smallint NOT NULL default '0', - PRIMARY KEY (mid) -); --- --- Table structure for table 'moderation_filters' --- - -CREATE TABLE moderation_filters ( - fid SERIAL, - filter varchar(255) NOT NULL default '', - minimum smallint NOT NULL default '0', - PRIMARY KEY (fid) -); - --- --- Table structure for table 'moderation_roles' --- - -CREATE TABLE moderation_roles ( - rid integer NOT NULL default '0', - mid integer NOT NULL default '0', - value smallint NOT NULL default '0' -); -CREATE INDEX moderation_roles_rid_idx ON moderation_roles(rid); -CREATE INDEX moderation_roles_mid_idx ON moderation_roles(mid); - --- --- Table structure for table 'moderation_votes' --- - -CREATE TABLE moderation_votes ( - mid SERIAL, - vote varchar(255) default NULL, - weight smallint NOT NULL default '0', - PRIMARY KEY (mid) -); - --- --- Table structure for node --- - -CREATE TABLE node ( - nid SERIAL, - type varchar(16) NOT NULL default '', - title varchar(128) NOT NULL default '', - uid integer NOT NULL default '0', - status integer NOT NULL default '1', - created integer NOT NULL default '0', - changed integer NOT NULL default '0', - comment integer NOT NULL default '0', - promote integer NOT NULL default '0', - moderate integer NOT NULL default '0', - teaser text NOT NULL default '', - body text NOT NULL default '', - revisions text NOT NULL default '', - sticky integer NOT NULL default '0', - format smallint NOT NULL default '0', - PRIMARY KEY (nid) -); -CREATE INDEX node_type_idx ON node(type); -CREATE INDEX node_title_idx ON node(title,type); -CREATE INDEX node_status_idx ON node(status); -CREATE INDEX node_uid_idx ON node(uid); -CREATE INDEX node_moderate_idx ON node (moderate); -CREATE INDEX node_promote_status_idx ON node (promote, status); -CREATE INDEX node_created ON node(created); -CREATE INDEX node_changed ON node(changed); - --- --- Table structure for table `node_access` --- - -CREATE TABLE node_access ( - nid SERIAL, - gid integer NOT NULL default '0', - realm varchar(255) NOT NULL default '', - grant_view smallint NOT NULL default '0', - grant_update smallint NOT NULL default '0', - grant_delete smallint NOT NULL default '0', - PRIMARY KEY (nid,gid,realm) -); - - --- --- Table structure for table 'node_counter' --- - -CREATE TABLE node_counter ( - nid integer NOT NULL default '0', - totalcount integer NOT NULL default '0', - daycount integer NOT NULL default '0', - timestamp integer NOT NULL default '0', - PRIMARY KEY (nid) -); -CREATE INDEX node_counter_totalcount_idx ON node_counter(totalcount); -CREATE INDEX node_counter_daycount_idx ON node_counter(daycount); -CREATE INDEX node_counter_timestamp_idx ON node_counter(timestamp); - --- --- Table structure for table 'url_alias' --- -CREATE SEQUENCE profile_fields_fid_seq as integer; - -CREATE TABLE profile_fields ( - fid integer, - title varchar(255) default NULL, - name varchar(128) default NULL, - explanation TEXT default NULL, - category varchar(255) default NULL, - page varchar(255) default NULL, - type varchar(128) default NULL, - weight smallint DEFAULT '0' NOT NULL, - required smallint DEFAULT '0' NOT NULL, - register smallint DEFAULT '0' NOT NULL, - visibility smallint DEFAULT '0' NOT NULL, - options text, - UNIQUE (name), - PRIMARY KEY (fid) -); -CREATE INDEX profile_fields_category ON profile_fields (category); - --- --- Table structure for table 'profile_values' --- - -CREATE TABLE profile_values ( - fid integer default '0', - uid integer default '0', - value text -); -CREATE INDEX profile_values_uid ON profile_values (uid); -CREATE INDEX profile_values_fid ON profile_values (fid); - -CREATE SEQUENCE url_alias_pid_seq as integer; - -CREATE TABLE url_alias ( - pid integer, - src varchar(128) NOT NULL default '', - dst varchar(128) NOT NULL default '', - PRIMARY KEY (pid) -); -CREATE INDEX url_alias_dst_idx ON url_alias(dst); --- --- Table structure for permission --- - -CREATE TABLE permission ( - rid integer NOT NULL default '0', - perm text default '', - tid integer NOT NULL default '0' -); -CREATE INDEX permission_rid_idx ON permission(rid); - --- --- Table structure for poll --- - -CREATE TABLE poll ( - nid integer NOT NULL default '0', - runtime integer NOT NULL default '0', - polled text NOT NULL default '', - active integer NOT NULL default '0', - PRIMARY KEY (nid) -); - --- --- Table structure for poll_choices --- - -CREATE TABLE poll_choices ( - chid SERIAL, - nid integer NOT NULL default '0', - chtext varchar(128) NOT NULL default '', - chvotes integer NOT NULL default '0', - chorder integer NOT NULL default '0', - PRIMARY KEY (chid) -); -CREATE INDEX poll_choices_nid_idx ON poll_choices(nid); - --- --- Table structure for queue --- - -CREATE TABLE queue ( - nid integer NOT NULL default '0', - uid integer NOT NULL default '0', - vote integer NOT NULL default '0', - PRIMARY KEY (nid, uid) -); -CREATE INDEX queue_nid_idx ON queue(nid); -CREATE INDEX queue_uid_idx ON queue(uid); - --- --- Table structure for role --- - -CREATE TABLE role ( - rid SERIAL, - name varchar(32) NOT NULL default '', - PRIMARY KEY (rid), - UNIQUE (name) -); - --- --- Table structure for search_index --- - -CREATE TABLE search_index ( - word varchar(50) NOT NULL default '', - sid integer NOT NULL default '0', - type varchar(16) default NULL, - fromsid integer NOT NULL default '0', - fromtype varchar(16) default NULL, - score integer default NULL -); -CREATE INDEX search_index_sid_idx ON search_index(sid); -CREATE INDEX search_index_fromsid_idx ON search_index(fromsid); -CREATE INDEX search_index_word_idx ON search_index(word); - --- --- Table structures for search_total --- - -CREATE TABLE search_total ( - word varchar(50) NOT NULL default '', - count float default NULL -); -CREATE INDEX search_total_word_idx ON search_total(word); - --- --- Table structure for sessions --- - -CREATE TABLE sessions ( - uid integer not null, - sid varchar(32) NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp integer NOT NULL default '0', - session text, - PRIMARY KEY (sid) -); - --- --- Table structure for sequences --- This is only used under MySQL, co commented out --- --- --- CREATE TABLE sequences ( --- name varchar(255) NOT NULL, --- id integer NOT NULL, --- PRIMARY KEY (name) --- ); - --- --- Table structure for system --- - -CREATE TABLE system ( - filename varchar(255) NOT NULL default '', - name varchar(255) NOT NULL default '', - type varchar(255) NOT NULL default '', - description varchar(255) NOT NULL default '', - status integer NOT NULL default '0', - throttle smallint NOT NULL default '0', - bootstrap integer NOT NULL default '0', - PRIMARY KEY (filename) -); - --- --- Table structure for term_data --- - -CREATE TABLE term_data ( - tid SERIAL, - vid integer NOT NULL default '0', - name varchar(255) NOT NULL default '', - description text default '', - weight smallint NOT NULL default '0', - PRIMARY KEY (tid) -); -CREATE INDEX term_data_vid_idx ON term_data(vid); - --- --- Table structure for term_hierarchy --- - -CREATE TABLE term_hierarchy ( - tid integer NOT NULL default '0', - parent integer NOT NULL default '0' -); -CREATE INDEX term_hierarchy_tid_idx ON term_hierarchy(tid); -CREATE INDEX term_hierarchy_parent_idx ON term_hierarchy(parent); - --- --- Table structure for term_node --- - -CREATE TABLE term_node ( - nid integer NOT NULL default '0', - tid integer NOT NULL default '0', - PRIMARY KEY (tid,nid) -); -CREATE INDEX term_node_nid_idx ON term_node(nid); -CREATE INDEX term_node_tid_idx ON term_node(tid); - --- --- Table structure for term_relation --- - -CREATE TABLE term_relation ( - tid1 integer NOT NULL default '0', - tid2 integer NOT NULL default '0' -); -CREATE INDEX term_relation_tid1_idx ON term_relation(tid1); -CREATE INDEX term_relation_tid2_idx ON term_relation(tid2); - --- --- Table structure for term_synonym --- - -CREATE TABLE term_synonym ( - tid integer NOT NULL default '0', - name varchar(255) NOT NULL default '' -); -CREATE INDEX term_synonym_tid_idx ON term_synonym(tid); -CREATE INDEX term_synonym_name_idx ON term_synonym(name); - --- --- Table structure for users --- - -CREATE TABLE users ( - uid integer NOT NULL default '0', - name varchar(60) NOT NULL default '', - pass varchar(32) NOT NULL default '', - mail varchar(64) default '', - mode smallint NOT NULL default '0', - sort smallint default '0', - threshold smallint default '0', - theme varchar(255) NOT NULL default '', - signature varchar(255) NOT NULL default '', - created integer NOT NULL default '0', - changed integer NOT NULL default '0', - status smallint NOT NULL default '0', - timezone varchar(8) default NULL, - language varchar(12) NOT NULL default '', - picture varchar(255) NOT NULL DEFAULT '', - init varchar(64) default '', - data text default '', - PRIMARY KEY (uid), - UNIQUE (name) -); -CREATE INDEX users_changed_idx ON users(changed); - -CREATE SEQUENCE users_uid_seq AS integer START WITH 1 INCREMENT BY 1; - --- --- Table structure for users_roles --- - -CREATE TABLE users_roles ( - uid integer NOT NULL default '0', - rid integer NOT NULL default '0', - PRIMARY KEY (uid, rid) -); - --- --- Table structure for variable --- - -CREATE TABLE variable ( - name varchar(48) NOT NULL default '', - value text NOT NULL default '', - PRIMARY KEY (name) -); - --- --- Table structure for vocabulary --- - -CREATE TABLE vocabulary ( - vid SERIAL, - name varchar(255) NOT NULL default '', - description text default '', - help varchar(255) NOT NULL default '', - relations smallint NOT NULL default '0', - hierarchy smallint NOT NULL default '0', - multiple smallint NOT NULL default '0', - required smallint NOT NULL default '0', - module varchar(255) NOT NULL default '', - weight smallint NOT NULL default '0', - PRIMARY KEY (vid) -); - --- --- Table structure for vocabulary_node_types --- - -CREATE TABLE vocabulary_node_types ( - vid integer NOT NULL default '0', - type varchar(16) NOT NULL default '', - PRIMARY KEY (vid, type) -); - --- --- Table structure for watchdog --- - -CREATE TABLE watchdog ( - wid SERIAL, - uid integer NOT NULL default '0', - type varchar(16) NOT NULL default '', - message text NOT NULL default '', - severity smallint NOT NULL default '0', - link varchar(255) NOT NULL default '', - location varchar(128) NOT NULL default '', - hostname varchar(128) NOT NULL default '', - timestamp integer NOT NULL default '0', - PRIMARY KEY (wid) -); - --- --- Insert some default values --- - -INSERT INTO system VALUES ('modules/block.module','block','module','',1,0,0); -INSERT INTO system VALUES ('modules/comment.module','comment','module','',1,0,0); -INSERT INTO system VALUES ('modules/filter.module','filter','module','',1,0,0); -INSERT INTO system VALUES ('modules/help.module','help','module','',1,0,0); -INSERT INTO system VALUES ('modules/node.module','node','module','',1,0,0); -INSERT INTO system VALUES ('modules/page.module','page','module','',1,0,0); -INSERT INTO system VALUES ('modules/story.module','story','module','',1,0,0); -INSERT INTO system VALUES ('modules/system.module','system','module','',1,0,0); -INSERT INTO system VALUES ('modules/taxonomy.module','taxonomy','module','',1,0,0); -INSERT INTO system VALUES ('modules/user.module','user','module','',1,0,0); -INSERT INTO system VALUES ('modules/watchdog.module','watchdog','module','',1,0,0); -INSERT INTO system VALUES ('themes/bluemarine/xtemplate.xtmpl','bluemarine','theme','themes/engines/xtemplate/xtemplate.engine',1,0,0); -INSERT INTO system VALUES ('themes/engines/xtemplate/xtemplate.engine','xtemplate','theme_engine','',1,0,0); - -INSERT INTO variable(name,value) VALUES('update_start', 's:10:"2005-03-21";'); -INSERT INTO variable(name,value) VALUES('theme_default','s:10:"bluemarine";'); -INSERT INTO users(uid,name,mail) VALUES(0,'',''); -INSERT INTO users_roles(uid,rid) VALUES(0, 1); - -INSERT INTO role (name) VALUES ('anonymous user'); -INSERT INTO permission VALUES (1,'access content',0); - -INSERT INTO role (name) VALUES ('authenticated user'); -INSERT INTO permission VALUES (2,'access comments, access content, post comments, post comments without approval',0); - -INSERT INTO blocks(module,delta,status) VALUES('user', 0, 1); -INSERT INTO blocks(module,delta,status) VALUES('user', 1, 1); - -INSERT INTO node_access VALUES (0, 0, 'all', 1, 0, 0); - -INSERT INTO filter_formats (name, roles, cache) VALUES ('Filtered HTML',',1,2,',1); -INSERT INTO filter_formats (name, roles, cache) VALUES ('PHP code','',0); -INSERT INTO filter_formats (name, roles, cache) VALUES ('Full HTML','',1); -INSERT INTO filters VALUES (1,'filter',0,0); -INSERT INTO filters VALUES (1,'filter',2,1); -INSERT INTO filters VALUES (2,'filter',1,0); -INSERT INTO filters VALUES (3,'filter',2,0); -INSERT INTO variable (name,value) VALUES ('filter_html_1','i:1;'); - -INSERT INTO locales_meta(locale, name, enabled, isdefault) VALUES('en', 'English', '1', '1'); - ---- ---- Alter some sequences ---- -ALTER SEQUENCE menu_mid_seq RESTART WITH 2;
