57
57
#include <drizzled/table_ident.h>
58
58
#include <drizzled/statistics_variables.h>
59
59
#include <drizzled/system_variables.h>
60
#include <drizzled/session/times.h>
60
61
#include <drizzled/session/transactions.h>
62
63
#include <limits.h>
784
785
void parse(Session *session, const char *inBuf, uint32_t length)
786
787
session->lex().start(session);
788
788
session->reset_for_next_command();
789
789
/* Check if the Query is Cached if and return true if yes
790
790
* TODO the plugin has to make sure that the query is cacheble
791
791
* by setting the query_safe_cache param to TRUE
794
if (plugin::QueryCache::isCached(session))
796
res= plugin::QueryCache::sendCachedResultset(session);
802
LEX *lex= &session->lex();
793
if (plugin::QueryCache::isCached(session) && not plugin::QueryCache::sendCachedResultset(session))
803
795
Lex_input_stream lip(session, inBuf, length);
804
bool err= parse_sql(session, &lip);
808
if (not session->is_error())
810
DRIZZLE_QUERY_EXEC_START(session->getQueryString()->c_str(),
812
const_cast<const char *>(session->schema()->c_str()));
813
// Implement Views here --Brian
814
/* Actually execute the query */
817
execute_command(session);
821
// Just try to catch any random failures that could have come
825
DRIZZLE_QUERY_EXEC_DONE(0);
796
if (parse_sql(session, &lip))
831
797
assert(session->is_error());
798
else if (not session->is_error())
800
DRIZZLE_QUERY_EXEC_START(session->getQueryString()->c_str(), session->thread_id,
801
const_cast<const char *>(session->schema()->c_str()));
802
// Implement Views here --Brian
803
/* Actually execute the query */
806
execute_command(session);
810
// Just try to catch any random failures that could have come
814
DRIZZLE_QUERY_EXEC_DONE(0);
816
session->lex().unit.cleanup();
834
817
session->set_proc_info("freeing items");
835
818
session->end_statement();
836
819
session->cleanup_after_query();
837
session->set_end_timer();
820
session->times.set_end_timer(*session);
843
825
Store field definition for create.