summaryrefslogtreecommitdiff
path: root/sql/sql_lex.h
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_lex.h')
-rw-r--r--sql/sql_lex.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/sql/sql_lex.h b/sql/sql_lex.h
index 784a69cf9c1..f1b558b8be4 100644
--- a/sql/sql_lex.h
+++ b/sql/sql_lex.h
@@ -1392,9 +1392,9 @@ public:
@retval FALSE OK
@retval TRUE Error
*/
- bool init(THD *thd, const char *buff, unsigned int length);
+ bool init(THD *thd, char *buff, unsigned int length);
- void reset(const char *buff, unsigned int length);
+ void reset(char *buff, unsigned int length);
/**
Set the echo mode.
@@ -1510,6 +1510,20 @@ public:
}
/**
+ Puts a character back into the stream, canceling
+ the effect of the last yyGet() or yySkip().
+ Note that the echo mode should not change between calls
+ to unput, get, or skip from the stream.
+ */
+ char *yyUnput(char ch)
+ {
+ *--m_ptr= ch;
+ if (m_echo)
+ m_cpp_ptr--;
+ return m_ptr;
+ }
+
+ /**
End of file indicator for the query text to parse.
@return true if there are no more characters to parse
*/
@@ -1666,7 +1680,7 @@ public:
private:
/** Pointer to the current position in the raw input stream. */
- const char *m_ptr;
+ char *m_ptr;
/** Starting position of the last token parsed, in the raw buffer. */
const char *m_tok_start;
@@ -2348,7 +2362,7 @@ public:
@retval FALSE OK
@retval TRUE Error
*/
- bool init(THD *thd, const char *buff, unsigned int length)
+ bool init(THD *thd, char *buff, unsigned int length)
{
return m_lip.init(thd, buff, length);
}
@@ -2359,7 +2373,7 @@ public:
Lex_input_stream m_lip;
Yacc_state m_yacc;
- void reset(const char *found_semicolon, unsigned int length)
+ void reset(char *found_semicolon, unsigned int length)
{
m_lip.reset(found_semicolon, length);
m_yacc.reset();