summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2015-07-27 12:50:51 +0200
committerSergei Golubchik <serg@mariadb.org>2015-07-27 12:50:51 +0200
commitcf30074c3ff6815d85bbd864b28adfe7949d340c (patch)
tree076846fcf3e752c669bdb311c4880f54f7822a13 /sql/sql_load.cc
parent6f14531b522a9fa854f98a2354d0fccf827b2013 (diff)
downloadmariadb-git-cf30074c3ff6815d85bbd864b28adfe7949d340c.tar.gz
MDEV-7968 Virtual column set to NULL using load data infile
Don't forget to set thd->lex->unit.insert_table_with_stored_vcol in the mysql_load(). Othewise virtual columns will not be updated.
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 6ecdddc3008..503cc579dd7 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -314,6 +314,18 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
table->prepare_triggers_for_insert_stmt_or_event();
table->mark_columns_needed_for_insert();
+ if (table->vfield)
+ {
+ for (Field **vfield_ptr= table->vfield; *vfield_ptr; vfield_ptr++)
+ {
+ if ((*vfield_ptr)->stored_in_db)
+ {
+ thd->lex->unit.insert_table_with_stored_vcol= table;
+ break;
+ }
+ }
+ }
+
uint tot_length=0;
bool use_blobs= 0, use_vars= 0;
List_iterator_fast<Item> it(fields_vars);