diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-16 17:45:22 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2017-05-17 08:11:01 +0300 |
commit | 4754f88cff3aa40706740c5656f97ff56d1f5c28 (patch) | |
tree | f252ba9629243ca94ad0f5a780804fd1abfced4c /storage/xtradb/handler | |
parent | 7972da8aa1c52121f60fb8fdae534a46892b4e07 (diff) | |
download | mariadb-git-4754f88cff3aa40706740c5656f97ff56d1f5c28.tar.gz |
Never pass NULL to innobase_get_stmt()
Diffstat (limited to 'storage/xtradb/handler')
-rw-r--r-- | storage/xtradb/handler/ha_innodb.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc index 2c6f844d026..c1b9f59fea4 100644 --- a/storage/xtradb/handler/ha_innodb.cc +++ b/storage/xtradb/handler/ha_innodb.cc @@ -2324,15 +2324,11 @@ innobase_get_stmt( THD* thd, /*!< in: MySQL thread handle */ size_t* length) /*!< out: length of the SQL statement */ { - const char* query = NULL; - LEX_STRING *stmt = NULL; - ut_ad(thd != NULL); - stmt = thd_query_string(thd); - if (stmt) { + if (const LEX_STRING *stmt = thd_query_string(thd)) { *length = stmt->length; - query = stmt->str; + return stmt->str; } - return (query); + return NULL; } /**********************************************************************//** |