User defined variables used as input to common_schema routines, or are the output of routines.

Input variables:

Output variables:


@common_schema_verbose and @common_schema_dryrun both serve as input to exec_single(), which is a basic function in common_schema for dynamic query execution. eval(), exec(), foreach(), repeat_exec(), run() -- all rely on exec_single(), hence these two params affect all aforementioned functions.

Setting @common_schema_dryrun := 1 avoids executing dynamic queries issues by exec_single(). This makes for a way to test your code before execution.

Setting @common_schema_verbose := 1 prints out executed queries, and serves as a verbose mode for your code's activity.

Setting @common_schema_debug := 1 will enable some internal debugging code. The particulars are subject to change, but you may find it useful.

When issuing queries such as INSERT, DELETE, UPDATE via dynamic SQL, the ROW_COUNT() function does not behave as expected, since the DEALLOCATE statement resets it. This is why after each invocation of dynamic query via exec_single(), the @common_schema_rowcount variable is set so as to reflect the ROW_COUNT() as read immediately after invocation.

@common_schema_error can be set by various functionality upon error. In particular, it is set by the throw() routine to the error message provided.


common_schema utilized many more variables, internally. Internal user defined variables are named, by convention, @_common_schema_*. You should refrain from depending on the output of any such variable, nor should you modify such variables.

common_schema documentation