~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/dynamic.rst

  • Committer: Jay Pipes
  • Date: 2009-11-16 22:00:02 UTC
  • mto: (1234.1.1 push) (1237.2.10 push)
  • mto: This revision was merged to the branch mainline in revision 1229.
  • Revision ID: jpipes@serialcoder-20091116220002-rdsha64utt41i8w8
Adds INFORMATION_SCHEMA views for the transaction log:

TRANSACTION_LOG
TRANSACTION_LOG_ENTRIES
TRANSACTION_LOG_TRANSACTIONS

Adds a new user-defined function:

PRINT_TRANSACTION_MESSAGE(filename, offset)

Adds tests for all of the above

Implementation notes:

An indexer now runs when transaction messages are applied
to the transaction log.  It creates a simple index of the
transaction log entries.  This index is used when the
information schema views' fillTable() method is called.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Dynamic SQL
2
 
===========
3
 
 
4
 
In Drizzle you can use the EXECUTE command along with :doc:'user defined variables <variables>'
5
 
to create SQL in a dynamic manner on the server. An exmaple of this is:
6
 
 
7
 
SET @var= "SELECT 1";
8
 
EXECUTE @var;
9
 
 
10
 
You can also omit the variable and just insert the SQL directly:
11
 
 
12
 
EXECUTE "SELECT 1";
13
 
 
14
 
By adding WITH NO RETURN you can have EXECUTE then no errors will be
15
 
generated and no data will be returned by the execution of the statement.
16
 
 
17
 
If you want to launch the query in a separate session, you can do that with
18
 
the following:
19
 
EXECUTE "SELECT 1" CONCURRENT;
20
 
 
21
 
By adding "WAIT" to a CONCURRENT execute, you can have the session that
22
 
called EXECUTE wait till the child is finished before returning.
23
 
 
24
 
The query will run in a new session and will execute as the user that
25
 
launched it. It can be killed via KILL and the system limit on total number
26
 
of sessions will be enforced.