summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-05-27 21:28:33 +0530
committerThirunarayanan Balathandayuthapani <thiru@mariadb.com>2019-05-27 21:35:16 +0530
commitb8b74e141d0aef3f93241ce027af2fb944085fbe (patch)
tree5d8195575ed655efe5ac3395e5664725471bcd20
parent35522455e0c0d680a68609b2bb82e4321afce32f (diff)
downloadmariadb-git-b8b74e141d0aef3f93241ce027af2fb944085fbe.tar.gz
MDEV-19027 create_table_def fails when virtual column is present between stored columns
- create_table_def() misconstructs the dict_table_t by ignoring the stored columns of the table if virtual column is present between stored columns.
-rw-r--r--storage/innobase/handler/ha_innodb.cc11
1 files changed, 8 insertions, 3 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index dbb74e4d99f..f2f43f18502 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -11016,7 +11016,6 @@ create_table_info_t::create_table_def()
ulint binary_type;
ulint long_true_varchar;
ulint charset_no;
- ulint j = 0;
ulint doc_id_col = 0;
ibool has_doc_id_col = FALSE;
mem_heap_t* heap;
@@ -11106,7 +11105,7 @@ error_ret:
heap = mem_heap_create(1000);
- for (ulint i = 0; i < n_cols; i++) {
+ for (ulint i = 0, j = 0; j < n_cols; i++) {
Field* field = m_form->field[i];
col_type = get_innobase_type_from_mysql_type(
@@ -11214,10 +11213,16 @@ err_col:
dict_mem_table_add_s_col(
table, 0);
}
+
+ if (is_virtual && omit_virtual) {
+ continue;
+ }
+
+ j++;
}
if (num_v) {
- for (ulint i = 0; i < n_cols; i++) {
+ for (ulint i = 0, j = 0; i < n_cols; i++) {
dict_v_col_t* v_col;
const Field* field = m_form->field[i];