Package com.mckoi.database.interpret
Class Show
- java.lang.Object
-
- com.mckoi.database.interpret.Statement
-
- com.mckoi.database.interpret.Show
-
public class Show extends Statement
Statement that handles SHOW and DESCRIBE sql commands.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Expression[]
args
Arguments of the show statement.(package private) static int
CONNECTION_INFO
(package private) static int
CONNECTIONS
(package private) static int
DESCRIBE_TABLE
(package private) static int
PRODUCT
(package private) java.lang.String
show_type
The type of information that we are to show.(package private) static int
STATUS
(package private) java.lang.String
table_name
The name the table that we are to update.(package private) static int
TABLES
(package private) SearchExpression
where_clause
The search expression for the show statement (where clause).
-
Constructor Summary
Constructors Constructor Description Show()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) TemporaryTable
createEmptyTable(Database d, java.lang.String name, java.lang.String[] cols)
Convenience, creates an empty table with the given column names.Table
evaluate()
Evaluates the statement and returns a table that represents the result set.void
prepare()
Prepares the statement with the given Database object.-
Methods inherited from class com.mckoi.database.interpret.Statement
addTable, Debug, existsTableWithColumn, findTableInQuery, findTableWithColumn, init, reset, resolveAgainstAliases, resolveColumn, resolveExpression, resolveTableName, resolveTree, resolveVariableName
-
-
-
-
Field Detail
-
TABLES
static final int TABLES
- See Also:
- Constant Field Values
-
STATUS
static final int STATUS
- See Also:
- Constant Field Values
-
DESCRIBE_TABLE
static final int DESCRIBE_TABLE
- See Also:
- Constant Field Values
-
CONNECTIONS
static final int CONNECTIONS
- See Also:
- Constant Field Values
-
PRODUCT
static final int PRODUCT
- See Also:
- Constant Field Values
-
CONNECTION_INFO
static final int CONNECTION_INFO
- See Also:
- Constant Field Values
-
table_name
java.lang.String table_name
The name the table that we are to update.
-
show_type
java.lang.String show_type
The type of information that we are to show.
-
args
Expression[] args
Arguments of the show statement.
-
where_clause
SearchExpression where_clause
The search expression for the show statement (where clause).
-
-
Method Detail
-
createEmptyTable
TemporaryTable createEmptyTable(Database d, java.lang.String name, java.lang.String[] cols) throws DatabaseException
Convenience, creates an empty table with the given column names.- Throws:
DatabaseException
-
prepare
public void prepare() throws DatabaseException
Description copied from class:Statement
Prepares the statement with the given Database object. This is called before the statement is evaluated. The prepare statement queries the database and resolves information about the statement (for example, it resolves column names and aliases and determines the tables that are touched by this statement so we can lock the appropriate tables before we evaluate).NOTE: Care must be taken to ensure that all methods called here are safe in as far as modifications to the data occuring. The rules for safety should be as follows. If the database is in EXCLUSIVE mode, then we need to wait until it's switched back to SHARED mode before this method is called. All collection of information done here should not involve any table state info. except for column count, column names, column types, etc. Queries such as obtaining the row count, selectable scheme information, and certainly 'getCellContents' must never be called during prepare. When prepare finishes, the affected tables are locked and the query is safe to 'evaluate' at which time table state is safe to inspect.
- Specified by:
prepare
in classStatement
- Throws:
DatabaseException
-
evaluate
public Table evaluate() throws DatabaseException
Description copied from class:Statement
Evaluates the statement and returns a table that represents the result set. This is called after 'prepare'.- Specified by:
evaluate
in classStatement
- Throws:
DatabaseException
-
-