diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2018-04-24 20:59:57 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2018-04-24 20:59:57 +0300 |
commit | 7396dfcca7a1eb906edabec02fb59d168f09343d (patch) | |
tree | 5971546f2d27f5a8dc186e0f63ae3d2ac9208a6a /sql/table.cc | |
parent | f79c5a658cc33a10d7744a748a4328254e2cbaf7 (diff) | |
parent | 7b5543b21d31bd1517b49c2524a05b5b83fd9691 (diff) | |
download | mariadb-git-7396dfcca7a1eb906edabec02fb59d168f09343d.tar.gz |
Merge 10.2 into 10.3
Diffstat (limited to 'sql/table.cc')
-rw-r--r-- | sql/table.cc | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/sql/table.cc b/sql/table.cc index 577ed20a87e..39e38462ac3 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, 2016, 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 @@ -3539,7 +3539,7 @@ partititon_err: table TABLE object to free */ -int closefrm(register TABLE *table) +int closefrm(TABLE *table) { int error=0; DBUG_ENTER("closefrm"); @@ -3576,7 +3576,7 @@ int closefrm(register TABLE *table) /* Deallocate temporary blob storage */ -void free_blobs(register TABLE *table) +void free_blobs(TABLE *table) { uint *ptr, *end; for (ptr= table->s->blob_field, end=ptr + table->s->blob_fields ; @@ -4195,7 +4195,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) { @@ -4228,6 +4228,8 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def) is backward compatible. */ } + else + { StringBuffer<1024> sql_type(system_charset_info); sql_type.extra_allocation(256); // Allocate min 256 characters at once for (i=0 ; i < table_def->count; i++, field_def++) @@ -4313,6 +4315,7 @@ Table_check_intact::check(TABLE *table, const TABLE_FIELD_DEF *table_def) error= TRUE; } } + } if (table_def->primary_key_parts) { @@ -4357,6 +4360,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); } |