20 #include <drizzled/item/num.h>
21 #include <drizzled/abort_exception.h>
22 #include <drizzled/error.h>
23 #include <drizzled/nested_join.h>
24 #include <drizzled/transaction_services.h>
25 #include <drizzled/sql_parse.h>
26 #include <drizzled/data_home.h>
27 #include <drizzled/sql_base.h>
29 #include <drizzled/function/time/unix_timestamp.h>
30 #include <drizzled/function/get_system_var.h>
31 #include <drizzled/item/cmpfunc.h>
32 #include <drizzled/item/null.h>
33 #include <drizzled/session.h>
34 #include <drizzled/session/cache.h>
35 #include <drizzled/sql_load.h>
36 #include <drizzled/lock.h>
37 #include <drizzled/select_send.h>
38 #include <drizzled/plugin/client.h>
39 #include <drizzled/statement.h>
40 #include <drizzled/statement/alter_table.h>
41 #include <drizzled/probes.h>
42 #include <drizzled/charset.h>
43 #include <drizzled/plugin/logging.h>
44 #include <drizzled/plugin/query_rewrite.h>
45 #include <drizzled/plugin/query_cache.h>
46 #include <drizzled/plugin/authorization.h>
47 #include <drizzled/optimizer/explain_plan.h>
48 #include <drizzled/pthread_globals.h>
49 #include <drizzled/plugin/event_observer.h>
50 #include <drizzled/display.h>
52 #include <drizzled/kill.h>
53 #include <drizzled/schema.h>
54 #include <drizzled/item/subselect.h>
55 #include <drizzled/diagnostics_area.h>
56 #include <drizzled/table_ident.h>
57 #include <drizzled/statistics_variables.h>
58 #include <drizzled/system_variables.h>
59 #include <drizzled/session/times.h>
60 #include <drizzled/session/transactions.h>
61 #include <drizzled/create_field.h>
62 #include <drizzled/lex_input_stream.h>
68 #include <boost/date_time.hpp>
69 #include <drizzled/internal/my_sys.h>
78 bool my_yyoverflow(
short **a,
ParserType **b, ulong *yystacksize);
79 static bool parse_sql(Session *session, Lex_input_stream *lip);
80 void parse(Session&,
const char *inBuf, uint32_t length);
87 extern size_t my_thread_stack_size;
88 extern const charset_info_st *character_set_filesystem;
90 static atomic<uint64_t> g_query_id;
94 static const std::string command_name[]=
108 const char *xa_state_names[]=
110 "NON-EXISTING",
"ACTIVE",
"IDLE",
"PREPARED"
128 const std::string &getCommandName(
const enum_server_command& command)
130 return command_name[command];
133 void init_update_queries(
void)
135 for (uint32_t x= uint32_t(SQLCOM_SELECT);
136 x <= uint32_t(SQLCOM_END); x++)
193 const char* packet, uint32_t packet_length)
197 DRIZZLE_COMMAND_START(session->thread_id, command);
200 session->lex().sql_command= SQLCOM_END;
201 session->times.set_time();
204 if (command != COM_PING)
207 session->status_var.questions++;
212 plugin::Logging::preDo(session);
213 if (unlikely(plugin::EventObserver::beforeStatement(*session)))
218 session->server_status&= ~(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED);
224 if (packet_length == 0)
226 my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
239 DRIZZLE_QUERY_START(session->getQueryString()->c_str(), session->thread_id, session->schema()->c_str());
240 parse(*session, session->getQueryString()->c_str(), session->getQueryString()->length());
252 if (packet_length != 4)
254 my_error(ER_NO_SUCH_THREAD, MYF(0), 0);
260 memcpy(&kill_id, packet,
sizeof(uint32_t));
262 kill_id= ntohl(kill_id);
263 (void)drizzled::kill(*session->user(), kill_id,
true);
271 session->status_var.com_other++;
280 session->status_var.com_other++;
288 my_message(ER_UNKNOWN_COM_ERROR, ER(ER_UNKNOWN_COM_ERROR), MYF(0));
294 TransactionServices::autocommitOrRollback(*session, session->
is_error());
297 session->transaction.
stmt.reset();
301 if (session->killed_errno())
303 if (not session->main_da().is_set())
304 session->send_kill_message();
306 if (session->getKilled() == Session::KILL_QUERY || session->getKilled() == Session::KILL_BAD_DATA)
308 session->setKilled(Session::NOT_KILLED);
309 session->setAbort(
false);
313 assert(! session->main_da().
is_sent);
315 switch (session->main_da().status())
317 case Diagnostics_area::DA_ERROR:
319 session->getClient()->sendError(session->main_da().sql_errno(),
320 session->main_da().message());
323 case Diagnostics_area::DA_EOF:
324 session->getClient()->sendEOF();
327 case Diagnostics_area::DA_OK:
328 session->getClient()->sendOK();
331 case Diagnostics_area::DA_DISABLED:
334 case Diagnostics_area::DA_EMPTY:
336 session->getClient()->sendOK();
340 session->main_da().
is_sent=
true;
346 plugin::Logging::postDo(session);
347 if (unlikely(plugin::EventObserver::afterStatement(*session)))
355 session->resetQueryString();
360 if (DRIZZLE_QUERY_DONE_ENABLED() || DRIZZLE_COMMAND_DONE_ENABLED())
362 if (command == COM_QUERY)
364 DRIZZLE_QUERY_DONE(session->
is_error());
366 DRIZZLE_COMMAND_DONE(session->
is_error());
401 bitset<NUM_OF_TABLE_OPTIONS> table_options;
408 return not sel.add_table_to_list(&session,
new Table_ident(db, table), NULL, table_options, TL_READ);
411 int prepare_new_schema_table(Session *session, LEX& lex0,
const string& schema_table_name)
413 Select_Lex& lex= *lex0.current_select;
416 TableList *table_list= (TableList*)lex.table_list.first;
417 table_list->schema_select_lex= NULL;
454 Select_Lex *select_lex= &session->lex().select_lex;
471 session->lex().first_lists_tables_same();
475 TableList* all_tables= session->lex().query_tables;
478 select_lex->context.resolve_in_table_list_only((
TableList*)select_lex->table_list.first);
487 if (all_tables || ! session->lex().is_single_level_stmt())
489 drizzle_reset_errors(*session, 0);
494 if (not (session->server_status & SERVER_STATUS_AUTOCOMMIT)
496 && session->lex().statement->isTransactional())
498 if (not session->startTransaction())
500 my_error(drizzled::ER_UNKNOWN_ERROR, MYF(0));
506 bool res= session->lex().statement->execute();
514 if (not
sql_command_flags[session->lex().sql_command].test(CF_BIT_HAS_ROW_COUNT))
522 bool execute_sqlcom_select(Session *session, TableList *all_tables)
524 LEX *lex= &session->lex();
525 select_result *result=lex->result;
529 Select_Lex *param= lex->unit.global_parameters;
530 if (!param->explicit_limit)
532 new Item_int((uint64_t) session->variables.select_limit);
536 && ! (session->server_status & SERVER_STATUS_AUTOCOMMIT)
537 && ! session->inTransaction()
538 && ! lex->statement->isShow())
540 if (not session->startTransaction())
542 my_error(drizzled::ER_UNKNOWN_ERROR, MYF(0));
547 if (not (res= session->openTablesLock(all_tables)))
557 result=
new select_send();
558 session->send_explain_fields(result);
559 optimizer::ExplainPlan planner;
560 res= planner.explainUnion(session, &session->lex().unit, result);
561 if (lex->describe & DESCRIBE_EXTENDED)
564 String str(buff,(uint32_t)
sizeof(buff), system_charset_info);
566 session->lex().unit.print(&str);
568 push_warning(session, DRIZZLE_ERROR::WARN_LEVEL_NOTE,
581 result=
new select_send();
584 plugin::QueryCache::prepareResultset(session);
587 plugin::QueryCache::setResultset(session);
589 if (result != lex->result)
597 #define MY_YACC_INIT 1000 // Start with big alloc
598 #define MY_YACC_MAX 32000 // Because of 'short'
600 bool my_yyoverflow(
short **yyss,
ParserType **yyvs, ulong *yystacksize)
602 LEX *lex= ¤t_session->lex();
604 if ((uint32_t) *yystacksize >= MY_YACC_MAX)
607 old_info= *yystacksize;
608 *yystacksize= set_zone((*yystacksize)*2,MY_YACC_INIT,MY_YACC_MAX);
609 unsigned char *tmpptr= NULL;
610 if (!(tmpptr= (
unsigned char *)realloc(lex->yacc_yyvs,
611 *yystacksize*
sizeof(**yyvs))))
613 lex->yacc_yyvs= tmpptr;
615 if (!(tmpptr= (
unsigned char*)realloc(lex->yacc_yyss,
616 *yystacksize*
sizeof(**yyss))))
618 lex->yacc_yyss= tmpptr;
621 memcpy(lex->yacc_yyss, *yyss, old_info*
sizeof(**yyss));
622 memcpy(lex->yacc_yyvs, *yyvs, old_info*
sizeof(**yyvs));
624 *yyss=(
short*) lex->yacc_yyss;
631 init_select(LEX *lex)
633 Select_Lex *select_lex= lex->current_select;
634 select_lex->init_select();
636 if (select_lex == &lex->select_lex)
638 assert(lex->result == 0);
644 bool new_select(LEX *lex,
bool move_down)
646 Session* session= lex->session;
647 Select_Lex* select_lex=
new (session->mem_root) Select_Lex;
649 select_lex->select_number= ++session->select_number;
650 select_lex->parent_lex= lex;
651 select_lex->init_query();
652 select_lex->init_select();
655 if (lex->nest_level > (
int) MAX_SELECT_NESTING)
657 my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT,MYF(0),MAX_SELECT_NESTING);
661 select_lex->nest_level= lex->nest_level;
665 Select_Lex_Unit* unit=
new (session->mem_root) Select_Lex_Unit();
669 unit->session= session;
670 unit->include_down(lex->current_select);
673 unit->return_to= lex->current_select;
674 select_lex->include_down(unit);
679 select_lex->context.outer_context= &select_lex->outer_select()->context;
683 if (lex->current_select->order_list.first && !lex->current_select->braces)
685 my_error(ER_WRONG_USAGE, MYF(0),
"UNION",
"order_st BY");
689 select_lex->include_neighbour(lex->current_select);
690 Select_Lex_Unit *unit= select_lex->master_unit();
692 if (not unit->fake_select_lex && unit->add_fake_select_lex(lex->session))
695 select_lex->context.outer_context= unit->first_select()->context.outer_context;
698 select_lex->master_unit()->global_parameters= select_lex;
699 select_lex->include_global((Select_Lex_Node**)&lex->all_selects_list);
700 lex->current_select= select_lex;
705 select_lex->context.resolve_in_select_list=
true;
722 LEX& lex= session->lex();
724 lex.sql_command= SQLCOM_SELECT;
726 tmp.assign(var_name, strlen(var_name));
731 if (
Item*
var= get_system_var(session, OPT_SESSION, tmp, null_lex_string()))
733 char buff[MAX_SYS_VAR_LENGTH*2+4+8];
735 end+= snprintf(buff,
sizeof(buff),
"@@session.%s", var_name);
736 var->set_name(buff, end-buff);
737 session->add_item_to_list(
var);
752 session.lex().start(&session);
758 if (plugin::QueryCache::isCached(&session) && not plugin::QueryCache::sendCachedResultset(&session))
765 DRIZZLE_QUERY_EXEC_START(session.getQueryString()->c_str(), session.thread_id, session.schema()->c_str());
778 DRIZZLE_QUERY_EXEC_DONE(0);
780 session.lex().unit.cleanup();
784 session.times.set_end_timer(session);
796 const char *length,
const char *decimals,
797 uint32_t type_modifier, column_format_type column_format,
798 Item *default_value, Item *on_update_value,
str_ref comment,
799 const char *change, List<String> *interval_list,
const charset_info_st* cs)
801 LEX *lex= &session->lex();
802 statement::AlterTable *statement= (statement::AlterTable *)lex->statement;
804 if (check_identifier_name(field_name, ER_TOO_LONG_IDENT))
807 if (type_modifier & PRI_KEY_FLAG)
809 lex->col_list.push_back(
new Key_part_spec(field_name, 0));
810 statement->alter_info.key_list.push_back(
new Key(Key::PRIMARY, null_lex_string(), &default_key_create_info, 0, lex->col_list));
811 lex->col_list.clear();
813 if (type_modifier & (UNIQUE_FLAG | UNIQUE_KEY_FLAG))
815 lex->col_list.push_back(
new Key_part_spec(field_name, 0));
816 statement->alter_info.key_list.push_back(
new Key(Key::UNIQUE, null_lex_string(), &default_key_create_info, 0, lex->col_list));
817 lex->col_list.clear();
829 if (default_value->type() == Item::FUNC_ITEM &&
830 !(((Item_func*)default_value)->functype() == Item_func::NOW_FUNC &&
831 (type == DRIZZLE_TYPE_TIMESTAMP or type == DRIZZLE_TYPE_MICROTIME)))
833 my_error(ER_INVALID_DEFAULT, MYF(0), field_name.data());
836 else if (default_value->type() == Item::NULL_ITEM)
839 if ((type_modifier & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) == NOT_NULL_FLAG)
841 my_error(ER_INVALID_DEFAULT, MYF(0), field_name.data());
845 else if (type_modifier & AUTO_INCREMENT_FLAG)
847 my_error(ER_INVALID_DEFAULT, MYF(0), field_name.data());
852 if (on_update_value && (type != DRIZZLE_TYPE_TIMESTAMP and type != DRIZZLE_TYPE_MICROTIME))
854 my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name.data());
858 CreateField* new_field=
new CreateField;
859 if (new_field->init(session, field_name.data(), type, length, decimals, type_modifier, comment, change, interval_list, cs, 0, column_format)
860 || new_field->setDefaultValue(default_value, on_update_value))
863 statement->alter_info.create_list.push_back(new_field);
864 lex->last_field=new_field;
889 TableList *Select_Lex::add_table_to_list(Session *session,
892 const bitset<NUM_OF_TABLE_OPTIONS>& table_options,
893 thr_lock_type lock_type,
894 List<Index_hint> *index_hints_arg,
895 lex_string_t *option)
897 TableList *previous_table_ref;
898 LEX *lex= &session->lex();
902 const char* alias_str= alias ? alias->data() : table->table.data();
903 if (not table_options.test(TL_OPTION_ALIAS) && check_table_name(table->table))
905 my_error(ER_WRONG_TABLE_NAME, MYF(0), table->table.data());
909 if (not table->is_derived_table() && table->db.data())
911 files_charset_info->casedn_str(table->db.str_);
912 if (not schema::check(*session, identifier::Schema(table->db)))
914 my_error(ER_WRONG_DB_NAME, MYF(0), table->db.data());
923 my_message(ER_DERIVED_MUST_HAVE_ALIAS, ER(ER_DERIVED_MUST_HAVE_ALIAS), MYF(0));
926 alias_str= (
char*) session->mem.memdup(alias_str, table->table.size() + 1);
928 TableList *ptr = (TableList *) session->mem.calloc(
sizeof(TableList));
930 if (table->db.data())
932 ptr->setIsFqtn(
true);
933 ptr->setSchemaName(table->db.data());
937 str_ref schema = lex->session->copy_db_to();
940 ptr->setIsFqtn(
false);
941 ptr->setSchemaName(schema.data());
944 ptr->alias= alias_str;
945 ptr->setIsAlias(alias ?
true :
false);
946 ptr->setTableName(table->table.data());
947 ptr->lock_type= lock_type;
948 ptr->force_index= table_options.test(TL_OPTION_FORCE_INDEX);
949 ptr->ignore_leaves= table_options.test(TL_OPTION_IGNORE_LEAVES);
950 ptr->derived= table->sel;
951 ptr->select_lex= lex->current_select;
952 ptr->index_hints= index_hints_arg;
953 ptr->option= option ? option->data() : NULL;
955 if (lock_type != TL_IGNORE)
957 TableList *first_table= (TableList*) table_list.first;
958 for (TableList *tables= first_table; tables; tables= tables->next_local)
960 if (not table_alias_charset->strcasecmp(alias_str, tables->alias) &&
961 not system_charset_info->strcasecmp(ptr->getSchemaName(), tables->getSchemaName()))
963 my_error(ER_NONUNIQ_TABLE, MYF(0), alias_str);
969 if (table_list.size() > 0)
976 previous_table_ref= (TableList*) ((
char*) table_list.next - ((
char*) &(ptr->next_local) - (
char*) ptr));
984 previous_table_ref->next_name_resolution_table= ptr;
993 table_list.link_in_list((
unsigned char*) ptr, (
unsigned char**) &ptr->next_local);
994 ptr->next_name_resolution_table= NULL;
996 lex->add_to_query_tables(ptr);
1020 void Select_Lex::init_nested_join(Session& session)
1022 TableList* ptr= (TableList*) session.mem.calloc(ALIGN_SIZE(
sizeof(TableList)) +
sizeof(NestedJoin));
1023 ptr->setNestedJoin(((NestedJoin*) ((
unsigned char*) ptr + ALIGN_SIZE(
sizeof(TableList)))));
1024 NestedJoin* nested_join= ptr->getNestedJoin();
1025 join_list->push_front(ptr);
1026 ptr->setEmbedding(embedding);
1027 ptr->setJoinList(join_list);
1028 ptr->alias= (
char*)
"(nested_join)";
1030 join_list= &nested_join->join_list;
1049 TableList *Select_Lex::end_nested_join()
1052 TableList* ptr= embedding;
1053 join_list= ptr->getJoinList();
1054 embedding= ptr->getEmbedding();
1055 NestedJoin* nested_join= ptr->getNestedJoin();
1056 if (nested_join->join_list.size() == 1)
1058 TableList *embedded= &nested_join->join_list.front();
1060 embedded->setJoinList(join_list);
1061 embedded->setEmbedding(embedding);
1062 join_list->push_front(embedded);
1065 else if (not nested_join->join_list.size())
1087 TableList *Select_Lex::nest_last_join(Session *session)
1089 TableList* ptr= (TableList*) session->mem.calloc(ALIGN_SIZE(
sizeof(TableList)) +
sizeof(NestedJoin));
1090 ptr->setNestedJoin(((NestedJoin*) ((
unsigned char*) ptr + ALIGN_SIZE(
sizeof(TableList)))));
1091 NestedJoin* nested_join= ptr->getNestedJoin();
1092 ptr->setEmbedding(embedding);
1093 ptr->setJoinList(join_list);
1094 ptr->alias= (
char*)
"(nest_last_join)";
1095 List<TableList>* embedded_list= &nested_join->join_list;
1096 embedded_list->clear();
1098 for (uint32_t i=0; i < 2; i++)
1100 TableList *table= join_list->pop();
1101 table->setJoinList(embedded_list);
1102 table->setEmbedding(ptr);
1103 embedded_list->push_back(table);
1104 if (table->natural_join)
1106 ptr->is_natural_join=
true;
1111 if (prev_join_using)
1112 ptr->join_using_fields= prev_join_using;
1115 join_list->push_front(ptr);
1116 nested_join->used_tables= nested_join->not_null_tables= (table_map) 0;
1135 void Select_Lex::add_joined_table(TableList *table)
1137 join_list->push_front(table);
1138 table->setJoinList(join_list);
1139 table->setEmbedding(embedding);
1174 TableList *Select_Lex::convert_right_join()
1176 TableList *tab2= join_list->pop();
1177 TableList *tab1= join_list->pop();
1179 join_list->push_front(tab2);
1180 join_list->push_front(tab1);
1181 tab1->outer_join|= JOIN_TYPE_RIGHT;
1197 void Select_Lex::set_lock_for_tables(thr_lock_type lock_type)
1199 for (TableList *tables= (TableList*) table_list.first; tables; tables= tables->next_local)
1201 tables->lock_type= lock_type;
1232 bool Select_Lex_Unit::add_fake_select_lex(Session *session_arg)
1234 Select_Lex *first_sl= first_select();
1235 assert(!fake_select_lex);
1237 fake_select_lex=
new (session_arg->mem_root) Select_Lex();
1238 fake_select_lex->include_standalone(
this, (Select_Lex_Node**)&fake_select_lex);
1239 fake_select_lex->select_number= INT_MAX;
1240 fake_select_lex->parent_lex= &session_arg->lex();
1241 fake_select_lex->make_empty_select();
1242 fake_select_lex->linkage= GLOBAL_OPTIONS_TYPE;
1243 fake_select_lex->select_limit= 0;
1245 fake_select_lex->context.outer_context=first_sl->context.outer_context;
1247 fake_select_lex->context.resolve_in_select_list=
true;
1248 fake_select_lex->context.select_lex= fake_select_lex;
1258 global_parameters= fake_select_lex;
1259 fake_select_lex->no_table_names_allowed= 1;
1260 session_arg->lex().current_select= fake_select_lex;
1262 session_arg->lex().pop_context();
1286 void push_new_name_resolution_context(Session& session, TableList& left_op, TableList& right_op)
1288 Name_resolution_context *on_context=
new (session.mem_root) Name_resolution_context;
1290 on_context->first_name_resolution_table= left_op.first_leaf_for_name_resolution();
1291 on_context->last_name_resolution_table= right_op.last_leaf_for_name_resolution();
1292 session.lex().push_context(on_context);
1310 void add_join_on(TableList *b, Item *expr)
1323 b->on_expr=
new Item_cond_and(b->on_expr,expr);
1325 b->on_expr->top_level_item();
1367 lex->prev_join_using= using_fields;
1382 if (session->lex().current_select != &session->lex().select_lex)
1386 strncpy(command, lip->
yylval->symbol.str,
1387 min(lip->
yylval->symbol.length, (uint32_t)(
sizeof(command)-1)));
1388 command[min(lip->
yylval->symbol.length, (uint32_t)(
sizeof(command)-1))]=0;
1389 my_error(ER_CANT_USE_OPTION_HERE, MYF(0), command);
1408 chooser_compare_func_creator cmp,
1410 Select_Lex *select_lex)
1412 if ((cmp == &comp_eq_creator) && !all)
1415 if ((cmp == &comp_ne_creator) && all)
1442 Select_Lex *select_lex= &session->lex().select_lex;
1444 if (session->lex().select_lex.item_list.size() != session->lex().value_list.size())
1446 my_message(ER_WRONG_VALUE_COUNT, ER(ER_WRONG_VALUE_COUNT), MYF(0));
1450 if (session->lex().select_lex.table_list.size() > 1)
1452 if (select_lex->order_list.size())
1454 else if (select_lex->select_limit)
1458 my_error(ER_WRONG_USAGE, MYF(0),
"UPDATE", msg);
1484 if (session->lex().update_list.size() != session->lex().value_list.size())
1486 my_message(ER_WRONG_VALUE_COUNT, ER(ER_WRONG_VALUE_COUNT), MYF(0));
1506 if (expr->type() == Item::FUNC_ITEM &&
1507 ((
Item_func *) expr)->functype() == Item_func::NOT_FUNC)
1511 enum_parsing_place place= session->lex().current_select->parsing_place;
1512 if (arg->is_bool_func() || place == IN_WHERE || place == IN_HAVING)
1521 if ((negated= expr->neg_transformer(session)) != 0)
1543 bool check_string_char_length(
str_ref str,
const char *err_msg,
1544 uint32_t max_char_length,
const charset_info_st *
const cs,
1547 int well_formed_error;
1548 uint32_t res= cs->cset->well_formed_len(*cs, str, max_char_length, &well_formed_error);
1550 if (!well_formed_error && str.size() == res)
1554 my_error(ER_WRONG_STRING_LENGTH, MYF(0), str.data(), err_msg, max_char_length);
1559 bool check_identifier_name(
str_ref str, error_t err_code)
1561 uint32_t max_char_length= NAME_CHAR_LEN;
1567 const charset_info_st *
const cs= &my_charset_utf8mb4_general_ci;
1569 int well_formed_error;
1570 uint32_t res= cs->cset->well_formed_len(*cs, str, max_char_length, &well_formed_error);
1572 if (well_formed_error)
1574 my_error(ER_INVALID_CHARACTER_STRING, MYF(0),
"identifier", str.data());
1578 if (str.size() == res)
1585 case ER_WRONG_STRING_LENGTH:
1586 my_error(err_code, MYF(0), str.data(),
"", max_char_length);
1588 case ER_TOO_LONG_IDENT:
1589 my_error(err_code, MYF(0), str.data());
1613 assert(session->
m_lip == NULL);
1615 DRIZZLE_QUERY_PARSE_START(session->getQueryString()->c_str());
1619 session->
m_lip= lip;
1623 bool parse_status= base_sql_parse(session) != 0;
1627 assert(!parse_status || session->
is_error());
1631 session->
m_lip= NULL;
1633 DRIZZLE_QUERY_PARSE_DONE(parse_status || session->
is_fatal_error);