summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.h
diff options
context:
space:
mode:
authorAlexander Nozdrin <alexander.nozdrin@oracle.com>2010-11-13 18:05:02 +0300
committerAlexander Nozdrin <alexander.nozdrin@oracle.com>2010-11-13 18:05:02 +0300
commit3fa437cf4061c20f2995e859b89a6898d3b646b4 (patch)
tree62acd4e216e7befb8d3b54c2689173b961a839c4 /sql/sp_rcontext.h
parentb4d5039e717bc02a94a42f5511e7077404a31d72 (diff)
downloadmariadb-git-3fa437cf4061c20f2995e859b89a6898d3b646b4.tar.gz
Fix for Bug#56934 (mysql_stmt_fetch() incorrectly fills MYSQL_TIME
structure buffer). This is a follow-up for WL#4435. The bug actually existed not only MYSQL_TYPE_DATETIME type. The problem was that Item_param::set_value() was written in an assumption that it's working with expressions, i.e. with basic data types. There are two different quick fixes here: a) Change Item_param::make_field() -- remove setting of Send_field::length, Send_field::charsetnr, Send_field::flags and Send_field::type. That would lead to marshalling all data using basic types to the client (MYSQL_TYPE_LONGLONG, MYSQL_TYPE_DOUBLE, MYSQL_TYPE_STRING and MYSQL_TYPE_NEWDECIMAL). In particular, that means, DATETIME would be sent as MYSQL_TYPE_STRING, TINYINT -- as MYSQL_TYPE_LONGLONG, etc. That could be Ok for the client, because the client library does reverse conversion automatically (the client program would see DATETIME as MYSQL_TIME object). However, there is a problem with metadata -- the metadata would be wrong (misleading): it would say that DATETIME is marshaled as MYSQL_TYPE_DATETIME, not as MYSQL_TYPE_STRING. b) Set Item_param::param_type properly to actual underlying field type. That would lead to double conversion inside the server: for example, MYSQL_TIME-object would be converted into STRING-object (in Item_param::set_value()), and then converted back to MYSQL_TIME-object (in Item_param::send()). The data however would be marshalled more properly, and also metadata would be correct. This patch implements b). There is also a possibility to avoid double conversion either by clonning the data field, or by storing a reference to it and using it on Item::send() time. That requires more work and might be done later.
Diffstat (limited to 'sql/sp_rcontext.h')
-rw-r--r--sql/sp_rcontext.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index 1af758ed0af..ec8d82063e4 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -220,6 +220,7 @@ private:
during execution.
*/
bool m_return_value_set;
+
/**
TRUE if the context is created for a sub-statement.
*/