summaryrefslogtreecommitdiff
path: root/sql/sql_lex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.cc')
-rw-r--r--sql/sql_lex.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql/sql_lex.cc b/sql/sql_lex.cc
index 5a355cedca5..563ebce4ff7 100644
--- a/sql/sql_lex.cc
+++ b/sql/sql_lex.cc
@@ -126,6 +126,7 @@ void lex_start(THD *thd, uchar *buf,uint length)
lex->param_list.empty();
lex->view_list.empty();
lex->prepared_stmt_params.empty();
+ lex->auxiliary_table_list.empty();
lex->unit.next= lex->unit.master=
lex->unit.link_next= lex->unit.return_to= 0;
lex->unit.prev= lex->unit.link_prev= 0;
@@ -1050,6 +1051,30 @@ int MYSQLlex(void *arg, void *yythd)
}
}
+
+/*
+ Skip comment in the end of statement.
+
+ SYNOPSIS
+ skip_rear_comments()
+ begin pointer to the beginning of statement
+ end pointer to the end of statement
+
+ DESCRIPTION
+ The function is intended to trim comments at the end of the statement.
+
+ RETURN
+ Pointer to the last non-comment symbol of the statement.
+*/
+
+uchar *skip_rear_comments(uchar *begin, uchar *end)
+{
+ while (begin < end && (end[-1] <= ' ' || end[-1] == '*' ||
+ end[-1] == '/' || end[-1] == ';'))
+ end-= 1;
+ return end;
+}
+
/*
st_select_lex structures initialisations
*/