summaryrefslogtreecommitdiff
path: root/sql/table.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-04-19 22:27:02 +0200
committerSergei Golubchik <serg@mariadb.org>2018-04-19 22:31:26 +0200
commit1a019d08012db7b3fa6a42d39342792c3418e75b (patch)
treec116066b995f1c7a2d8c11e72aa9fa547a20407b /sql/table.cc
parent5e61e1716e763315009318081fba5994b8910242 (diff)
parentc0b4d74b52e7eec9b13af732193f7f8d7abe05de (diff)
downloadmariadb-git-1a019d08012db7b3fa6a42d39342792c3418e75b.tar.gz
Merge branch 'mysql/5.5' into 5.5
Diffstat (limited to 'sql/table.cc')
-rw-r--r--sql/table.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/sql/table.cc b/sql/table.cc
index 5d73d7dffd2..bb4eae9b1e2 100644
--- a/sql/table.cc
+++ b/sql/table.cc
@@ -1,5 +1,5 @@
-/* Copyright (c) 2000, 2015, Oracle and/or its affiliates.
- Copyright (c) 2008, 2015, MariaDB
+/* Copyright (c) 2000, 2017, Oracle and/or its affiliates.
+ Copyright (c) 2008, 2018, MariaDB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -3630,7 +3630,7 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def)
/* Whether the table definition has already been validated. */
if (table->s->table_field_def_cache == table_def)
- DBUG_RETURN(FALSE);
+ goto end;
if (table->s->fields != table_def->count)
{
@@ -3753,6 +3753,16 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def)
if (! error)
table->s->table_field_def_cache= table_def;
+end:
+
+ if (has_keys && !error && !table->key_info)
+ {
+ report_error(0, "Incorrect definition of table %s.%s: "
+ "indexes are missing",
+ table->s->db.str, table->alias.c_ptr());
+ error= TRUE;
+ }
+
DBUG_RETURN(error);
}