summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-07-16 01:15:55 +0300
committerbell@sanja.is.com.ua <>2004-07-16 01:15:55 +0300
commit9336d36cf81f404088844fc31918887799d3da03 (patch)
tree7a8e815ca26d9138de3bc77a619aa8103e037911 /sql/sql_load.cc
parent2fd11169ab10b8d752afbcc2dd58a15cf4de9c45 (diff)
downloadmariadb-git-9336d36cf81f404088844fc31918887799d3da03.tar.gz
VIEW
two TABLE_LIST copy eliminated
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index c7a64ea8699..47295d4c6a0 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -113,8 +113,16 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
MYF(0));
DBUG_RETURN(-1);
}
- if (!(table = open_ltable(thd,table_list,lock_type)))
+ table_list->lock_type= lock_type;
+ if (open_and_lock_tables(thd, table_list))
DBUG_RETURN(-1);
+ /* TODO: add key check when we will support VIEWs in LOAD */
+ if (!table_list->updatable)
+ {
+ my_error(ER_NON_UPDATABLE_TABLE, MYF(0), table_list->alias, "LOAD");
+ DBUG_RETURN(-1);
+ }
+ table= table_list->table;
transactional_table= table->file->has_transactions();
log_delayed= (transactional_table || table->tmp_table);
@@ -127,7 +135,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
else
{ // Part field list
thd->dupp_field=0;
- if (setup_tables(table_list) ||
+ /* TODO: use this conds for 'WITH CHECK OPTIONS' */
+ Item *unused_conds= 0;
+ if (setup_tables(thd, table_list, &unused_conds) ||
setup_fields(thd, 0, table_list, fields, 1, 0, 0))
DBUG_RETURN(-1);
if (thd->dupp_field)