diff options
author | Andrei Elkin <aelkin@mysql.com> | 2008-11-12 19:51:47 +0200 |
---|---|---|
committer | Andrei Elkin <aelkin@mysql.com> | 2008-11-12 19:51:47 +0200 |
commit | ca2d1846950b07115a001a37d84ce63ab2acdc6c (patch) | |
tree | da19273bb9e832fe232c5251aa3f4d9dc29ee7f0 /sql/sql_view.cc | |
parent | 162e550fcf986454cd1a542e98d8adc8fa81fd00 (diff) | |
parent | 1d521f6c20881997c9162bd11cadcbc77d20520b (diff) | |
download | mariadb-git-ca2d1846950b07115a001a37d84ce63ab2acdc6c.tar.gz |
merging 5.1 -> 5.1 rpl. 3 of 4 conflicts are resolved similarly to 6.0->6.0-rpl merging.
mysql_upgrade results changed due to the error messesge of mysqlcheck has changed.
Diffstat (limited to 'sql/sql_view.cc')
-rw-r--r-- | sql/sql_view.cc | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/sql/sql_view.cc b/sql/sql_view.cc index 87b073af078..83e8d5907cf 100644 --- a/sql/sql_view.cc +++ b/sql/sql_view.cc @@ -816,13 +816,24 @@ static int mysql_register_view(THD *thd, TABLE_LIST *view, DBUG_PRINT("info", ("View: %s", view_query.ptr())); /* fill structure */ - view->select_stmt.str= view_query.c_ptr_safe(); - view->select_stmt.length= view_query.length(); view->source= thd->lex->create_view_select; + if (!thd->make_lex_string(&view->select_stmt, view_query.ptr(), + view_query.length(), false)) + { + my_error(ER_OUT_OF_RESOURCES, MYF(0)); + error= -1; + goto err; + } + view->file_version= 1; view->calc_md5(md5); - view->md5.str= md5; + if (!(view->md5.str= (char*) thd->memdup(md5, 32))) + { + my_error(ER_OUT_OF_RESOURCES, MYF(0)); + error= -1; + goto err; + } view->md5.length= 32; can_be_merged= lex->can_be_merged(); if (lex->create_view_algorithm == VIEW_ALGORITHM_MERGE && @@ -949,8 +960,13 @@ loop_out: lex_string_set(&view->view_connection_cl_name, view->view_creation_ctx->get_connection_cl()->name); - view->view_body_utf8.str= is_query.c_ptr_safe(); - view->view_body_utf8.length= is_query.length(); + if (!thd->make_lex_string(&view->view_body_utf8, is_query.ptr(), + is_query.length(), false)) + { + my_error(ER_OUT_OF_RESOURCES, MYF(0)); + error= -1; + goto err; + } /* Check that table of main select do not used in subqueries. |