diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-04-03 14:34:32 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-04-05 15:03:02 +0400 |
commit | ce4b291b513f9ac4566f66721ec792981f34881c (patch) | |
tree | cd0a5922421254e9fe668ae5b44f67fa17e10e49 /sql/sp_rcontext.cc | |
parent | 48a7ea6da3dc98f055e7aee0d05df04cfbc5855e (diff) | |
download | mariadb-git-ce4b291b513f9ac4566f66721ec792981f34881c.tar.gz |
A cleanup patch for MDEV-12011 sql_mode=ORACLE: cursor%ROWTYPE in variable declarations
Addressing Monty's review suggestions
Diffstat (limited to 'sql/sp_rcontext.cc')
-rw-r--r-- | sql/sp_rcontext.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/sp_rcontext.cc b/sql/sp_rcontext.cc index 18f603f932d..fcbe5ddf757 100644 --- a/sql/sp_rcontext.cc +++ b/sql/sp_rcontext.cc @@ -743,11 +743,17 @@ int sp_cursor::open(THD *thd) } +/** + Open the cursor, but do not copy data. + This method is used to fetch the cursor structure + to cursor%ROWTYPE routine variables. + Data copying is suppressed by setting thd->lex->limit_rows_examined to 0. +*/ int sp_cursor::open_view_structure_only(THD *thd) { int res; int thd_no_errors_save= thd->no_errors; - Item *limit_rows_examined= thd->lex->limit_rows_examined; + Item *limit_rows_examined= thd->lex->limit_rows_examined; // No data copying if (!(thd->lex->limit_rows_examined= new (thd->mem_root) Item_uint(thd, 0))) return -1; thd->no_errors= true; // Suppress ER_QUERY_EXCEEDED_ROWS_EXAMINED_LIMIT |