summaryrefslogtreecommitdiff
path: root/sql/sql_view.cc
diff options
context:
space:
mode:
authorunknown <malff/marcsql@weblab.(none)>2007-04-24 09:25:54 -0600
committerunknown <malff/marcsql@weblab.(none)>2007-04-24 09:25:54 -0600
commit6f5cacfae89cdd7ef4498ab73b4213117a118e9b (patch)
treec077f6aec7d906b5ade273fd8d620f53aedbdfcc /sql/sql_view.cc
parentc94da3764fde2c4cb775317052b483df9f45d129 (diff)
parent3eff7d4dd5bba598fe055808697d630622fa249b (diff)
downloadmariadb-git-6f5cacfae89cdd7ef4498ab73b4213117a118e9b.tar.gz
Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into weblab.(none):/home/marcsql/TREE/mysql-5.0-25411_d sql/item_func.cc: Auto merged sql/log_event.cc: Auto merged sql/mysql_priv.h: Auto merged sql/slave.cc: Auto merged sql/sp.cc: Auto merged sql/sp_head.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_lex.cc: Auto merged sql/sql_lex.h: Auto merged sql/sql_parse.cc: Auto merged sql/sql_prepare.cc: Auto merged sql/sql_view.cc: Auto merged
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r--sql/sql_view.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc
index d717aea9a3e..ba367040b36 100644
--- a/sql/sql_view.cc
+++ b/sql/sql_view.cc
@@ -772,8 +772,8 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view,
view->query.str= (char*)str.ptr();
view->query.length= str.length()-1; // we do not need last \0
view->source.str= thd->query + thd->lex->create_view_select_start;
- view->source.length= (char *)skip_rear_comments((uchar *)view->source.str,
- (uchar *)thd->query +
+ view->source.length= (char *)skip_rear_comments((char *)view->source.str,
+ (char *)thd->query +
thd->query_length) -
view->source.str;
view->file_version= 1;
@@ -984,10 +984,14 @@ bool mysql_make_view(THD *thd, File_parser *parser, TABLE_LIST *table,
now Lex placed in statement memory
*/
table->view= lex= thd->lex= (LEX*) new(thd->mem_root) st_lex_local;
- lex_start(thd, (uchar*)table->query.str, table->query.length);
- view_select= &lex->select_lex;
- view_select->select_number= ++thd->select_number;
+
{
+ Lex_input_stream lip(thd, table->query.str, table->query.length);
+ thd->m_lip= &lip;
+ lex_start(thd);
+ view_select= &lex->select_lex;
+ view_select->select_number= ++thd->select_number;
+
ulong save_mode= thd->variables.sql_mode;
/* switch off modes which can prevent normal parsing of VIEW
- MODE_REAL_AS_FLOAT affect only CREATE TABLE parsing