summaryrefslogtreecommitdiff
path: root/sql/sql_class.h
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-01-26 16:59:53 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2018-01-27 11:38:38 +0100
commita0ea3a5822486fa1702d6615f1be30684c3d412f (patch)
tree46726c30bd080cba0152ebd18711e90c740fb70e /sql/sql_class.h
parent524221e7a34d42214e82dd868348b453f2ef1591 (diff)
downloadmariadb-git-bb-10.1-MDEV-14857.tar.gz
MDEV-14857: problem with 10.2.11 server crashing when executing stored procedurebb-10.1-MDEV-14857
Counter for select numbering made stored with the statement (before was global) So now it does have always accurate value which does not depend on interruption of statement prepare by errors like lack of table in a view definition.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r--sql/sql_class.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h
index 4556487bdfe..2dc2fb61e9d 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -1028,6 +1028,21 @@ public:
LEX_STRING name; /* name for named prepared statements */
LEX *lex; // parse tree descriptor
/*
+ LEX whith represent curent statement (conventional, SP or PS)
+
+ For example during view parsing THD::lex will point to the views LEX and
+ THD::stmt_lex will point on LEX of the statement where the view will be
+ included
+
+ Now used to have alwais correct select numbering inside statemet
+ (LEX::current_select_number) without storing and restoring a global
+ counter which was THD::select_number.
+
+ TODO: make some unified statement representation (now SP has different)
+ to store such data like LEX::current_select_number.
+ */
+ LEX *stmt_lex;
+ /*
Points to the query associated with this statement. It's const, but
we need to declare it char * because all table handlers are written
in C and need to point to it.
@@ -2690,7 +2705,6 @@ public:
uint tmp_table, global_disable_checkpoint;
uint server_status,open_options;
enum enum_thread_type system_thread;
- uint select_number; //number of select (used for EXPLAIN)
/*
Current or next transaction isolation level.
When a connection is established, the value is taken from