summaryrefslogtreecommitdiff
path: root/sql/sql_cursor.cc
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.com>2018-11-09 09:45:37 +0400
committerAlexander Barkov <bar@mariadb.com>2018-11-09 09:56:02 +0400
commit3074beaad6bf259c6427d77783ea821d0b16b424 (patch)
treebae290aa1e69f095bf21667297de268b442931ba /sql/sql_cursor.cc
parentd5e1f6a632ac8cb5ccf7eecf0717290232c0c240 (diff)
downloadmariadb-git-3074beaad6bf259c6427d77783ea821d0b16b424.tar.gz
MDEV-17387 MariaDB Server giving wrong error while executing select query from procedure
Changing the way how a cursor is opened to fetch its structure only, e.g. for a cursor FOR loop record variable. The old methods with setting thd->lex->limit_rows_examined to an Item_uint(0) was not reliable and could push these messages into diagnostics area: The query examined at least 1 rows, which exceeds LIMIT ROWS EXAMINED (0) The new method should be more reliable, as it completely prevents the call of do_select() in JOIN::exec_inner() during the cursor structure discovery, so the execution of the cursor SELECT query returns immediately after the preparation step (when the result row structure becomes known), without even entering the code that fetches the result rows.
Diffstat (limited to 'sql/sql_cursor.cc')
-rw-r--r--sql/sql_cursor.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/sql/sql_cursor.cc b/sql/sql_cursor.cc
index 2a200d279b5..4f3b15c3254 100644
--- a/sql/sql_cursor.cc
+++ b/sql/sql_cursor.cc
@@ -92,6 +92,11 @@ public:
if (materialized_cursor)
materialized_cursor->on_table_fill_finished();
}
+
+ bool view_structure_only() const
+ {
+ return result->view_structure_only();
+ }
};