summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2017-11-02 14:39:54 +0200
committerMonty <monty@mariadb.org>2017-11-02 17:05:53 +0200
commit5d0153c408ff8c7282fc387c4041fdbffd35727d (patch)
tree30296001e294566c12425223e9cef43fa01dab9e /sql/handler.cc
parentd8a9b524f2e4efec675725c4c32acefe1d8dcb15 (diff)
downloadmariadb-git-5d0153c408ff8c7282fc387c4041fdbffd35727d.tar.gz
MDEV-12633 Error from valgrind related to dd_frm_type
"Conditional jump or move depends on uninitialised value in my_scan_weight_utf8_general_ci, main.mysql_client_test fails in biuldbot with valgrind" - Fixed by ensuring that engine_name is set to empty string even in case errors in the .frm file - Added some error checking to ha_table_exists()
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 4e35780b1e2..a5a28ceb777 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -5063,10 +5063,15 @@ bool ha_table_exists(THD *thd, const char *db, const char *table_name,
{
char engine_buf[NAME_CHAR_LEN + 1];
LEX_STRING engine= { engine_buf, 0 };
+ frm_type_enum type;
- if (dd_frm_type(thd, path, &engine) != FRMTYPE_VIEW)
+ if ((type= dd_frm_type(thd, path, &engine)) == FRMTYPE_ERROR)
+ DBUG_RETURN(0);
+
+ if (type != FRMTYPE_VIEW)
{
- plugin_ref p= plugin_lock_by_name(thd, &engine, MYSQL_STORAGE_ENGINE_PLUGIN);
+ plugin_ref p= plugin_lock_by_name(thd, &engine,
+ MYSQL_STORAGE_ENGINE_PLUGIN);
*hton= p ? plugin_hton(p) : NULL;
if (*hton)
// verify that the table really exists