Make PREPARE operation explicit

The operation of the statement to be prepared is no longer
reported as the operation of the PREPARE statement.

Instead, when the type of the statement is
QUERY_TYPE_PREPARE_NAMED_STMT, the operation can be obtained
using qc_get_prepare_operation().

The qc_mysqlembedded implementation will be provided in a
subsequent commit.
This commit is contained in:
Johan Wikman
2016-10-31 13:38:18 +02:00
parent 8c20ad5cd0
commit 91e36ecaed
4 changed files with 93 additions and 3 deletions

View File

@ -1929,6 +1929,26 @@ char* qc_get_prepare_name(GWBUF* stmt)
return name;
}
qc_query_op_t qc_get_prepare_operation(GWBUF* stmt)
{
qc_query_op_t operation = QUERY_OP_UNDEFINED;
if (stmt)
{
if (ensure_query_is_parsed(stmt))
{
LEX* lex = get_lex(stmt);
if (lex->sql_command == SQLCOM_PREPARE)
{
MXS_WARNING("qc_get_prepare_operation not implemented yet.");
}
}
}
return operation;
}
namespace
{
@ -2074,6 +2094,7 @@ static QUERY_CLASSIFIER qc =
qc_get_affected_fields,
qc_get_database_names,
qc_get_prepare_name,
qc_get_prepare_operation,
};
/* @see function load_module in load_utils.c for explanation of the following