12
12
You should have received a copy of the GNU General Public License
13
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
16
#include "config.h"
18
18
#define DRIZZLE_LEX 1
20
#include "drizzled/item/num.h"
21
#include "drizzled/abort_exception.h"
22
20
#include <drizzled/my_hash.h>
23
21
#include <drizzled/error.h>
24
22
#include <drizzled/nested_join.h>
25
23
#include <drizzled/query_id.h>
26
#include "drizzled/transaction_services.h"
27
24
#include <drizzled/sql_parse.h>
28
25
#include <drizzled/data_home.h>
29
26
#include <drizzled/sql_base.h>
34
31
#include <drizzled/item/cmpfunc.h>
35
32
#include <drizzled/item/null.h>
36
33
#include <drizzled/session.h>
37
#include <drizzled/session/cache.h>
38
34
#include <drizzled/sql_load.h>
39
35
#include <drizzled/lock.h>
40
36
#include <drizzled/select_send.h>
42
38
#include <drizzled/statement.h>
43
39
#include <drizzled/statement/alter_table.h>
44
40
#include "drizzled/probes.h"
41
#include "drizzled/session_list.h"
45
42
#include "drizzled/global_charset_info.h"
43
#include "drizzled/transaction_services.h"
47
45
#include "drizzled/plugin/logging.h"
48
46
#include "drizzled/plugin/query_rewrite.h"
49
#include "drizzled/plugin/query_cache.h"
50
47
#include "drizzled/plugin/authorization.h"
51
48
#include "drizzled/optimizer/explain_plan.h"
52
49
#include "drizzled/pthread_globals.h"
53
#include "drizzled/plugin/event_observer.h"
54
#include "drizzled/visibility.h"
56
51
#include <limits.h>
59
54
#include <algorithm>
60
#include <boost/date_time.hpp>
61
56
#include "drizzled/internal/my_sys.h"
63
58
using namespace std;
71
66
bool my_yyoverflow(short **a, YYSTYPE **b, ulong *yystacksize);
72
67
static bool parse_sql(Session *session, Lex_input_stream *lip);
73
void parse(Session *session, const char *inBuf, uint32_t length);
68
void mysql_parse(Session *session, const char *inBuf, uint32_t length);
76
71
@defgroup Runtime_Environment Runtime Environment
80
75
extern size_t my_thread_stack_size;
81
76
extern const CHARSET_INFO *character_set_filesystem;
86
static const std::string command_name[COM_END+1]={
94
"Error" // Last command number
78
const LEX_STRING command_name[COM_END+1]={
79
{ C_STRING_WITH_LEN("Sleep") },
80
{ C_STRING_WITH_LEN("Quit") },
81
{ C_STRING_WITH_LEN("Init DB") },
82
{ C_STRING_WITH_LEN("Query") },
83
{ C_STRING_WITH_LEN("Shutdown") },
84
{ C_STRING_WITH_LEN("Connect") },
85
{ C_STRING_WITH_LEN("Ping") },
86
{ C_STRING_WITH_LEN("Error") } // Last command number
99
89
const char *xa_state_names[]={
100
90
"NON-EXISTING", "ACTIVE", "IDLE", "PREPARED"
184
169
Query_id &query_id= Query_id::get_query_id();
186
DRIZZLE_COMMAND_START(session->thread_id, command);
171
DRIZZLE_COMMAND_START(session->thread_id,
188
174
session->command= command;
189
175
session->lex->sql_command= SQLCOM_END; /* to avoid confusing VIEW detectors */
197
183
/* Increase id and count all other statements. */
199
session->status_var.questions++;
185
statistic_increment(session->status_var.questions, &LOCK_status);
203
/* @todo set session->lex->sql_command to SQLCOM_END here */
189
/* TODO: set session->lex->sql_command to SQLCOM_END here */
205
191
plugin::Logging::preDo(session);
206
if (unlikely(plugin::EventObserver::beforeStatement(*session)))
208
// We should do something about an error...
211
193
session->server_status&=
212
194
~(SERVER_QUERY_NO_INDEX_USED | SERVER_QUERY_NO_GOOD_INDEX_USED);
213
195
switch (command) {
214
196
case COM_INIT_DB:
216
if (packet_length == 0)
218
my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
198
status_var_increment(session->status_var.com_stat[SQLCOM_CHANGE_DB]);
222
199
string tmp(packet, packet_length);
224
identifier::Schema identifier(tmp);
226
if (not change_db(session, identifier))
201
if (not mysql_change_db(session, tmp))
228
203
session->my_ok();
234
if (not session->readAndStoreQuery(packet, packet_length))
209
if (! session->readAndStoreQuery(packet, packet_length))
235
210
break; // fatal error is set
236
DRIZZLE_QUERY_START(session->getQueryString()->c_str(),
211
DRIZZLE_QUERY_START(session->query.c_str(),
237
212
session->thread_id,
238
const_cast<const char *>(session->schema()->c_str()));
213
const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));
240
parse(session, session->getQueryString()->c_str(), session->getQueryString()->length());
215
plugin::QueryRewriter::rewriteQuery(session->db, session->query);
216
mysql_parse(session, session->query.c_str(), session->query.length());
270
246
/* If commit fails, we should be able to reset the OK status. */
271
247
session->main_da.can_overwrite_status= true;
272
248
TransactionServices &transaction_services= TransactionServices::singleton();
273
transaction_services.autocommitOrRollback(*session, session->is_error());
249
transaction_services.ha_autocommit_or_rollback(session, session->is_error());
274
250
session->main_da.can_overwrite_status= false;
276
252
session->transaction.stmt.reset();
282
258
if (! session->main_da.is_set())
283
259
session->send_kill_message();
285
if (session->getKilled() == Session::KILL_QUERY || session->getKilled() == Session::KILL_BAD_DATA)
261
if (session->killed == Session::KILL_QUERY || session->killed == Session::KILL_BAD_DATA)
287
session->setKilled(Session::NOT_KILLED);
288
session->setAbort(false);
263
session->killed= Session::NOT_KILLED;
264
session->mysys_var->abort= 0;
291
267
/* Can not be true, but do not take chances in production. */
296
272
case Diagnostics_area::DA_ERROR:
297
273
/* The query failed, send error to log and abort bootstrap. */
298
session->getClient()->sendError(session->main_da.sql_errno(),
274
session->client->sendError(session->main_da.sql_errno(),
299
275
session->main_da.message());
302
278
case Diagnostics_area::DA_EOF:
303
session->getClient()->sendEOF();
279
session->client->sendEOF();
306
282
case Diagnostics_area::DA_OK:
307
session->getClient()->sendOK();
283
session->client->sendOK();
310
286
case Diagnostics_area::DA_DISABLED:
323
299
session->close_thread_tables();
325
301
plugin::Logging::postDo(session);
326
if (unlikely(plugin::EventObserver::afterStatement(*session)))
328
// We should do something about an error...
331
303
/* Store temp state for processlist */
332
304
session->set_proc_info("cleaning up");
333
305
session->command= COM_SLEEP;
334
session->resetQueryString();
306
memset(session->process_list_info, 0, PROCESS_LIST_WIDTH);
307
session->query.clear();
336
309
session->set_proc_info(NULL);
337
session->mem_root->free_root(MYF(memory::KEEP_PREALLOC));
310
free_root(session->mem_root,MYF(memory::KEEP_PREALLOC));
339
312
if (DRIZZLE_QUERY_DONE_ENABLED() || DRIZZLE_COMMAND_DONE_ENABLED())
387
359
session->make_lex_string(&table, schema_table_name, false);
389
361
if (! sel->add_table_to_list(session, new Table_ident(db, table),
390
NULL, table_options, TL_READ))
450
423
Select_Lex *select_lex= &lex->select_lex;
451
424
/* list of all tables in query */
452
425
TableList *all_tables;
426
/* A peek into the query string */
427
size_t proc_info_len= session->query.length() > PROCESS_LIST_WIDTH ?
428
PROCESS_LIST_WIDTH : session->query.length();
430
memcpy(session->process_list_info, session->query.c_str(), proc_info_len);
431
session->process_list_info[proc_info_len]= '\0';
455
434
In many cases first table of main Select_Lex have special meaning =>
486
465
drizzle_reset_errors(session, 0);
468
status_var_increment(session->status_var.com_stat[lex->sql_command]);
489
470
assert(session->transaction.stmt.hasModifiedNonTransData() == false);
491
if (! (session->server_status & SERVER_STATUS_AUTOCOMMIT)
492
&& ! session->inTransaction()
493
&& lex->statement->isTransactional())
495
if (session->startTransaction() == false)
497
my_error(drizzled::ER_UNKNOWN_ERROR, MYF(0));
502
472
/* now we are ready to execute the statement */
503
473
res= lex->statement->execute();
504
475
session->set_proc_info("query end");
506
478
The return value for ROW_COUNT() is "implementation dependent" if the
507
479
statement is not DELETE, INSERT or UPDATE, but -1 is what JDBC and ODBC
527
500
param->select_limit=
528
501
new Item_int((uint64_t) session->variables.select_limit);
532
&& ! (session->server_status & SERVER_STATUS_AUTOCOMMIT)
533
&& ! session->inTransaction()
534
&& ! lex->statement->isShow())
536
if (session->startTransaction() == false)
538
my_error(drizzled::ER_UNKNOWN_ERROR, MYF(0));
543
if (not (res= session->openTablesLock(all_tables)))
503
if (!(res= session->openTablesLock(all_tables)))
545
505
if (lex->describe)
576
536
if (!result && !(result= new select_send()))
579
/* Init the Query Cache plugin */
580
plugin::QueryCache::prepareResultset(session);
581
538
res= handle_select(session, lex, result, 0);
582
/* Send the Resultset to the cache */
583
plugin::QueryCache::setResultset(session);
585
539
if (result != lex->result)
641
new_select(LEX *lex, bool move_down)
595
mysql_new_select(LEX *lex, bool move_down)
643
597
Select_Lex *select_lex;
644
598
Session *session= lex->session;
646
600
if (!(select_lex= new (session->mem_root) Select_Lex()))
649
602
select_lex->select_number= ++session->select_number;
650
603
select_lex->parent_lex= lex; /* Used in init_query. */
651
604
select_lex->init_query();
652
605
select_lex->init_select();
653
606
lex->nest_level++;
655
607
if (lex->nest_level > (int) MAX_SELECT_NESTING)
657
609
my_error(ER_TOO_HIGH_LEVEL_OF_NESTING_FOR_SELECT,MYF(0),MAX_SELECT_NESTING);
661
612
select_lex->nest_level= lex->nest_level;
685
636
if (lex->current_select->order_list.first && !lex->current_select->braces)
687
638
my_error(ER_WRONG_USAGE, MYF(0), "UNION", "order_st BY");
691
641
select_lex->include_neighbour(lex->current_select);
692
642
Select_Lex_Unit *unit= select_lex->master_unit();
694
if (not unit->fake_select_lex && unit->add_fake_select_lex(lex->session))
643
if (!unit->fake_select_lex && unit->add_fake_select_lex(lex->session))
697
645
select_lex->context.outer_context=
698
646
unit->first_select()->context.outer_context;
720
667
@param var_name Variable name
723
void create_select_for_variable(Session *session, const char *var_name)
670
void create_select_for_variable(const char *var_name)
726
674
LEX_STRING tmp, null_lex_string;
728
676
char buff[MAX_SYS_VAR_LENGTH*2+4+8];
679
session= current_session;
731
680
lex= session->lex;
681
mysql_init_select(lex);
733
682
lex->sql_command= SQLCOM_SELECT;
734
683
tmp.str= (char*) var_name;
735
684
tmp.length=strlen(var_name);
741
690
if ((var= get_system_var(session, OPT_SESSION, tmp, null_lex_string)))
743
end+= snprintf(buff, sizeof(buff), "@@session.%s", var_name);
692
end+= sprintf(buff, "@@session.%s", var_name);
744
693
var->set_name(buff, end-buff, system_charset_info);
745
694
session->add_item_to_list(var);
755
705
@param length Length of the query text
758
void parse(Session *session, const char *inBuf, uint32_t length)
708
void mysql_parse(Session *session, const char *inBuf, uint32_t length)
760
session->lex->start(session);
762
711
session->reset_for_next_command();
763
/* Check if the Query is Cached if and return true if yes
764
* TODO the plugin has to make sure that the query is cacheble
765
* by setting the query_safe_cache param to TRUE
768
if (plugin::QueryCache::isCached(session))
770
res= plugin::QueryCache::sendCachedResultset(session);
776
713
LEX *lex= session->lex;
777
715
Lex_input_stream lip(session, inBuf, length);
778
717
bool err= parse_sql(session, &lip);
782
if (not session->is_error())
722
if (! session->is_error())
784
DRIZZLE_QUERY_EXEC_START(session->getQueryString()->c_str(),
724
DRIZZLE_QUERY_EXEC_START(session->query.c_str(),
785
725
session->thread_id,
786
const_cast<const char *>(session->schema()->c_str()));
787
// Implement Views here --Brian
726
const_cast<const char *>(session->db.empty() ? "" : session->db.c_str()));
788
727
/* Actually execute the query */
791
execute_command(session);
795
// Just try to catch any random failures that could have come
728
mysql_execute_command(session);
799
729
DRIZZLE_QUERY_EXEC_DONE(0);
805
735
assert(session->is_error());
807
738
lex->unit.cleanup();
808
739
session->set_proc_info("freeing items");
809
740
session->end_statement();
810
741
session->cleanup_after_query();
811
session->set_end_timer();
869
801
if (default_value->type() == Item::FUNC_ITEM &&
870
802
!(((Item_func*)default_value)->functype() == Item_func::NOW_FUNC &&
871
(type == DRIZZLE_TYPE_TIMESTAMP or type == DRIZZLE_TYPE_MICROTIME)))
803
type == DRIZZLE_TYPE_TIMESTAMP))
873
805
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str);
876
808
else if (default_value->type() == Item::NULL_ITEM)
878
810
default_value= 0;
879
if ((type_modifier & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) == NOT_NULL_FLAG)
811
if ((type_modifier & (NOT_NULL_FLAG | AUTO_INCREMENT_FLAG)) ==
881
814
my_error(ER_INVALID_DEFAULT, MYF(0), field_name->str);
892
if (on_update_value && (type != DRIZZLE_TYPE_TIMESTAMP and type != DRIZZLE_TYPE_MICROTIME))
825
if (on_update_value && type != DRIZZLE_TYPE_TIMESTAMP)
894
827
my_error(ER_INVALID_ON_UPDATE, MYF(0), field_name->str);
844
/** Store position for column in ALTER TABLE .. ADD column. */
846
void store_position_for_column(const char *name)
848
current_session->lex->last_field->after=const_cast<char*> (name);
912
852
Add a table to list of used tables.
930
870
TableList *Select_Lex::add_table_to_list(Session *session,
933
const bitset<NUM_OF_TABLE_OPTIONS>& table_options,
934
thr_lock_type lock_type,
935
List<Index_hint> *index_hints_arg,
873
uint32_t table_options,
874
thr_lock_type lock_type,
875
List<Index_hint> *index_hints_arg,
878
register TableList *ptr;
939
879
TableList *previous_table_ref; /* The table preceding the current one. */
941
881
LEX *lex= session->lex;
944
884
return NULL; // End of memory
945
885
alias_str= alias ? alias->str : table->table.str;
946
if (! table_options.test(TL_OPTION_ALIAS) &&
886
if (!test(table_options & TL_OPTION_ALIAS) &&
947
887
check_table_name(table->table.str, table->table.length))
949
889
my_error(ER_WRONG_TABLE_NAME, MYF(0), table->table.str);
953
if (table->is_derived_table() == false && table->db.str)
893
if (table->is_derived_table() == false && table->db.str &&
894
check_db_name(&table->db))
955
my_casedn_str(files_charset_info, table->db.str);
957
identifier::Schema schema_identifier(string(table->db.str));
958
if (not check_db_name(session, schema_identifier))
961
my_error(ER_WRONG_DB_NAME, MYF(0), table->db.str);
896
my_error(ER_WRONG_DB_NAME, MYF(0), table->db.str);
966
900
if (!alias) /* Alias is case sensitive */
971
905
ER(ER_DERIVED_MUST_HAVE_ALIAS), MYF(0));
974
if (!(alias_str= (char*) session->getMemRoot()->duplicate(alias_str,table->table.length+1)))
908
if (!(alias_str= (char*) session->memdup(alias_str,table->table.length+1)))
977
911
if (!(ptr = (TableList *) session->calloc(sizeof(TableList))))
980
913
if (table->db.str)
982
ptr->setIsFqtn(true);
983
ptr->setSchemaName(table->db.str);
916
ptr->db= table->db.str;
984
917
ptr->db_length= table->db.length;
986
else if (lex->copy_db_to(ptr->getSchemaNamePtr(), &ptr->db_length))
919
else if (lex->copy_db_to(&ptr->db, &ptr->db_length))
989
ptr->setIsFqtn(false);
991
924
ptr->alias= alias_str;
992
ptr->setIsAlias(alias ? true : false);
993
ptr->setTableName(table->table.str);
925
ptr->is_alias= alias ? true : false;
926
if (table->table.length)
927
table->table.length= my_casedn_str(files_charset_info, table->table.str);
928
ptr->table_name=table->table.str;
994
929
ptr->table_name_length=table->table.length;
995
930
ptr->lock_type= lock_type;
996
ptr->force_index= table_options.test(TL_OPTION_FORCE_INDEX);
997
ptr->ignore_leaves= table_options.test(TL_OPTION_IGNORE_LEAVES);
931
ptr->force_index= test(table_options & TL_OPTION_FORCE_INDEX);
932
ptr->ignore_leaves= test(table_options & TL_OPTION_IGNORE_LEAVES);
998
933
ptr->derived= table->sel;
999
934
ptr->select_lex= lex->current_select;
1000
935
ptr->index_hints= index_hints_arg;
1008
943
tables=tables->next_local)
1010
if (not my_strcasecmp(table_alias_charset, alias_str, tables->alias) &&
1011
not my_strcasecmp(system_charset_info, ptr->getSchemaName(), tables->getSchemaName()))
945
if (!my_strcasecmp(table_alias_charset, alias_str, tables->alias) &&
946
!strcmp(ptr->db, tables->db))
1013
948
my_error(ER_NONUNIQ_TABLE, MYF(0), alias_str);
1072
1007
bool Select_Lex::init_nested_join(Session *session)
1074
1009
TableList *ptr;
1075
NestedJoin *nested_join;
1010
nested_join_st *nested_join;
1077
1012
if (!(ptr= (TableList*) session->calloc(ALIGN_SIZE(sizeof(TableList))+
1078
sizeof(NestedJoin))))
1013
sizeof(nested_join_st))))
1080
ptr->setNestedJoin(((NestedJoin*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList)))));
1081
nested_join= ptr->getNestedJoin();
1015
nested_join= ptr->nested_join=
1016
((nested_join_st*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList))));
1082
1018
join_list->push_front(ptr);
1083
ptr->setEmbedding(embedding);
1084
ptr->setJoinList(join_list);
1019
ptr->embedding= embedding;
1020
ptr->join_list= join_list;
1085
1021
ptr->alias= (char*) "(nested_join)";
1086
1022
embedding= ptr;
1087
1023
join_list= &nested_join->join_list;
1107
1043
TableList *Select_Lex::end_nested_join(Session *)
1109
1045
TableList *ptr;
1110
NestedJoin *nested_join;
1046
nested_join_st *nested_join;
1112
1048
assert(embedding);
1113
1049
ptr= embedding;
1114
join_list= ptr->getJoinList();
1115
embedding= ptr->getEmbedding();
1116
nested_join= ptr->getNestedJoin();
1050
join_list= ptr->join_list;
1051
embedding= ptr->embedding;
1052
nested_join= ptr->nested_join;
1117
1053
if (nested_join->join_list.elements == 1)
1119
1055
TableList *embedded= nested_join->join_list.head();
1120
1056
join_list->pop();
1121
embedded->setJoinList(join_list);
1122
embedded->setEmbedding(embedding);
1057
embedded->join_list= join_list;
1058
embedded->embedding= embedding;
1123
1059
join_list->push_front(embedded);
1148
1084
TableList *Select_Lex::nest_last_join(Session *session)
1150
1086
TableList *ptr;
1151
NestedJoin *nested_join;
1087
nested_join_st *nested_join;
1152
1088
List<TableList> *embedded_list;
1154
1090
if (!(ptr= (TableList*) session->calloc(ALIGN_SIZE(sizeof(TableList))+
1155
sizeof(NestedJoin))))
1091
sizeof(nested_join_st))))
1157
ptr->setNestedJoin(((NestedJoin*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList)))));
1158
nested_join= ptr->getNestedJoin();
1159
ptr->setEmbedding(embedding);
1160
ptr->setJoinList(join_list);
1093
nested_join= ptr->nested_join=
1094
((nested_join_st*) ((unsigned char*) ptr + ALIGN_SIZE(sizeof(TableList))));
1096
ptr->embedding= embedding;
1097
ptr->join_list= join_list;
1161
1098
ptr->alias= (char*) "(nest_last_join)";
1162
1099
embedded_list= &nested_join->join_list;
1163
1100
embedded_list->empty();
1165
1102
for (uint32_t i=0; i < 2; i++)
1167
1104
TableList *table= join_list->pop();
1168
table->setJoinList(embedded_list);
1169
table->setEmbedding(ptr);
1105
table->join_list= embedded_list;
1106
table->embedding= ptr;
1170
1107
embedded_list->push_back(table);
1171
1108
if (table->natural_join)
1202
1139
void Select_Lex::add_joined_table(TableList *table)
1204
1141
join_list->push_front(table);
1205
table->setJoinList(join_list);
1206
table->setEmbedding(embedding);
1142
table->join_list= join_list;
1143
table->embedding= embedding;
1388
@param session Thread class
1390
@param only_kill_query Should it kill the query or the connection
1393
This is written such that we have a short lock on LOCK_thread_count
1397
kill_one_thread(Session *, ulong id, bool only_kill_query)
1400
uint32_t error= ER_NO_SUCH_THREAD;
1401
pthread_mutex_lock(&LOCK_thread_count); // For unlink from list
1403
for (SessionList::iterator it= getSessionList().begin(); it != getSessionList().end(); ++it )
1405
if ((*it)->thread_id == id)
1408
pthread_mutex_lock(&tmp->LOCK_delete); // Lock from delete
1412
pthread_mutex_unlock(&LOCK_thread_count);
1416
if (tmp->isViewable())
1418
tmp->awake(only_kill_query ? Session::KILL_QUERY : Session::KILL_CONNECTION);
1422
pthread_mutex_unlock(&tmp->LOCK_delete);
1429
kills a thread and sends response
1433
session Thread class
1435
only_kill_query Should it kill the query or the connection
1438
void sql_kill(Session *session, ulong id, bool only_kill_query)
1441
if (!(error= kill_one_thread(session, id, only_kill_query)))
1444
my_error(error, MYF(0), id);
1449
1449
Check if the select is a simple select (not an union).
1454
1454
1 error ; In this case the error messege is sent to the client
1457
bool check_simple_select(Session::pointer session)
1457
bool check_simple_select()
1459
Session *session= current_session;
1459
1460
LEX *lex= session->lex;
1460
1461
if (lex->current_select != &lex->select_lex)
1576
CREATE TABLE query pre-check.
1578
@param session Thread handler
1579
@param tables Global table list
1580
@param create_table Table which will be created
1588
bool create_table_precheck(TableIdentifier &identifier)
1590
if (not plugin::StorageEngine::canCreateTable(identifier))
1592
my_error(ER_DBACCESS_DENIED_ERROR, MYF(0), "", "", identifier.getSchemaName());
1575
1601
negate given expression.
1577
1603
@param session thread handler
1641
bool check_identifier_name(LEX_STRING *str, error_t err_code,
1667
bool check_identifier_name(LEX_STRING *str, uint32_t err_code,
1642
1668
uint32_t max_char_length,
1643
1669
const char *param_for_err_msg)
1706
1731
/* Parse the query. */
1708
bool parse_status= DRIZZLEparse(session) != 0;
1733
bool mysql_parse_status= DRIZZLEparse(session) != 0;
1710
1735
/* Check that if DRIZZLEparse() failed, session->is_error() is set. */
1712
assert(!parse_status || session->is_error());
1737
assert(!mysql_parse_status || session->is_error());
1714
1739
/* Reset Lex_input_stream. */
1716
1741
session->m_lip= NULL;
1718
DRIZZLE_QUERY_PARSE_DONE(parse_status || session->is_fatal_error);
1743
DRIZZLE_QUERY_PARSE_DONE(mysql_parse_status || session->is_fatal_error);
1720
1745
/* That's it. */
1722
return parse_status || session->is_fatal_error;
1747
return mysql_parse_status || session->is_fatal_error;